blob: bb6dd4f2928db917368ce80bf02601554bcbe157 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<head>
<title>UK TeX FAQ -- question label underline</title>
</head><body>
<h3>Underlined text won't break</h3>
<p>Knuth made no provision for underlining text: he took the view that
underlining is not a typesetting operation, but rather one that
provides emphasis on typewriters, which typically offer but one
typeface. The corresponding technique in typeset text is to switch
from upright to italic text (or vice-versa): the LaTeX command
<code>\</code><code>emph</code> does just that to its argument.
<p>Nevertheless, typographically illiterate people (such as those that
specify double-spaced
<a href="FAQ-linespace.html">thesis styles</a>)
continue to require underlining of us, so LaTeX as distributed
defines an <code>\</code><code>underline</code> command that applies the mathematical
'underbar' operation to text. This technique is not entirely
satisfactory, however: the text gets stuck into a box, and won't break
at line end.
<p>Two packages are available that solve this problem. The
<i>ulem</i> package redefines the
<code>\</code><code>emph</code> command to underline its argument; the underlined text thus
produced behaves as ordinary emphasised text, and will break over the
end of a line. (The package is capable of other peculiar effects,
too: read its documentation, contained within the file itself.)
The <i>soul</i> package defines an <code>\</code><code>ul</code> command (after which the
package is, in part, named) that underlines running text.
<p>Beware of <i>ulem</i>'s default behaviour, which is to convert the
<code>\</code><code>emph</code> command into an underlining command; this can be avoided by
loading the package with:
<pre>
\usepackage[normalem]{ulem}
</pre>
Documentation of <i>ulem</i> is in the package itself.
<dl>
<dt><tt><i>ulem.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/ulem.sty">macros/latex/contrib/misc/ulem.sty</a>
<dt><tt><i>soul.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/soul.zip">macros/latex/contrib/soul</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/soul.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/soul/">browse</a>)
</dl>
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underline">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underline</a>
</body>
|