weird spacing after command type
Dear list, I have the following sample: \define[1]\slide{\startmakeup[standard]#1\stopmakeup} \definetype[texcode][style=\ttd, option=TEX] \starttext \slide{\texcode{\ifodd\pageno impar\else par\fi}} \startmakeup[standard] \texcode{\ifodd\pageno impar\else par\fi} \stopmakeup \stoptext I wonder why \slide introduces a space after each command. Am I missing something or have I hit a bug? Many thanks for your help, Pablo -- http://www.ousia.tk
Pablo Rodriguez schrieb am 14.10.18 um 20:38:
Dear list,
I have the following sample:
\define[1]\slide{\startmakeup[standard]#1\stopmakeup}
\definetype[texcode][style=\ttd, option=TEX]
\starttext \slide{\texcode{\ifodd\pageno impar\else par\fi}}
\startmakeup[standard] \texcode{\ifodd\pageno impar\else par\fi} \stopmakeup \stoptext
I wonder why \slide introduces a space after each command.
Am I missing something or have I hit a bug?
This is normal behaviour for TeX which inserts a spaces after control sequences when it tokenizes the input. \starttext \detokenize{\ifx\a\b\else\fi} \stoptext The best thing you can do is to avoid verbatim code in arguments of other commands (section headers are one case where you can’t avoid this) and your normal use of the makeup-environment shows how you can avoid the unwanted output. Another way to avoid the space is to create commands which don’t take argument which works only when you have a environment which isn’t delimited (i.e. the environment grabs everything from the start-command to the stop-command). \define\slide{\groupedcommand{\startmakeup[standard]}{\stopmakeup}} Wolfgang
participants (2)
-
Pablo Rodriguez
-
Wolfgang Schuster