Am 16.01.2013 um 16:39 schrieb Marco Patzer
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