A problem with modes
Hello, this doesn't work for me: \definestartstop[amode][before={\startmode[a]}, after={\stopmode}] \starttext All modes. \startamode ``A'' mode. \stopamode \stoptext Can I use \startmode with \definestartstop? Or is there a better way to do something like this? TIA -- Marcin Borkowski http://mbork.pl
On 2012-06-26, at 10:12 PM, Marcin Borkowski
Hello,
this doesn't work for me:
\definestartstop[amode][before={\startmode[a]}, after={\stopmode}]
\starttext
All modes. \startamode ``A'' mode. \stopamode
\stoptext
Can I use \startmode with \definestartstop? Or is there a better way to do something like this?
(Untested): try the \doifmodeelse version. Aditya
Am 26.06.2012 um 22:12 schrieb Marcin Borkowski:
Hello,
this doesn't work for me:
\definestartstop[amode][before={\startmode[a]}, after={\stopmode}]
\starttext
All modes. \startamode ``A'' mode. \stopamode
\stoptext
Can I use \startmode with \definestartstop?
No you can’t.
Or is there a better way to do something like this?
It depends on what you want to do. You can create a buffer command: \def\startamode{\grabbufferdata[amode][startamode][stopamode]} %\def\stopamode {\getbuffer[amode]} \starttext All modes. \startamode “A” mode. \stopamode \stoptext or you use my annotation module: \usemodule[annotation] \defineannotation[amode][alternative=text] %\defineannotation[amode][alternative=none] \starttext All modes. \startamode “A” mode. \stopamode \stoptext Wolfgang
Dnia 2012-06-26, o godz. 22:44:40
Wolfgang Schuster
Am 26.06.2012 um 22:12 schrieb Marcin Borkowski:
Hello,
this doesn't work for me:
\definestartstop[amode][before={\startmode[a]}, after={\stopmode}]
\starttext
All modes. \startamode ``A'' mode. \stopamode
\stoptext
Can I use \startmode with \definestartstop?
No you can’t.
I was afraid of this...
Or is there a better way to do something like this?
It depends on what you want to do. You can create a buffer command:
\def\startamode{\grabbufferdata[amode][startamode][stopamode]} %\def\stopamode {\getbuffer[amode]}
\starttext
All modes. \startamode “A” mode. \stopamode
\stoptext
Thanks, it worked. One question: is there any difference between \def\starta{...} \def\stopa{...} and \definestartstop[a][before={...},after={...}] ?
Wolfgang
Best, -- Marcin Borkowski http://mbork.pl
Am 26.06.2012 um 23:25 schrieb Marcin Borkowski:
Or is there a better way to do something like this?
It depends on what you want to do. You can create a buffer command:
\def\startamode{\grabbufferdata[amode][startamode][stopamode]} %\def\stopamode {\getbuffer[amode]}
\starttext
All modes. \startamode “A” mode. \stopamode
\stoptext
Thanks, it worked. One question: is there any difference between
\def\starta{...} \def\stopa{...}
and
\definestartstop[a][before={...},after={…}]
Yes because in my definition for \startamode I start a buffer which reads everything untill the delimiting \stopamode and stores it in memory, afterwards you can access the stored content with \getbuffer[…]. When you use \definestartstop to create the environment you have only two commands which perform a few things at the begin and end of the environment but you can do much with the content itself, the only way to gobble the content is to store it in a box but than the buffer method is easier. Wolfgang
participants (3)
-
Aditya Mahajan
-
Marcin Borkowski
-
Wolfgang Schuster