]> git.lyx.org Git - features.git/commit
Protect underlined \ref{} commands by enclosing them in \mbox{}.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 30 Aug 2012 12:09:23 +0000 (14:09 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 30 Aug 2012 13:35:22 +0000 (15:35 +0200)
commitfbaf3fc84d886b215b522a4eb14ff8bcdfc287f0
treed217c02464ae84d68d910bfc4619bae4cf4dc022
parent8475f73366dbae8b9e8d7cc9b1a172ba48995bcb
Protect underlined \ref{} commands by enclosing them in \mbox{}.

This is the same protection used for \cite{}. Although "ulem" commands
don't strictly need this protection with \ref{} and friends, this helps
when one wants to use another package souch as "soul".
Indeed, ulem's \uline{} doesn't hyphenate words, while soul's \ul{} does,
and thus the output is much nicer.

With this patch, replacing ulem with soul is as simple as adding
\usepackage{soul}
\renewcommand{\uline}[1]{\ul{#1}}
to the preamble, without worrying about manually enclosing in \mbox the
\ref commands. In any case, the output from ulem remains unchanged.

Another possibility offered by soul is that of typesetting as
"yellow highlighted" the underlined text. This is achieved by adding
\usepackage{color,soul}
\renewcommand{\uline}[1]{\hl{#1}}
to the preamble.

(cherry picked from commit 91afc2430d056e5cbf0065ac0d1a754a2a2ff384)
src/insets/InsetRef.cpp
status.20x