[texhax] Underline with numbers

Paul Isambert zappathustra at free.fr
Sun Dec 12 17:34:39 CET 2010

Le 11/12/2010 23:43, Evan Wessler a écrit :
> I'm trying to create underlined text, but with numbers under the underlines. (I need to refer to the underlined pieces of text by number.) If that's confusing, imagine being able to do the same thing with an underline as you're able to do with an arrow like \xleftarrow[below]{above}, where the [below] and {above} text end up below and above the arrow with subscript/superscript sizing, respectively.
> Of course, I tried \underline[option]{text}, but was sad to discover no option existed.
> Anyone have any advice?

If your underlined text is not supposed to break, then the following 
might do:


     \hbox to \wd\uboxa{\hfil#3\hfil}}%



produces an underlined <text> with <number> below (or anything else, for 
that matter); the depth of that is <depth>, which defaults to the 
natural depth of <text> (as if the rule and the number below did not 
exist). The line


in the definition of \@unum can be modified to set the amount of space 
surrounding the rule.

Now if you want your text to break across lines, it'll be a little bit 


More information about the texhax mailing list