[texhax] A macro programming question
Donald Arseneau
asnd at triumf.ca
Sun Apr 11 12:29:41 CEST 2010
Vafa Khalighi <vafakh84 at gmail.com> writes:
> I can say \hbox to 10pt{This is a test.}
>
> Now I want to define the macro \hboxR, so that when I say
>
> \hboxR to 10pt{This is a test.}
>
> it actually means
>
> \hbox to 10pt{\beginR This is a test\endR}
To add to the other solutions... this one only defines one
macro and works with both { } and \bgroup \egroup...
\def\hboxR{\begingroup
\everyhbox{%
\aftergroup\endgroup
\everyhbox{}%
\beginR
\bgroup
\aftergroup\endR
\aftergroup\egroup
}\hbox}
--
Donald Arseneau asnd at triumf.ca
More information about the texhax
mailing list