summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-underline.html
blob: 3a73cc64222945b8e51d959289fa3ed840e599e9 (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&#8217;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
&#8216;underbar&#8217; operation to text.  This technique is not entirely
satisfactory, however: the text gets stuck into a box, and won&#8217;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>&#8217;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="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ulem.zip">macros/latex/contrib/ulem</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ulem/">browse the directory</a>)
<dt><tt><i>soul.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/soul.zip">macros/latex/contrib/soul</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/soul/">browse the directory</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>