Sunday, October 10, 2010

Underlining Package for LaTeX

If you want to use underlining (standard or wavy) or strikethroughs in LaTeX, consider adding
\usepackage[normalem]{ulem}
to your LaTeX source file. This opens up the following useful commands:
CommandDescription
\uline{foo}Underlines foo
\uuline{foo}Double underlines foo
\uwave{foo}Underlines foo with a wavy line
\sout{foo}Strikesout foo
\xout{foo}Crosses out foo with `/'
And don't forget that you can use \emph{foo} to obtain an italicised version of foo.

These are preferable over \underline{foo} and {\em foo} because they can handle the edge cases of spanning multiple lines (for underlining) and the space correction after italicisation (for the emphasis component).

No comments: