[NTG-context] What does #+ do?
Jairo A. del Rio
jairoadelrio6 at gmail.com
Tue Jul 14 02:08:50 CEST 2020
Hi list!
In evenmore pp. 76-77, concerning LMTX extended macro parsing, the
following examples of #0, #+ and #- are given
\def\TestA#1#2#3{{(#1)(#2)(#3)}}
\def\TestB#1#0#3{(#1)(#2)(#3)}
\def\TestC#1#+#3{(#1)(#2)(#3)}
\def\TestD#1#-#2{(#1)(#2)}
So
\TestA1{\red 2}3
\TestB1{\red 2}3
\TestC1{\red 2}3
\TestD1{\red 2}3
give
(1)(2)(3) % red from "2" onward
(1)()(3)
(1)(2)(3) % only "2" is colored
(1)(3)
What I guess is that #+ pass an argument, grouping braces included (the
report says an argument is passed "as-is"). I see it as really useful. But,
apart from the example above, are there any other differences between
doing, say, \def\foo#1#2#3 and \def\foo#+#+#+{#1#2#3}? Thank you very much.
Cordially,
Jairo :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200713/a4f558bb/attachment.htm>
More information about the ntg-context
mailing list