Am 07.01.2013 um 22:20 schrieb Marco Patzer <home...@lavabit.com>:

> Hi,
> 
> what is the best solution to place the content of annotations before
> they are defined in the text? What comes to mind is writing the
> content into an external file and read it in the next run. But maybe
> I overcomplicate things (usually I do) and there's a simpler
> solution. Here's an example:
> 
> \usemodule
>  [annotation]
> 
> \defineannotation
>  [myannotation]
> 
> \setupannotation
>  [myannotation]
>  [alternative=myalternative]
> 
> \defineannotationalternative
>  [myalternative]
>  [renderingsetup=annotation:myalternative]
> 
> \startsetups [annotation:myalternative]
>  Content: \placeannotationcontent
> \stopsetups
> 
> \starttext
> 
> %% The annotation content should be placed here.
> 
> \input ward \blank
> 
> %% Although it is defined later
> \startmyannotation
>  \input knuth
> \stopmyannotation
> 
> \stoptext

That’s not possible because the content is stored only in memory and is 
therefore only available after you put the environment in your document.

What you can do is to set the content of the environment at the begin of the 
document and refer to it at a later position like you can do with buffers.

\usemodule[annotation]

\defineannotation[test][method=buffer,text=Test]

\starttest[one]
\input knuth
\stoptest

\starttest[two]
\input ward
\stoptest

\starttext

\gettest[two][title=Ward]

\gettest[one][title=Knuth]

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

Reply via email to