Am 16.01.2013 um 16:39 schrieb Marco Patzer <[email protected]>:
> On 2013–01–16 Wolfgang Schuster wrote:
>
>> \definevimytping
>> [C]
>> […,
>> before={\ifhmode\startInlineBackground\else\startDisplayBackground\fi},
>> after={\ifhmode\stopInlineBackground\else\stopDisplayBackground\fi},
>> …]
>
> That's a good idea and it seems to work.
>
>> You could also ask Aditya to use different keys for display (e.g.
>> before/aftter)
>> and inline (e.g. left/right) code blocks.
>
> That's not necessary. I think your solution is clean enough.
The test doesn’t work when you use \inlineC at the beginning of a paragraph
because
TeX it at this moment still in vertical mode and you have to add a
\dontleavehmode
to force horizontal mode.
<example>
\def\TestMode
{\ifhmode
\bold{Horizontal Mode}%
\else
\bold{Vertical Mode}%
\fi}
\starttext
\TestMode\ Inline \TestMode
\dontleavehmode\TestMode\ Inline \TestMode
\stoptext
</example>
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________