ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Place an annotation before it is defined
@ 2013-01-07 21:20 Marco Patzer
  2013-01-07 21:25 ` Hans Hagen
  2013-01-07 21:34 ` Wolfgang Schuster
  0 siblings, 2 replies; 16+ messages in thread
From: Marco Patzer @ 2013-01-07 21:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 790 bytes --]

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

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:20 Place an annotation before it is defined Marco Patzer
@ 2013-01-07 21:25 ` Hans Hagen
  2013-01-07 21:49   ` Marco Patzer
  2013-01-07 21:34 ` Wolfgang Schuster
  1 sibling, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2013-01-07 21:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 1/7/2013 10:20 PM, Marco Patzer wrote:
> 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:

buffers (or blocks)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:20 Place an annotation before it is defined Marco Patzer
  2013-01-07 21:25 ` Hans Hagen
@ 2013-01-07 21:34 ` Wolfgang Schuster
  2013-01-07 21:56   ` Marco Patzer
  1 sibling, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-07 21:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.01.2013 um 22:20 schrieb Marco Patzer <homerow@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:25 ` Hans Hagen
@ 2013-01-07 21:49   ` Marco Patzer
  2013-01-07 21:57     ` Wolfgang Schuster
  2013-01-07 21:59     ` Hans Hagen
  0 siblings, 2 replies; 16+ messages in thread
From: Marco Patzer @ 2013-01-07 21:49 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 503 bytes --]

On 2013–01–07 Hans Hagen wrote:

> buffers (or blocks)

Buffers apparently can't be used before the content is defined, but
it works for blocks (I never used them). Test:

\defineblock [bar]

\starttext

buf: \getbuffer[foo]
BBBBBBBBBBB

\startbuffer[foo]
buf: AAAAAAAAAAA
\stopbuffer

\useblocks [bar]
DDDDDDDDDDD

\beginbar
block: CCCCCCCCCCC
\endbar

\stoptext

Is there a reason why the blocks favour begin/end instead of
start/stop? Looks weird somehow.


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:34 ` Wolfgang Schuster
@ 2013-01-07 21:56   ` Marco Patzer
  2013-01-07 22:01     ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Patzer @ 2013-01-07 21:56 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 797 bytes --]

On 2013–01–07 Wolfgang Schuster wrote:

> 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]

Nice, I didn't know the “method” key.

Blocks, in contrast to buffers, seem to be able to place content
before it is defined. I did not check how they work, but since I
didn't see any temporary files, the only possibility is to write the
data to the tuc file, I assume. It is by any chance possible to
provide a “method=block”?


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:49   ` Marco Patzer
@ 2013-01-07 21:57     ` Wolfgang Schuster
  2013-01-07 22:20       ` Jaroslav Hajtmar
  2013-01-07 21:59     ` Hans Hagen
  1 sibling, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-07 21:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.01.2013 um 22:49 schrieb Marco Patzer <homerow@lavabit.com>:

> On 2013–01–07 Hans Hagen wrote:
> 
>> buffers (or blocks)
> 
> Buffers apparently can't be used before the content is defined, but
> it works for blocks (I never used them). Test:
> 
> \defineblock [bar]
> 
> \starttext
> 
> buf: \getbuffer[foo]
> BBBBBBBBBBB
> 
> \startbuffer[foo]
> buf: AAAAAAAAAAA
> \stopbuffer
> 
> \useblocks [bar]
> DDDDDDDDDDD
> 
> \beginbar
> block: CCCCCCCCCCC
> \endbar
> 
> \stoptext
> 
> Is there a reason why the blocks favour begin/end instead of
> start/stop? Looks weird somehow.

Blocks use begin/end to allow the same name for the environment as other commands, e.g. for exams:

\defineblock[question]
\defineblock[answer]

\hideblocks[answer]

\defineenumeration[question]
\defineenumeration[answer]

\starttext

\chapter{Questions} % Show only the question blocks

\beginquestion
\startquestion
First question.
\stopquestion
\endquestion

\beginanswer
\startasnwer
Answer to the first question.
\stopanswer
\endanswer

\chapter{Answers} % Show the question with the corresponding answer

\useblocks[question,answer]

\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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:49   ` Marco Patzer
  2013-01-07 21:57     ` Wolfgang Schuster
@ 2013-01-07 21:59     ` Hans Hagen
  1 sibling, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2013-01-07 21:59 UTC (permalink / raw)
  To: ntg-context

On 1/7/2013 10:49 PM, Marco Patzer wrote:
> On 2013–01–07 Hans Hagen wrote:
>
>> buffers (or blocks)
>
> Buffers apparently can't be used before the content is defined, but
> it works for blocks (I never used them). Test:
>
> \defineblock [bar]
>
> \starttext
>
> buf: \getbuffer[foo]
> BBBBBBBBBBB
>
> \startbuffer[foo]
> buf: AAAAAAAAAAA
> \stopbuffer
>
> \useblocks [bar]
> DDDDDDDDDDD
>
> \beginbar
> block: CCCCCCCCCCC
> \endbar
>
> \stoptext
>
> Is there a reason why the blocks favour begin/end instead of
> start/stop? Looks weird somehow.

(1) nicer symmetry checks (matching begin/end start/stop)
(2) more visible in complex docs
(3) it was first needed for \beginquestion \startquestion ... 
\stopquestion \endquestion

etc

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:56   ` Marco Patzer
@ 2013-01-07 22:01     ` Wolfgang Schuster
  2013-01-07 22:20       ` Marco Patzer
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-07 22:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.01.2013 um 22:56 schrieb Marco Patzer <homerow@lavabit.com>:

> On 2013–01–07 Wolfgang Schuster wrote:
> 
>> 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]
> 
> Nice, I didn't know the “method” key.
> 
> Blocks, in contrast to buffers, seem to be able to place content
> before it is defined. I did not check how they work, but since I
> didn't see any temporary files, the only possibility is to write the
> data to the tuc file, I assume. It is by any chance possible to
> provide a “method=block”?

Yes, blocks are stored in the tux-file while buffers are only stored in memory.

I played for a while with \setdataset to store the content but dropped it because
it required multiple runs and especially in the first run the output would be always
wrong because no content is available but I can consider it as a optional method.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 21:57     ` Wolfgang Schuster
@ 2013-01-07 22:20       ` Jaroslav Hajtmar
  2013-01-07 22:25         ` Wolfgang Schuster
  2013-01-07 22:28         ` Marco Patzer
  0 siblings, 2 replies; 16+ messages in thread
From: Jaroslav Hajtmar @ 2013-01-07 22:20 UTC (permalink / raw)
  To: ntg-context

Hello Wolfgang,
Last example is not working! I have installed last version of standalone 
version...

Jaroslav Hajtmar

Here is this example ...


\defineblock[question]
\defineblock[answer]

\hideblocks[answer]


\defineenumeration[question]
\defineenumeration[answer]

\starttext

\chapter{Questions} % Show only the question blocks

\beginquestion
\startquestion
First question.
\stopquestion
\endquestion

\beginanswer
\startasnwer
Answer to the first question.
\stopanswer
\endanswer

\chapter{Answers} % Show the question with the corresponding answer

\useblocks[question,answer]

\stoptext





Dne 7.1.2013 22:57, Wolfgang Schuster napsal(a):
> Am 07.01.2013 um 22:49 schrieb Marco Patzer <homerow@lavabit.com>:
>
>> On 2013–01–07 Hans Hagen wrote:
>>
>>> buffers (or blocks)
>> Buffers apparently can't be used before the content is defined, but
>> it works for blocks (I never used them). Test:
>>
>> \defineblock [bar]
>>
>> \starttext
>>
>> buf: \getbuffer[foo]
>> BBBBBBBBBBB
>>
>> \startbuffer[foo]
>> buf: AAAAAAAAAAA
>> \stopbuffer
>>
>> \useblocks [bar]
>> DDDDDDDDDDD
>>
>> \beginbar
>> block: CCCCCCCCCCC
>> \endbar
>>
>> \stoptext
>>
>> Is there a reason why the blocks favour begin/end instead of
>> start/stop? Looks weird somehow.
> Blocks use begin/end to allow the same name for the environment as other commands, e.g. for exams:
>
> \defineblock[question]
> \defineblock[answer]
>
> \hideblocks[answer]
>
> \defineenumeration[question]
> \defineenumeration[answer]
>
> \starttext
>
> \chapter{Questions} % Show only the question blocks
>
> \beginquestion
> \startquestion
> First question.
> \stopquestion
> \endquestion
>
> \beginanswer
> \startasnwer
> Answer to the first question.
> \stopanswer
> \endanswer
>
> \chapter{Answers} % Show the question with the corresponding answer
>
> \useblocks[question,answer]
>
> \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
> ___________________________________________________________________________________
>

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 22:01     ` Wolfgang Schuster
@ 2013-01-07 22:20       ` Marco Patzer
  2013-01-10 21:21         ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Patzer @ 2013-01-07 22:20 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1251 bytes --]

On 2013–01–07 Wolfgang Schuster wrote:

> > Blocks, in contrast to buffers, seem to be able to place content
> > before it is defined. I did not check how they work, but since I
> > didn't see any temporary files, the only possibility is to write the
> > data to the tuc file, I assume. It is by any chance possible to
> > provide a “method=block”?
> 
> Yes, blocks are stored in the tux-file while buffers are only stored in memory.
> 
> I played for a while with \setdataset to store the content but dropped it because
> it required multiple runs and especially in the first run the output would be always
> wrong

That's no problem IMO. Two-pass data is always wrong the first run.
In the worst case, it needs an additional run if text moves around
too much. But since it's just another method, which is optional,
this only applies if it's activated and then the user knows what
he/she is doing and that it might be slower.

> I can consider it as a optional method.

I think it would be a nice feature. It enables placement of elements
where they logically belong, instead of where they are supposed to
be printed. It's nothing mission critical though, but you can keep
it in mind for a rainy afternoon.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 22:20       ` Jaroslav Hajtmar
@ 2013-01-07 22:25         ` Wolfgang Schuster
  2013-01-07 22:28         ` Marco Patzer
  1 sibling, 0 replies; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-07 22:25 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users


Am 07.01.2013 um 23:20 schrieb Jaroslav Hajtmar <hajtmar@gyza.cz>:

> Hello Wolfgang,
> Last example is not working! I have installed last version of standalone version…

The example wasn’t tested and I’m not even sure if everything is correct
because I haven’t used the commands since a while.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 22:20       ` Jaroslav Hajtmar
  2013-01-07 22:25         ` Wolfgang Schuster
@ 2013-01-07 22:28         ` Marco Patzer
  1 sibling, 0 replies; 16+ messages in thread
From: Marco Patzer @ 2013-01-07 22:28 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 680 bytes --]

On 2013–01–07 Jaroslav Hajtmar wrote:

> Last example is not working! I have installed last version of

> \defineblock[question]
> \defineblock[answer]
> 
> \hideblocks[answer]
> 
> 
> \defineenumeration[question]
> \defineenumeration[answer]
> 
> \starttext
> 
> \chapter{Questions} % Show only the question blocks
> 
> \beginquestion
> \startquestion
> First question.
> \stopquestion
> \endquestion
> 
> \beginanswer
> \startasnwer

\startanswer

> Answer to the first question.
> \stopanswer
> \endanswer
> 
> \chapter{Answers} % Show the question with the corresponding answer
> 
> \useblocks[question,answer]
> 
> \stoptext

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-07 22:20       ` Marco Patzer
@ 2013-01-10 21:21         ` Wolfgang Schuster
  2013-01-11  8:45           ` Marco Patzer
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-10 21:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.01.2013 um 23:20 schrieb Marco Patzer <homerow@lavabit.com>:

> On 2013–01–07 Wolfgang Schuster wrote:
> 
>>> Blocks, in contrast to buffers, seem to be able to place content
>>> before it is defined. I did not check how they work, but since I
>>> didn't see any temporary files, the only possibility is to write the
>>> data to the tuc file, I assume. It is by any chance possible to
>>> provide a “method=block”?
>> 
>> Yes, blocks are stored in the tux-file while buffers are only stored in memory.
>> 
>> I played for a while with \setdataset to store the content but dropped it because
>> it required multiple runs and especially in the first run the output would be always
>> wrong
> 
> That's no problem IMO. Two-pass data is always wrong the first run.
> In the worst case, it needs an additional run if text moves around
> too much. But since it's just another method, which is optional,
> this only applies if it's activated and then the user knows what
> he/she is doing and that it might be slower.
> 
>> I can consider it as a optional method.
> 
> I think it would be a nice feature. It enables placement of elements
> where they logically belong, instead of where they are supposed to
> be printed. It's nothing mission critical though, but you can keep
> it in mind for a rainy afternoon.

You can try the beta from my bitbucket site [0] which uses a two mechanism
for named buffers (\startannotation[<NAME>] … \stopannotation) which can
be accessed with \getannotation[<NAME>].

[0] https://bitbucket.org/wolfs/annotation/src

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-10 21:21         ` Wolfgang Schuster
@ 2013-01-11  8:45           ` Marco Patzer
  2013-01-11 16:08             ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Patzer @ 2013-01-11  8:45 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 973 bytes --]

On 2013–01–10 Wolfgang Schuster wrote:

> You can try the beta from my bitbucket site [0] which uses a two mechanism
> for named buffers (\startannotation[<NAME>] … \stopannotation) which can
> be accessed with \getannotation[<NAME>].

It doesn't work for me:

\usemodule        [annotation]
\defineannotation [myannotation]

\starttext

aaaaa
\getannotation [foo]
bbbbb

\startmyannotation [foo]
  ANNOTATION
\stopmyannotation

\stoptext

results in

aaaaa
bbbbb
ANNOTATION

Furthermore

\usemodule        [annotation]
\defineannotation [myannotation]
\setupannotation  [myannotation] [alternative=paragraph]

\starttext
  \startmyannotation
  \stopmyannotation
\stoptext

results in

<+ t-annotation.lua>)
! Undefined control sequence.

[…]

\540>:way ->\sharedcounterparameter
                                    \c!way
<argument> ...rparameter {\currentcounter }\c!way

Tested on: 2013.01.10 01:04


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-11  8:45           ` Marco Patzer
@ 2013-01-11 16:08             ` Wolfgang Schuster
  2013-01-11 17:06               ` Marco Patzer
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2013-01-11 16:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.01.2013 um 09:45 schrieb Marco Patzer <homerow@lavabit.com>:

> On 2013–01–10 Wolfgang Schuster wrote:
> 
>> You can try the beta from my bitbucket site [0] which uses a two mechanism
>> for named buffers (\startannotation[<NAME>] … \stopannotation) which can
>> be accessed with \getannotation[<NAME>].
> 
> It doesn't work for me:
> 
> \usemodule        [annotation]
> \defineannotation [myannotation]

Use

\defineannotation[myannotation][method=buffer]

to disable the output from \startmyannotation … \stopmyannotation.

> \starttext
> 
> aaaaa
> \getannotation [foo]

You need \getmyannotation[foo].

> bbbbb
> 
> \startmyannotation [foo]
>  ANNOTATION
> \stopmyannotation
> 
> \stoptext
> 
> results in
> 
> aaaaa
> bbbbb
> ANNOTATION
> 
> Furthermore
> 
> \usemodule        [annotation]
> \defineannotation [myannotation]
> \setupannotation  [myannotation] [alternative=paragraph]
> 
> \starttext
>  \startmyannotation
>  \stopmyannotation
> \stoptext
> 
> results in
> 
> <+ t-annotation.lua>)
> ! Undefined control sequence.
> 
> […]
> 
> \540>:way ->\sharedcounterparameter
>                                    \c!way
> <argument> ...rparameter {\currentcounter }\c!way
> 
> Tested on: 2013.01.10 01:04

No idea where this comes from because there is no command with this name in the current version of the module.

Do you have the following block at the begin of t-annoation.mkvi?

%D \module
%D   [     file=t-annotation,
%D      version=2013.01.10,
%D        title=\CONTEXT\ User Module,
%D     subtitle=Annotations,
%D       author=Wolfgang Schuster,
%D         date=\currentdate,
%D    copyright=Wolfgang Schuster,
%D      license=GNU General Public License]

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Place an annotation before it is defined
  2013-01-11 16:08             ` Wolfgang Schuster
@ 2013-01-11 17:06               ` Marco Patzer
  0 siblings, 0 replies; 16+ messages in thread
From: Marco Patzer @ 2013-01-11 17:06 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1077 bytes --]

On 2013–01–11 Wolfgang Schuster wrote:

> Use
> 
> \defineannotation[myannotation][method=buffer]
> 
> to disable the output from \startmyannotation … \stopmyannotation.
> 
> > \starttext
> > 
> > aaaaa
> > \getannotation [foo]
> 
> You need \getmyannotation[foo].

It works perfectly, though I don't have much to test it with, except
one document. Future will show. Thanks a lot for implementing this.

> > <+ t-annotation.lua>)
> > ! Undefined control sequence.
> > 
> > […]
> > 
> > \540>:way ->\sharedcounterparameter
> >                                    \c!way
> > <argument> ...rparameter {\currentcounter }\c!way
> > 
> > Tested on: 2013.01.10 01:04
> 
> No idea where this comes from because there is no command with this name in the current version of the module.

Ignore it! For some reason mercurial said “Nothing to update” and
let me believe I was using the new version but, in fact kept using
the old one.

> Do you have the following block at the begin of t-annoation.mkvi?
> […]

Now I do, yes :)

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-01-11 17:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07 21:20 Place an annotation before it is defined Marco Patzer
2013-01-07 21:25 ` Hans Hagen
2013-01-07 21:49   ` Marco Patzer
2013-01-07 21:57     ` Wolfgang Schuster
2013-01-07 22:20       ` Jaroslav Hajtmar
2013-01-07 22:25         ` Wolfgang Schuster
2013-01-07 22:28         ` Marco Patzer
2013-01-07 21:59     ` Hans Hagen
2013-01-07 21:34 ` Wolfgang Schuster
2013-01-07 21:56   ` Marco Patzer
2013-01-07 22:01     ` Wolfgang Schuster
2013-01-07 22:20       ` Marco Patzer
2013-01-10 21:21         ` Wolfgang Schuster
2013-01-11  8:45           ` Marco Patzer
2013-01-11 16:08             ` Wolfgang Schuster
2013-01-11 17:06               ` Marco Patzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).