Skip to content

Latex Ulem Bibliography

[tex-live] latexdiff: ulem interacting with textbf+citet

kap4linkap4lin at gmail.com
Thu Jan 21 18:38:14 CET 2010
Hi, I understand this may not be the right list, so I am Cc-ing the author of latexdiff as well. A "simple" problem while using latexdiff: \sout (or \uwave) of ulem interacting with the combination of \textbf{} and \citet{}. Minimum working example follows. The solution that I have is to use '-t CFONT' when calling latexdiff. Any other solution (which includes sout and/or uwave) is highly appreciated. -- Regards Kap4Lin -------------------------------------- http://counter.li.org #402424 %% file1.tex BEGIN \documentclass[12pt]{article} \usepackage[longnamesfirst]{natbib} \begin{document} \textbf{\citet{dn97} made no provision for underlining text.} %% Bibliography %% \begin{thebibliography}{1} \newcommand{\enquote}[1]{``#1''} %\newcommand{\enquote}[1]{#1} \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab{#1}\fi \bibitem[\protect\citename{Knuth, }1997]{dn97} Knuth, D. (1997). \newblock \enquote{The art of computer programming, volume 1: fundamental algorithms.} \newblock {\em Addison Wesley Longman Publishing Co., Inc. Redwood City, CA, USA\/}. \end{thebibliography} \end{document} %% END file1.tex %% file2.tex BEGIN \documentclass[12pt]{article} \usepackage[longnamesfirst]{natbib} \begin{document} \citet{dn97} made no provision for underlining text. %% Bibliography %% \begin{thebibliography}{1} \newcommand{\enquote}[1]{``#1''} %\newcommand{\enquote}[1]{#1} \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab{#1}\fi \bibitem[\protect\citename{Knuth, }1997]{dn97} Knuth, D. (1997). \newblock \enquote{The art of computer programming, volume 1: fundamental algorithms.} \newblock {\em Addison Wesley Longman Publishing Co., Inc. Redwood City, CA, USA\/}. \end{thebibliography} \end{document} %% END file2.tex # latexdiff command: $ latexdiff file1.tex file2.tex >| file-diff.tex # OR $ latexdiff --exclude-textcmd="citet,citep" file1.tex file2.tex >| file-diff.tex # pdflatex error (on second run): $ pdflatex file-diff.tex ! Extra }, or forgotten \endgroup. \UL at stop ...z@ \else \UL at putbox \fi \else \egroup \egroup \UL at putbox \fi \if... l.27 } \DIFdelend \DIFaddbegin \citet{dn97} \DIFadd{made no provision for und... # WORKING latexdiff command: $ latexdiff -t CFONT file1.tex file2.tex >| file-diff.tex

More information about the tex-live mailing list

Underlined text won’t break

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 does just that to its argument.

Nevertheless, typographically illiterate people (such as those that specify double-spaced thesis styles) continue to require underlining of us, so LaTeX as distributed defines an 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.

Two packages are available that solve this problem. The ulem package redefines the 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.) The soul package defines an command (after which the package is, in part, named) that underlines running text.

Beware of ulem’s default behaviour, which is to convert the command into an underlining command; this can be avoided by loading the package with:

\usepackage[normalem]{ulem}
ulem.sty
ulem
soul.sty
soul

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underline