<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Apr 13, 2010 at 12:35 AM, Donald Arseneau <span dir="ltr"><<a href="mailto:asnd@triumf.ca">asnd@triumf.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Vafa Khalighi <<a href="mailto:vafakh84@gmail.com">vafakh84@gmail.com</a>> writes:<br>
<br>
</div><div><div></div><div class="h5">> > To add to the other solutions... this one only defines one<br>
> > macro and works with both { } and \bgroup \egroup...<br>
> ><br>
> > \def\hboxR{\begingroup<br>
> > \everyhbox{%<br>
> > \aftergroup\endgroup<br>
> > \everyhbox{}%<br>
> > \beginR<br>
> > \bgroup<br>
> > \aftergroup\endR<br>
> > \aftergroup\egroup<br>
> > }\hbox}<br>
> ><br>
> ><br>
> \setbox0=\hboxR{This is a test.}<br>
> \box0<br>
><br>
> Would not work here, because TeX expects a box. How can one fix this?<br>
<br>
</div></div>Indeed a big shortcoming.<br>
<br>
One solution is to use another layer of \hbox{ } instead of<br>
\begingroup \endgroup<br>
<br>
\def\hboxR{\hbox\bgroup<br>
\everyhbox{%<br>
\aftergroup\egroup<br>
<div class="im"> \everyhbox{}%<br>
\beginR<br>
\bgroup<br>
\aftergroup\endR<br>
\aftergroup\egroup<br>
}\hbox}<br>
<br>
</div>There is still the problem that \hboxR is an expandable macro<br>
instead of a primitive. Since \beginR indicates that you<br>
have etex enabled, use<br>
<br>
\protected\def\hboxR...<br>
<div><div></div><div class="h5"><br clear="all"><br></div></div></blockquote><div><br>Thanks Donald and all who replied. I have been learning a lot from the answers you all gave.<br><br>Thanks again <br></div></div><br>-- <br>
Best wishes,<br>Vafa Khalighi<br>
</div>