TeX - LaTeX Asked by dreamlax on July 6, 2021
Is it possible to define a macro in ConTeXt which gobbles space after the argument? For example, given this input:
defthing{dosingleargumentdothing}
defdothing[#1]{thing#1}
starttext
thing[hello]
thing[world]
stoptext
This produces the following output:
But, ideally, I’d like it to run together, like this:
I realise I can use thing[hello]%
, but just wondering whether there’s something easy I may have missed here. These thing
commands are currently being generated by a script. I could configure the script to output the %
, but the TeX file is likely to be tweaked by hand afterwards, where it’s possible the %
may end up missing, and then the space appears again, so I’d like to try and reduce this possible human error and keep the TeX file looking tidy.
There may be a better way to do this in ConTeXt, but the spurious space was removed after placing ignorespaces
as the end of the macro definition:
defthing{dosingleargumentdothing}
defdothing[#1]{thing#1ignorespaces}
Correct answer by dreamlax on July 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP