1% 2% U L E M . S T Y [2012-05-18] 3% 4% The ulem package provides various types of underlining that can stretch 5% between words and be broken across lines in LaTeX or plain TeX. 6% In LaTeX ulem replaces italics with underlining in \em-phasized text. 7% It is most suitable for simple text such as {\em ibid.} or \emph{\LaTeX: 8% A Document Preparation System} that may need to be underlined in a 9% manuscript submitted for publication. A declaration of \normalem (or 10% the \usepackage option "normalem") restores the normal \em behavior. 11% 12% Full instructions appear in ulem.ltx (ulem.pdf). In summary: 13% 14% \uline{important} underlined text 15% \uuline{urgent} double-underlined text 16% \uwave{boat} wavy underline 17% \sout{wrong} line drawn through word 18% \xout{removed} marked over with //////. 19% \dashuline{dashing} dash underline 20% \dotuline{dotty} dotted underline 21% 22% {\em phasized\/} | In LaTeX, by default, these are underlined; use 23% \emph{asized} | \normalem or [normalem] to restore italics 24% \useunder{\uwave}{\bfseries}{\textbf} 25% use wavy underline in place of bold face 26% Use \markoverwith for defining new types of underlining. 27% 28% Copyright (c) 1989-2011 by Donald Arseneau (Vancouver, Canada; asnd@triumf.ca) 29% 30% This software may be freely transmitted, reproduced, or modified for any 31% purpose provided that this copyright notice is left intact. 32% (Small excerpts may be taken and used without any restriction.) 33% 34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35% Defend against multiple loading. 36\expandafter \ifx \csname UL@box\endcsname \relax \else 37 \immediate\write16{ulem.sty refuses to load twice. }\endinput \fi 38 39% Set catcode of @ in case it isn't a "letter" already 40\chardef\ULthickness\catcode\string`\@ % hold catcode temporarily 41\catcode\string`\@=11 42 43\def\uline{\relax \ifmmode\expandafter\underline 44 \else \bgroup\expandafter\ULset\fi} 45 46\newbox\UL@box 47\newbox\UL@hyphenbox 48\newskip\UL@skip 49\newtoks\UL@hook 50 51\newdimen\UL@height 52 53\newcount\UL@pe 54\let\LA@space\ \let\LA@hskip\hskip 55 56\def\UL@end *{\relax\relax}% something harmless unlikely to be found elsewhere 57 58% For regular underlines, set the depth based on the font, or retain 59% the preset value, then start underlining. 60\def\ULset{\UL@setULdepth 61 \def\UL@leadtype{\leaders \hrule \@height\UL@height \@depth\ULdepth}% 62 \ifmmode \ULdepth-4\p@ \fi 63 \UL@height-\ULdepth \advance\UL@height\ULthickness \ULon} 64 65% Automatically set \ULdepth if it is to be automatic (flagged by \maxdimen) 66\def\UL@setULdepth{\relax 67 \ifdim\ULdepth=\maxdimen % Set depth based on font, if not set already 68 \setbox\UL@box\hbox{{(j}}\ULdepth\dp\UL@box\advance\ULdepth.4\p@ 69 % use setbox to support plain TeX 70 \fi} 71 72% \ULon simply calls \UL@on (possibly \UL@on=\UL@onin) for text mode, but 73% \UL@onmath if it is math mode. 74\def\ULon{\ifmmode \expandafter\UL@onmath\else \expandafter\UL@on\fi} 75 76% \UL@on sets the engine of underline running, and tells it 77% where to stop. 78\long\def\UL@on#1{\leavevmode\UL@ender \let\UL@on\UL@onin 79 \everymath{\UL@hrest}\everyvbox{\UL@hrest}\let\hskip\UL@hskip 80 \let\\\UL@cr \let\-\UL@dischyp \let\newline\UL@newline \let\ \UL@space 81 \def\hfil{\hskip\z@ plus1fil\relax}\def\hfill{\hskip\z@ plus1fill\relax}% 82 \def\hss{\hskip\z@ plus1filminus1fil\relax}\let\penalty\UL@penalty 83 \the\UL@hook 84 \UL@word\@empty#1\xdef\UL@spfactor{\the\spacefactor} \UL@end * } 85 86% This is what \ULon does when it appears nested in an inner place. 87\def\UL@onin#1{\leavevmode\UL@ender % when nested, do multiple underlining 88 \UL@height\ULthickness \advance\ULdepth\thr@@\UL@height 89 \advance\UL@height-\ULdepth \setbox\UL@box\hbox{{#1}}% 90 \let\UL@start\relax\UL@putbox\egroup} 91% \UL@putbox is disabled in inner mode, so re-enable it by changing \UL@start 92% \UL@hrest is implicit due to \everyhbox. Double braces for \hbox are in 93% lieu of \color@begin(end)group. 94 95% This is what \ULon does in math mode. 96\def\UL@onmath#1{\UL@ender\mathord{\UL@hrest\mathop{\kern\z@#1}\limits\sb 97 {\UL@leadtype\LA@hskip\p@ plus1fill}}\egroup} 98 99\def\UL@unegroup{} 100\gdef\UL@ender{} 101% end-brace matching hack for when command is used as a font declaration: 102\def\UL@swender{\ifnum`{=\z@\fi\aftergroup}\gdef\UL@ender{}} 103 104% must expand to nothing outside the ifs for syntactical spaces to work. 105% the \expandafters get rid of the \@empty inserted at the beg. of word 106\def\UL@word#1 {\expandafter\UL@start#1 % 107 \expandafter\ifx\expandafter\UL@end#1\egroup\egroup 108 \unskip \unskip \unskip % remove extra leader at end 109 \spacefactor\UL@spfactor \let\UL@word\egroup 110 \else % not finished 111 \ifmmode\else \ifdim\lastskip=\z@\else % allow syntactical spaces 112 \global\UL@skip\lastskip \unskip 113 \UL@stop \UL@leaders 114 \fi\fi 115 \fi \UL@word\@empty}% \@empty preserves braces in param 116 117% \UL@start: start of each chunk. It gives two levels of grouping. 118% Each chunk is ended by \UL@stop. Local intermissions go like 119% \UL@stop...\UL@start. 120\def\UL@start{\setbox\UL@box\hbox\bgroup\everyhbox{\UL@hrest}% 121% the following are to cope with stops (\ ,\- etc) within extra braces 122 \let\UL@start\@empty \def\UL@unegroup{\bgroup\bgroup}\let\UL@leadtype\@empty 123 \bgroup \kern-3sp\kern3sp % kerns so I can test for beginning of list 124 \if@ignore \global\@ignorefalse \ignorespaces \fi} 125 126\def\UL@stop{\global\UL@pe\lastpenalty \unpenalty % penalty in \UL@pe 127 \ifnum\lastkern=\thr@@ \egroup\egroup % Nothing in hbox...but make sure: 128 \ifdim\wd\UL@box=\z@ \else \UL@putbox \fi % something in box so print it 129 \else \egroup\egroup \UL@putbox % something in box so print it 130 \fi \ifnum\UL@pe=\z@ \else \LA@penalty\UL@pe \fi % use penalty from inside box 131 \UL@unegroup} 132% notice that a box with only a penalty in it is discarded, but the penalty 133% is still used! This is so a series of discardable glues and penalties 134% behaves properly. 135 136\def\UL@putbox{\ifx\UL@start\@empty \else % not inner 137 \vrule\@width\z@ \LA@penalty\@M 138 {\UL@skip\wd\UL@box \UL@leaders \kern-\UL@skip}% 139 \box\UL@box \fi} 140 141% With interword leaders, give some overlap to avoid gaps caused by 142% round-off errors in the printing program. Needs \unskip \unskip \unskip 143% above. This version overlaps 1/300 inch, which looks good at high 144% resolution, and will still work down to ~150 dpi. Change the value 145% of \UL@pixel if necessary. 146 147\newdimen\UL@pixel \UL@pixel=1in \divide\UL@pixel 300 148 149\def\UL@leaders{{\LA@hskip-\UL@pixel \advance\UL@skip\tw@\UL@pixel 150 \UL@leadtype\LA@hskip\UL@skip \LA@hskip-\UL@pixel}} 151 152% restore some things for inside math or \mbox 153\def\UL@hrest{\let\ \LA@space \let\-\@empty \let\penalty\LA@penalty} 154 155\def\UL@space{\LA@space \global\UL@skip\lastskip \unskip \UL@reskip}% \ 156 157% Hyphenation is done by explicit \discretionary. The overlapping melds 158% with the running overlap because it *is* part of the running overlap: 159% The word fragment is extended by the width of the hyphenation which is 160% then overlapped by leaders. The discretionary may occupy this space 161% if a break occurs; otherwise the next syllable gets doubly-overlapped 162% (in registration) for a distance of the hyphen's width. 163\def\UL@dischyp{\global\setbox\UL@hyphenbox\hbox 164 {\ifnum \hyphenchar\font<\z@ \string-\else \char\hyphenchar\font \fi}% 165 \kern\wd\UL@hyphenbox \LA@penalty\@M 166 \UL@stop \kern-\wd\UL@hyphenbox 167 \discretionary{\box\UL@hyphenbox}{}{}\UL@start} 168 169\let\LA@penalty\penalty 170\def\UL@penalty{\relax\ifhmode \afterassignment\UL@@penalty\count@ 171 \else\LA@penalty\fi} 172\def\UL@@penalty{\LA@penalty \ifnum\count@=\z@ 173 \@ne \else \count@ \fi % zero penalty => no penalty, so use 1 instead. 174 \UL@stop \UL@start} 175 176% The test \ifx\ \LA@space \else means we are neither in math mode nor an 177% \mbox, so it is safe to stop the current \UL@box. \ , \- , and \penalty 178% (= \linebreak or \nolinebreak) are common enough that they are restored 179% directly (by \UL@hrest); \\, \newline, \hskip (= \hspace) are rare enough 180% that the test is incorporated in their UL versions. This adds processing 181% when they're used, but saves processing in \UL@hrest called by \everymath 182% \everyvbox and \everyhbox. 183 184\def\UL@hskip{\ifx\ \LA@space \LA@hskip \else 185 \afterassignment\UL@reskip \global\UL@skip \fi} 186 187\def\UL@reskip{\UL@stop \UL@leaders \UL@start} 188 189% Redefine \\ and \newline so the vertical space from \\[ ] is not lost 190% and so the \hfil is not underlined! \\ and \newline do nothing if inside 191% inner braces. 192 193\def\UL@cr{\unskip \ifx\ \LA@space \let\UL@vad\@gobble 194 \else \UL@stop \unskip\unskip\unskip \let\UL@vad\vadjust \fi 195 \@ifstar{\UL@vad{\LA@penalty\@M}\UL@cra}\UL@cra} 196\def\UL@cra{\@ifnextchar[\UL@crb\UL@newline} 197\def\UL@crb[#1]{\UL@vad{\vskip#1}\UL@newline} 198 199\def\UL@newline{\ifx\UL@start\@empty % (\UL@cr may have \UL@stop-ed already) 200 \unskip \ifx\ \LA@space \else \UL@stop \unskip\unskip\unskip \fi\fi 201 \LA@hskip \z@\@plus.0001fil\LA@penalty -\@M \UL@start} 202 203% That concludes the basic underlining. To put various other objects 204% (characters) under (or over) text we need to define \markoverwith 205% to set the overlay material in a box, and use leaders of that box for 206% overlaying the text. Here, the meaning of \UL@pixel is changed so 207% that `pixel' size = box size. Note that we generally need \leaders 208% (not \cleaders) for text, because an underline will be a patchwork 209% of small \leaders, and the characters must stay in registration. 210% However, we "hook" the leaders command so specific applications can 211% reassign it (\let\ULleaders\xleaders or \let\ULleaders\cleaders). 212% 213\newbox\ULC@box 214\let\ULleaders\leaders 215 216\def\markoverwith#1{\setbox\ULC@box\hbox{{#1}}\UL@pixel.5\wd\ULC@box 217 \ifmmode \setbox\ULC@box\hbox{\raise1.4ex\box\ULC@box}% 218 \dp\ULC@box-1.4ex\ht\ULC@box\z@ \def\UL@leadtype{\cleaders\copy\ULC@box}% 219 \else 220 \def\UL@leadtype{\ULleaders\copy\ULC@box}% 221 \fi} 222 223% Now define various special underlines. All the definitions go like 224% \def \command {\bgroup \markoverwith{something} \ULon} 225 226% For drawing a wavey underline instead of a straight one the command 227% is \uwave (under-wave) which uses the wiggle from 6-pt lasy font: 228 229\def\uwave{\bgroup \markoverwith{\lower3.5\p@\hbox{\sixly \char58}}\ULon} 230\font\sixly=lasy6 % does not re-load if already loaded, so no memory problem. 231 232% To draw a double underline under text, use \uuline{text} 233 234\def\uuline{\bgroup \UL@setULdepth 235 \markoverwith{\lower\ULdepth\hbox 236 {\kern-.03em\vbox{\hrule width.2em\kern1.2\p@\hrule}\kern-.03em}}% 237 \ULon} 238 239% To draw a line through text instead of under it (strike out) do 240% `under'-line with negative depth. Note that this one uses a real 241% line, not characters, so there is no \markoverwith. 242 243\def\sout{\bgroup \ULdepth=-.55ex \ULset} 244 245% To mark //// over text instead of underlining (x-out) 246% 247\def\xout{\bgroup \markoverwith{\hbox to.35em{\hss/\hss}}\ULon} 248 249\def\dotuline{\bgroup 250 \UL@setULdepth 251 \markoverwith{\begingroup 252 \advance\ULdepth0.08ex 253 \lower\ULdepth\hbox{\kern.1em .\kern.04em}% 254 \endgroup}% 255 \ULon} 256 257\def\dashuline{\bgroup 258 \UL@setULdepth 259 \markoverwith{\kern.13em 260 \vtop{\kern\ULdepth \hrule width .3em}% 261 \kern.13em}\ULon} 262 263% A command to declare that an underline command should be used in 264% place of a particular font selection: 265% \useunder {underline_command}{font_declaration}{font_command} 266% e.g.: \useunder{\uuline}{\bfseries}{\textbf} 267% \useunder{\uwave}{\bf}{} 268 269\def\useunder#1#2#3{\relax 270 \ifx\relax#2\relax\else % declaration command given 271 \def#2{\def\@tempa{#1}\global\let\UL@ender\UL@swender 272 \expandafter\@tempa\expandafter{\ifnum\z@=\string`}\fi}% 273 \MakeRobust{#2}\fi 274 \ifx\relax#3\relax\else % argumentative command 275 \def#3{#1}\MakeRobust{#3}\fi} 276 277\expandafter\ifx \csname @ifundefined\endcsname \relax 278 279% Allow plain TeX to use ulem.sty: 280 \def\@height{height} 281 \def\@depth{depth} 282 \def\@width{width} 283 \def\@empty{} 284 \long\def\@gobble#1{} 285 \def\MakeRobust#1{} 286% Do non-outer \newif with no visible \if's or \fi's when skipping 287 \csname newif\expandafter\endcsname \csname if@ignore\endcsname 288 289\else 290 291 \def\MakeRobust#1{\expandafter\let 292 \csname \expandafter\@gobble\string#1 \endcsname= #1% 293 \edef#1{\noexpand\protect \expandafter\noexpand 294 \csname\expandafter\@gobble\string#1 \endcsname} 295 } 296 \MakeRobust\uline 297 \MakeRobust\uuline 298 \MakeRobust\uwave 299 \MakeRobust\sout 300 \MakeRobust\xout 301 302 \let\LA@em\em \let\LA@emph\emph 303 \expandafter\let\expandafter\LA@Pem \csname em \endcsname 304 \expandafter\let\expandafter\LA@Pemph \csname emph \endcsname 305 \def\ULforem{\useunder{\uline}{\em}{\emph}} 306 \def\normalem{\let\em\LA@em \let\emph\LA@emph 307 \expandafter\let\csname em \endcsname\LA@Pem 308 \expandafter\let\csname emph \endcsname\LA@Pemph} 309 \ULforem % default is to use underlining for \em, 310 311\fi 312 313% Process LaTeX \package options; plain TeX skips this section 314 315\expandafter\ifx\csname ProvidesPackage\endcsname \relax \else 316 \ProvidesPackage{ulem}[2012/05/18] 317 \DeclareOption{normalem}{\normalem} 318 \DeclareOption{ULforem}{\ULforem} 319 \DeclareOption{normalbf}{} 320 \DeclareOption{UWforbf}{\useunder{\uwave}{\bf}{\textbf}} 321 \ProcessOptions 322% 323 \AtBeginDocument{\let\UL@marginpar\marginpar}% 324 \newcommand\UL@marpar[2][\gDefault@pt]{\gdef\gDefault@pt{#2}% 325 \ifx\ \LA@space \@latexerr{Marginpar lost}% 326 \else \UL@stop \UL@marginpar[#1]{#2}\UL@start \fi} 327 \addto@hook\UL@hook{\let\marginpar\UL@marpar} 328\fi 329 330\catcode`@=\ULthickness % Scratch meaning: restore catcode of @ 331 332\def\ULthickness{.4pt}% can change this with \renewcommand 333\newdimen\ULdepth \ULdepth=\maxdimen 334% "maxdimen" depth causes the depth to be set according to the font. You 335% can change \ULdepth for a permanent setting or a special effect (\sout). 336 337\endinput 338 339%====================== BEGIN INSTRUCTIONS =========================== 340These plain text instructions may disappear soon. The primary instructions 341are in ulem.ltx (ulem.pdf, ulem.dvi). 342 343ULEM is a package for LaTeX or plain TeX which provides various types of 344underlining that can stretch between words and be broken across lines. 345In LaTeX this style replaces italics with underlining in emphasized text 346given by \em or \emph -- but only if the text is delimited by braces. A 347declaration \normalem (or the \usepackage option [normalem]) restores the 348normal \em behavior. For underlining in plain TeX, \input ulem.sty, and 349use the \uline command. 350 351Unlike regular underlining, ulem allows line breaks, and even primitive 352hyphenation, within the underlined text; but it is far from perfect. It is 353most suitable for simple text like {\em \LaTeX: A document preparation 354system\/} that may need to be underlined in a manuscript submitted for 355publication. Again, ulem will only replace \em and \emph when the text is 356delimited by explicit braces. 357 358The thickness of the underline rule is given by \ULthickness; use 359\renewcommand or \def (not \setlength) to change it. The depth of the 360underline is controlled by the length \ULdepth. The default value is a 361special flag which lets the current font control the depth. You can set 362a particular value to \ULdepth (using \setlength) to force a particular 363depth, either locally for a special purpose, or for the document as a 364whole. See the definition of \sout. 365 366Every word is typeset in an underlined box, so automatic hyphenation is 367normally disabled, but explicit discretionary hyphens (\-) will still be 368obeyed. Several text-formatting commands are specially supported within 369the underlining: \-, \ , ~, \\, \newline, \linebreak, \nolinebreak, 370\penalty, \hskip, \hspace, \hfil, \hfill, \hss. Displayed math and \par 371are deliberately not supported to aid in the detection of runaway arguments 372(missing braces). The special commands do have a problem: they end a 373group so any local assignments are lost. 374 375The underlines continue between words, and stretch just like ordinary 376spaces do. Since spaces delimit words, there may be some difficulty 377with syntactical spaces (e.g. "2.3 pt"). Some effort is made to handle 378such cases, but sometimes (such as \let\x= y) the space is interpreted 379incorrectly. You can usually solve the problem by enclosing the offending 380command in braces or in a macro (\newcommand\xeqy{\let\x= y}), but... 381 382One important incompatibility with braces and macro replacement: 383ALL THE TEXT IN BRACES OR COMING FROM A MACRO IS TYPESET IN A BOX. 384That is, braces will suppress stretching and linebreaks in the text they 385enclose. Moreover, the specially-taken-care-of commands \-, \\, \newline 386and \linebreak are usually ignored if they appear inside extra braces. 387They operate only when the braces delimit a command parameter without 388introducing a level of grouping. (Even though braces delimiting command 389parameters do not normally imply grouping, many commands will add their 390own grouping.) Thus, you should try to limit inner braces to short bits of 391text or for delimiting parameters to commands. For emergency repairs, see 392the "Marat/Sade" example below. Syntactical spaces inside braces never 393cause a problem, nor do spaces in math mode. 394 395Text produced by expansion of a command (macro) is boxed too, but \\, \ 396and \- still work properly in the expansion text: 397 \newcommand\iff{if and only if} {\em \iff} 398does not allow any stretching or linebreaking between words, but 399 \newcommand\iff{if\ and\ only\ if} {\em \iff} 400allows stretching and linebreaking. There is a problem though: the 401\ between words closes a group and any local assignments will be lost, 402in particular, font changes and color changes. 403 404This loss of local assignments will break some other standard commands, 405(e.g., \cite) which produce multiple `words' using local assignments. 406The way to protect such commands is to bury them in an \mbox: 407 {\em every\-one agrees~\mbox{\cite{you,me}}.} 408 409Nested \em commands produce multiple underlining, but heed the warnings 410about braces above. To get italics without underlining, use \it. Nesting 411of other types of underline is also possible, but the `underlines' may 412overlap. 413 414HERE IS A SIMPLE EXAMPLE. 415 416\noindent 'Twas {\em brillig\/} and the {\em slithy~toves\/} 417did {\em gyre\/} and {\em gim\-ble\/} in the {\em wabe,\\[2pt] } 418All {\em mim\-sey\/} were the {\em boro\-goves\/} and 419the {\em mome raths outgrabe}. 420 421HERE IS A DIFFICULT EXAMPLE. 422 423\usepackage{ulem} 424\setlength\textwidth{3.3in} 425\begin{document} 426% \large 427No, I did {\em not} act in the movie {\em \emph{The} % <<<<<<< Nested 428\emph{Persecu}\-\emph{tion} \emph{and} \emph{Assassination} \emph{of} 429\emph{Jean-Paul} \emph{Marat}, as per\-formed by the Inmates 430of the Asylum of Charenton under the Direc\-tion of the 431Marquis de~Sade!} But I {\em did} see it. 432\end{document} 433 434In the nested emphasis, \emph had to be given for each word separately 435so the spaces between could stretch and break into lines. Even the 436discretionary hyphen (\-) in `Persecution' had to be outside the braces, 437but the hyphen in `Direction' was just fine because it was not in nested 438braces. The same applies to other special commands like \ and ~. Also, 439the spaces are printed with only a single underline because they are 440outside the nested \emph commands. This example really illustrates that 441ulem does not handle nested emphasis very well! Nevertheless, it is fine 442for simple things. 443 444Underlining can also be done according to \uline{this text}. To use this 445type of underlining, but have \em still produce italics, put the command 446\normalem in the preamble of the document or load ulem with 447\usepackage[normalem]{ulem}. 448 449Some variations on underlining are provided, including a wavey underline 450(\uwave{under-wave}), double underlines (\uuline{two lines under this}), 451dashed (\dashuline{dashes underneath}) or dotted (\dotuline{dots below}) 452underlines, 453a line through text rather than under it (\sout{strike out}), and text 454crossed-out with /////// (\xout{cross out, X out}). You can define your 455own styles following the examples provided. The definition should be 456something like: 457 458\newcommand\command{\bgroup \markoverwith{something}\ULon} 459 460The "something" can be as simple as a single character, or as complex as 461you can keep track of. 462 463The various underlining commands are essentially textual, and will not 464work quite the same in math mode. But since some font commands, like \bf, 465serve both for text and math, math mode is handled (in an approximate way). 466The performance in math mode is somewhat different from in text: there will 467be no line breaks or stretching in the underlined text, and the vertical 468positioning may not be right. The results should be best for \uline, 469\uwave, \uuline, and any other truly UNDER-line you define. 470 471Any type of underlining can be substituted for any font-selection command 472by issuing a proper \useunder declaration: 473 474\useunder{\underlinecommand}{\fontdeclaration}{\fontcommand} 475 476e.g., \useunder{\uuline}{\bfseries}{\textbf} gives a double underline 477instead of bold face in LaTeX. The commands \normalem and \ULforem switch 478underlining for \em off and on, respectively, and so do the \usepackage 479options [normalem] and [ULforem]. There is also the \usepackage style 480option [UWforbf] to replace boldface with a wavey underline. 481 482UWforbf does handle \bf in math mode, but it doesn't work in section titles, 483unfortunately, because the titles are not delimited by explicit braces when 484printed by the \section command. For the present version, the \bfseries 485command still produces bold face, but \bf makes an under-wave. To get under- 486waved section titles you can do 487 488\renewcommand\@seccntformat[1]{\uwave{\csname the#1\endcsname}\hskip 1em} 489 490and later specify \section[...]{\uwave{...}}. 491 492In plain TeX there is no \textbf so you should use \useunder{\UWave}{\bf}{}. 493You can even skip a step and define the underline or overprint with \useunder: 494\useunder{\bgroup\markoverwith{!}\ULon}{\sf}{} 495 496Some commands, such as \\ and \hskip are given special treatment, but 497others (like \marginpar) are not. Support for others can be added by 498assigning special meanings in the token register \UL@hook. (In LaTeX do 499\addto@hook\UL@hook{\let\command\ULversion}.) The UL versions of commands 500should be modelled on \UL@hskip or \UL@cr, and should include the test 501"\ifx\ \LA@space". For example, support for "\marginpar" is added through 502the hook mechanism. 503 504All the underlining commands are robust in LaTeX. 505 506%====================== END INSTRUCTIONS =========================== 507 508% Previous bug-finders: Esther Hu (\hfill in plain); Lones Smith (\tt\-); 509% Steve Anderson (\ooalign accents); Thanassi Protopapas ( { in tables). 510% The bug finders' fee is now $0.00; it will double for each new bug found. 511% Version (identified by year) 512% 1994: 513% Many changes! Notably: LaTeX2e options and \emph. Nesting works (somewhat). 514% Behavior with inner braces is more consistent (not stripped). \useunder. 515% Better underwave (using lasy6). Special underlines are not commented out. 516% patch 1995: fix \UL@swender to work in {tabular}; make hyphenation join 517% well; crude math support; eliminate \@clb 518% 1996: use "\csname ProvidesPackage\endcsname", tidying. 519% 1997: fix \\ when LaTeX changed; remove extra overlap in putbox. 520% 2000: hook (and marginpar) 521% 2004: Fix spacing in \uwave and \xout. \ULleaders hook. 522% 2009: Accept \par in argument (\long) 523% 2010: Include \dotuline and \dashuline, typeset documentation, add \UL@setULdepth 524% 2011: Change \dimen@ to \UL@height 525% 2012: Removed \let\par garbage 526% 527% Send problem reports to asnd@triumf.ca 528% 529% test integrity: 530% brackets: round, square, curly, angle: () [] {} <> 531% backslash, slash, vertical, at, dollar, and: \ / | @ $ & 532% hat, grave, acute (apostrophe), quote, tilde, under: ^ ` ' " ~ _ 533