Hello, On Wed, 16 Jan 2013 12:47:21 +0100, Philipp Gesang <[email protected]> wrote:
Lookup the correct string from a table?
thanks for the idea -
- in other words, we have to keep running results somewhere; the algorithm
fills a table with texts for each page, and each \setlayer takes one value
back, so we can simplify to:
----
\setupbodyfont[30pt]
\starttext
A
\definelayer [beforetext][width=\overlaywidth,height=\overlayheight]
\defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
\startsetups[beforetext]
\setlayer[beforetext][preset=righttop]
{\framed[width=2in]{\directlua{context(table.remove(userdata.LPr.texts,
1))}}}
\stopsetups
\startluacode
userdata = userdata or { }
userdata.LPr = userdata.LPr or { }
userdata.LPr.texts = {}
for i = 1, 2 do
context.startTEXpage { background = "foreground,beforetext" }
table.insert(userdata.LPr.texts, "BEF" .. i)
context.externalfigure({"cow"},{width="30cm"})
context.stopTEXpage()
end
\stopluacode
Z
\stoptext
----
This works.
I'm just thinking whether it would be possible to simplify that all - we're
using overlays, layers, setups for overlays and an internal table to keep
running results...
BTW: What does \tightlayer[beforetext] exactly do?
Q2: Why some layer properties are specified on \definelayer (beforetext:
width=\overlaywidth,height=\overlayheight) and some during overlay setups
(beforetext: preset=righttop)?
Lukas
--
Ing. Lukáš Procházka [mailto:[email protected]]
Pontex s. r. o. [mailto:[email protected]] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4
Tel: +420 244 062 238
Fax: +420 244 461 038
Lay9.mkiv
Description: Binary data
Lay9.pdf
Description: Adobe PDF document
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
