According to What is the recommended way to assign a value to a variable and retrieve it for later use?, in ConTeXt, one can use \setvalue{name}{value} to set a value and \getvalue{name}, to retrieve that value later. This seems to only work if \setvalue is used before \getvalue is needed. How can I retrieve a value early on in a document, when the value is set much later in the document?
|
|
|||||||||
|
|
What Marco said: use ConTeXt's multi-pass data mechanism. Here's how.
Typically |
||||
|
|
|
The OP asked for a ConTeXt solution, which is provided by Esteis (only works with ConTeXt). For "overkill" here a non-ConTeXt solution (only works without ConTeXt): In the document's preamble:
or some other "harmless" value, just to have the value set for the first compilation run. In the document
and later in the document:
which writes |
|||||||||||||
|