Building a token list in lua
In TeX, a 'write' node is inserted with, say:
write1{stringdoit{thelastypos}}
With pure luatex, a node could be created with:
local n = node.new(8, 1)
n.stream = 1
n.data = <token-list>
According to the manual, the <token-list>
is a table representing the token list to be written (with a list of triplets). I couldn't find any documentation about how this list is built. I discovered a string is accepted, but it gets converted to a string'ed list of chars (much like meaning), so thelastypos
is written verbatim, not evaluated.
I've found a workaround, shown in the following piece of code:
setbox0hbox{write1{thelastxpos}}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' ** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
I define a box with a write
and then inspect the node. In the real code, instead of printing it I pass it to n.data
and primitives work as expected (with some problems in user defined macros).
My question is: how to generate in lua the token list to feed the data
field? [Edit. Please, note my questions is not about lastypos
, but about building an arbitrary token list for the data
field. Remember also that, because of the asynchronous nature of TeX, page numbers and the like are not known when the 'write' node is created, only when the 'write' is actually output.]
Here is a latex file to make some experiments, with a lua file named extra.lua:
documentclass{article}
defdonothing#1{}
directlua{
require'extra'
}
setbox0hbox{write1{stringdonothing{thelastypos}}}
begin{document}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' +++ ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
copy0
copy0
copy0
end{document}
The lua file:
local n = node.new(8, 1)
n.stream = 1
n.data = 'abcd#&\the\lastxpos'
for _,d in ipairs(n.data) do
texio.write(' *** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
luatex
|
show 2 more comments
In TeX, a 'write' node is inserted with, say:
write1{stringdoit{thelastypos}}
With pure luatex, a node could be created with:
local n = node.new(8, 1)
n.stream = 1
n.data = <token-list>
According to the manual, the <token-list>
is a table representing the token list to be written (with a list of triplets). I couldn't find any documentation about how this list is built. I discovered a string is accepted, but it gets converted to a string'ed list of chars (much like meaning), so thelastypos
is written verbatim, not evaluated.
I've found a workaround, shown in the following piece of code:
setbox0hbox{write1{thelastxpos}}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' ** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
I define a box with a write
and then inspect the node. In the real code, instead of printing it I pass it to n.data
and primitives work as expected (with some problems in user defined macros).
My question is: how to generate in lua the token list to feed the data
field? [Edit. Please, note my questions is not about lastypos
, but about building an arbitrary token list for the data
field. Remember also that, because of the asynchronous nature of TeX, page numbers and the like are not known when the 'write' node is created, only when the 'write' is actually output.]
Here is a latex file to make some experiments, with a lua file named extra.lua:
documentclass{article}
defdonothing#1{}
directlua{
require'extra'
}
setbox0hbox{write1{stringdonothing{thelastypos}}}
begin{document}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' +++ ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
copy0
copy0
copy0
end{document}
The lua file:
local n = node.new(8, 1)
n.stream = 1
n.data = 'abcd#&\the\lastxpos'
for _,d in ipairs(n.data) do
texio.write(' *** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
luatex
1
you can usetex.lastypos
to avoid needing to tex-expandthelastypos
and put the value straight in the whatsit.
– David Carlisle
Mar 7 at 15:19
lastypos
is just an example. There is nosavepos
in the examples after all.
– Javier Bezos
Mar 7 at 15:33
@DavidCarlisle Furthermore, this would write the value oflastypos
when the whatsit is created, not when it's output, after asave_pos
node.
– Javier Bezos
Mar 7 at 15:48
1
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54
|
show 2 more comments
In TeX, a 'write' node is inserted with, say:
write1{stringdoit{thelastypos}}
With pure luatex, a node could be created with:
local n = node.new(8, 1)
n.stream = 1
n.data = <token-list>
According to the manual, the <token-list>
is a table representing the token list to be written (with a list of triplets). I couldn't find any documentation about how this list is built. I discovered a string is accepted, but it gets converted to a string'ed list of chars (much like meaning), so thelastypos
is written verbatim, not evaluated.
I've found a workaround, shown in the following piece of code:
setbox0hbox{write1{thelastxpos}}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' ** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
I define a box with a write
and then inspect the node. In the real code, instead of printing it I pass it to n.data
and primitives work as expected (with some problems in user defined macros).
My question is: how to generate in lua the token list to feed the data
field? [Edit. Please, note my questions is not about lastypos
, but about building an arbitrary token list for the data
field. Remember also that, because of the asynchronous nature of TeX, page numbers and the like are not known when the 'write' node is created, only when the 'write' is actually output.]
Here is a latex file to make some experiments, with a lua file named extra.lua:
documentclass{article}
defdonothing#1{}
directlua{
require'extra'
}
setbox0hbox{write1{stringdonothing{thelastypos}}}
begin{document}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' +++ ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
copy0
copy0
copy0
end{document}
The lua file:
local n = node.new(8, 1)
n.stream = 1
n.data = 'abcd#&\the\lastxpos'
for _,d in ipairs(n.data) do
texio.write(' *** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
luatex
In TeX, a 'write' node is inserted with, say:
write1{stringdoit{thelastypos}}
With pure luatex, a node could be created with:
local n = node.new(8, 1)
n.stream = 1
n.data = <token-list>
According to the manual, the <token-list>
is a table representing the token list to be written (with a list of triplets). I couldn't find any documentation about how this list is built. I discovered a string is accepted, but it gets converted to a string'ed list of chars (much like meaning), so thelastypos
is written verbatim, not evaluated.
I've found a workaround, shown in the following piece of code:
setbox0hbox{write1{thelastxpos}}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' ** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
I define a box with a write
and then inspect the node. In the real code, instead of printing it I pass it to n.data
and primitives work as expected (with some problems in user defined macros).
My question is: how to generate in lua the token list to feed the data
field? [Edit. Please, note my questions is not about lastypos
, but about building an arbitrary token list for the data
field. Remember also that, because of the asynchronous nature of TeX, page numbers and the like are not known when the 'write' node is created, only when the 'write' is actually output.]
Here is a latex file to make some experiments, with a lua file named extra.lua:
documentclass{article}
defdonothing#1{}
directlua{
require'extra'
}
setbox0hbox{write1{stringdonothing{thelastypos}}}
begin{document}
directlua{
for _,d in ipairs(tex.box[0].head.data) do
texio.write(' +++ ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
}
copy0
copy0
copy0
end{document}
The lua file:
local n = node.new(8, 1)
n.stream = 1
n.data = 'abcd#&\the\lastxpos'
for _,d in ipairs(n.data) do
texio.write(' *** ' .. d[1] .. '/' .. d[2] .. '/' .. d[3])
end
luatex
luatex
edited Mar 7 at 16:53
Javier Bezos
asked Mar 7 at 15:14
Javier BezosJavier Bezos
3,9151216
3,9151216
1
you can usetex.lastypos
to avoid needing to tex-expandthelastypos
and put the value straight in the whatsit.
– David Carlisle
Mar 7 at 15:19
lastypos
is just an example. There is nosavepos
in the examples after all.
– Javier Bezos
Mar 7 at 15:33
@DavidCarlisle Furthermore, this would write the value oflastypos
when the whatsit is created, not when it's output, after asave_pos
node.
– Javier Bezos
Mar 7 at 15:48
1
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54
|
show 2 more comments
1
you can usetex.lastypos
to avoid needing to tex-expandthelastypos
and put the value straight in the whatsit.
– David Carlisle
Mar 7 at 15:19
lastypos
is just an example. There is nosavepos
in the examples after all.
– Javier Bezos
Mar 7 at 15:33
@DavidCarlisle Furthermore, this would write the value oflastypos
when the whatsit is created, not when it's output, after asave_pos
node.
– Javier Bezos
Mar 7 at 15:48
1
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54
1
1
you can use
tex.lastypos
to avoid needing to tex-expand thelastypos
and put the value straight in the whatsit.– David Carlisle
Mar 7 at 15:19
you can use
tex.lastypos
to avoid needing to tex-expand thelastypos
and put the value straight in the whatsit.– David Carlisle
Mar 7 at 15:19
lastypos
is just an example. There is no savepos
in the examples after all.– Javier Bezos
Mar 7 at 15:33
lastypos
is just an example. There is no savepos
in the examples after all.– Javier Bezos
Mar 7 at 15:33
@DavidCarlisle Furthermore, this would write the value of
lastypos
when the whatsit is created, not when it's output, after a save_pos
node.– Javier Bezos
Mar 7 at 15:48
@DavidCarlisle Furthermore, this would write the value of
lastypos
when the whatsit is created, not when it's output, after a save_pos
node.– Javier Bezos
Mar 7 at 15:48
1
1
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54
|
show 2 more comments
1 Answer
1
active
oldest
votes
LuaTeX has the token.create
function to create a token uservalue. They can be combined into a token list by putting them into a table. For stringdonothing{thelastvpos}
this would be:
tl = {
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
Normally the references to tokenlists in the LuaTeX documentation mean this kind of table, but you need a different kind: A table of tables of numbers. Finding these numbers isn't easy, but you can convert token lists in the format above into this other format (Here I am using a little trick: {0, v.tok}
is interpreted in the same way as if we would have split v.tok
properly into three parts):
directlua{
local function convert_tl(list)
local new = {}
for i,v in ipairs(list) do
new[i] = {0, v.tok}
end
return new
end
local n = node.new(8, 1)
n.stream = 3
n.data = convert_tl{
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
tex.box[0] = node.hpack(n)
}
copy0
copy0
results in the output
donothing{0}
donothing{0}
Wow! I wouldn't say thev.tok
is a little trick. But my first tests worked, indeed.
– Javier Bezos
Mar 7 at 17:58
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from.data
.
– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string todata
(which in turn gets tokenized). Otherwise something likex.data = y.data
won't work, which is very very counterintuitive.
– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of thedata
field?
– Javier Bezos
Mar 8 at 18:09
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478216%2fbuilding-a-token-list-in-lua%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
LuaTeX has the token.create
function to create a token uservalue. They can be combined into a token list by putting them into a table. For stringdonothing{thelastvpos}
this would be:
tl = {
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
Normally the references to tokenlists in the LuaTeX documentation mean this kind of table, but you need a different kind: A table of tables of numbers. Finding these numbers isn't easy, but you can convert token lists in the format above into this other format (Here I am using a little trick: {0, v.tok}
is interpreted in the same way as if we would have split v.tok
properly into three parts):
directlua{
local function convert_tl(list)
local new = {}
for i,v in ipairs(list) do
new[i] = {0, v.tok}
end
return new
end
local n = node.new(8, 1)
n.stream = 3
n.data = convert_tl{
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
tex.box[0] = node.hpack(n)
}
copy0
copy0
results in the output
donothing{0}
donothing{0}
Wow! I wouldn't say thev.tok
is a little trick. But my first tests worked, indeed.
– Javier Bezos
Mar 7 at 17:58
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from.data
.
– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string todata
(which in turn gets tokenized). Otherwise something likex.data = y.data
won't work, which is very very counterintuitive.
– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of thedata
field?
– Javier Bezos
Mar 8 at 18:09
add a comment |
LuaTeX has the token.create
function to create a token uservalue. They can be combined into a token list by putting them into a table. For stringdonothing{thelastvpos}
this would be:
tl = {
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
Normally the references to tokenlists in the LuaTeX documentation mean this kind of table, but you need a different kind: A table of tables of numbers. Finding these numbers isn't easy, but you can convert token lists in the format above into this other format (Here I am using a little trick: {0, v.tok}
is interpreted in the same way as if we would have split v.tok
properly into three parts):
directlua{
local function convert_tl(list)
local new = {}
for i,v in ipairs(list) do
new[i] = {0, v.tok}
end
return new
end
local n = node.new(8, 1)
n.stream = 3
n.data = convert_tl{
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
tex.box[0] = node.hpack(n)
}
copy0
copy0
results in the output
donothing{0}
donothing{0}
Wow! I wouldn't say thev.tok
is a little trick. But my first tests worked, indeed.
– Javier Bezos
Mar 7 at 17:58
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from.data
.
– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string todata
(which in turn gets tokenized). Otherwise something likex.data = y.data
won't work, which is very very counterintuitive.
– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of thedata
field?
– Javier Bezos
Mar 8 at 18:09
add a comment |
LuaTeX has the token.create
function to create a token uservalue. They can be combined into a token list by putting them into a table. For stringdonothing{thelastvpos}
this would be:
tl = {
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
Normally the references to tokenlists in the LuaTeX documentation mean this kind of table, but you need a different kind: A table of tables of numbers. Finding these numbers isn't easy, but you can convert token lists in the format above into this other format (Here I am using a little trick: {0, v.tok}
is interpreted in the same way as if we would have split v.tok
properly into three parts):
directlua{
local function convert_tl(list)
local new = {}
for i,v in ipairs(list) do
new[i] = {0, v.tok}
end
return new
end
local n = node.new(8, 1)
n.stream = 3
n.data = convert_tl{
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
tex.box[0] = node.hpack(n)
}
copy0
copy0
results in the output
donothing{0}
donothing{0}
LuaTeX has the token.create
function to create a token uservalue. They can be combined into a token list by putting them into a table. For stringdonothing{thelastvpos}
this would be:
tl = {
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
Normally the references to tokenlists in the LuaTeX documentation mean this kind of table, but you need a different kind: A table of tables of numbers. Finding these numbers isn't easy, but you can convert token lists in the format above into this other format (Here I am using a little trick: {0, v.tok}
is interpreted in the same way as if we would have split v.tok
properly into three parts):
directlua{
local function convert_tl(list)
local new = {}
for i,v in ipairs(list) do
new[i] = {0, v.tok}
end
return new
end
local n = node.new(8, 1)
n.stream = 3
n.data = convert_tl{
token.create'string',
token.create'donothing',
token.create(string.byte'{'),
token.create'the',
token.create'lastypos',
token.create(string.byte'}')
}
tex.box[0] = node.hpack(n)
}
copy0
copy0
results in the output
donothing{0}
donothing{0}
answered Mar 7 at 17:26
Marcel KrügerMarcel Krüger
12.8k11636
12.8k11636
Wow! I wouldn't say thev.tok
is a little trick. But my first tests worked, indeed.
– Javier Bezos
Mar 7 at 17:58
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from.data
.
– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string todata
(which in turn gets tokenized). Otherwise something likex.data = y.data
won't work, which is very very counterintuitive.
– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of thedata
field?
– Javier Bezos
Mar 8 at 18:09
add a comment |
Wow! I wouldn't say thev.tok
is a little trick. But my first tests worked, indeed.
– Javier Bezos
Mar 7 at 17:58
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from.data
.
– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string todata
(which in turn gets tokenized). Otherwise something likex.data = y.data
won't work, which is very very counterintuitive.
– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of thedata
field?
– Javier Bezos
Mar 8 at 18:09
Wow! I wouldn't say the
v.tok
is a little trick. But my first tests worked, indeed.– Javier Bezos
Mar 7 at 17:58
Wow! I wouldn't say the
v.tok
is a little trick. But my first tests worked, indeed.– Javier Bezos
Mar 7 at 17:58
2
2
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from
.data
.– Marcel Krüger
Mar 7 at 18:20
@JavierBezos A little warning: Do not rely too much on reading the tokenlist, newer LuaTeX version only provide the expanded string if you try to read from
.data
.– Marcel Krüger
Mar 7 at 18:20
Bad news, except if you can assign a string to
data
(which in turn gets tokenized). Otherwise something like x.data = y.data
won't work, which is very very counterintuitive.– Javier Bezos
Mar 7 at 18:33
Bad news, except if you can assign a string to
data
(which in turn gets tokenized). Otherwise something like x.data = y.data
won't work, which is very very counterintuitive.– Javier Bezos
Mar 7 at 18:33
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of the
data
field?– Javier Bezos
Mar 8 at 18:09
A little question: do you know if a deep copy of a 'write' node will preserve the internal structure of the
data
field?– Javier Bezos
Mar 8 at 18:09
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478216%2fbuilding-a-token-list-in-lua%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
you can use
tex.lastypos
to avoid needing to tex-expandthelastypos
and put the value straight in the whatsit.– David Carlisle
Mar 7 at 15:19
lastypos
is just an example. There is nosavepos
in the examples after all.– Javier Bezos
Mar 7 at 15:33
@DavidCarlisle Furthermore, this would write the value of
lastypos
when the whatsit is created, not when it's output, after asave_pos
node.– Javier Bezos
Mar 7 at 15:48
1
sure but you could arrange the timing differently, but as you say without any savepos in the example not clear what the timing should be.
– David Carlisle
Mar 7 at 16:07
I've edited my question to clarify what I'm asking.
– Javier Bezos
Mar 7 at 16:54