# [OS X TeX] underlined variable, how to make it line break.

Joseph C. Slater PE, PhD joseph.slater at wright.edu
Sat Apr 5 15:01:58 EDT 2008

On Apr 5, 2008, at 1:18 PM, Bruno Voisin wrote:
> On 5 avr. 08, at 17:34, Joseph C. Slater PE, PhD wrote:
>
>> On Apr 5, 2008, at 8:28 AM, Bruno Voisin wrote:
>>> <snip>
> Hi Joe,
>
> That's because of the sentence in the doc from ulem.sty:
>
> ALL THE TEXT IN BRACES OR COMING FROM A MACRO IS TYPESET IN A BOX.
>
> Meaning that, because \thesistitle is a macro, \uline will put it in
> a box before underlining it. Hence I decided to try \expandafter, so
> as to tell TeX to expand the macro \thesistitle *before* applying
> \uline to it. And because \thesistitle is preceded by "{" in
> \uline{\thesistitle}, with "{" itself expandable, you need one
> \expandafter before "{" and several others before \uline.
>
> The result is the construct
>
> \expandafter\expandafter\expandafter\uline\expandafter{\thesistitle}
>
> which tells TeX to expand (i.e. interpret) \thesistitle first, then
> "{", then \uline.
>
> In case you're not familiar with it, \expandafter is a plain TeX
> macro (maybe it's one of the primitives defined in the TeX program
> itself, I'm not sure) to be used as \expandafter\a\b to tell TeX to
> expand \b first then \a. It's defined in one chapter of the TeXbook
> (I don't have it at hand right now), probably the one on macros, and
> there are plenty of examples of \expandafter trickery in appendix D.
>

That's where my knowledge falls short. I don't know basic TeX, so I
wasn't familiar with the \expandafter command. This is the first time
a pure LaTeX failed me.
Joe