Word allows for all kinds of font formatting:
The above example combines strike-through/strike-out (like this) and underlining. I'd like to be able to do the same, but neither ulem
nor soul
allows for this in a convenient way.
-
ulem
:\documentclass{article} \usepackage[a6paper,showframe]{geometry}% Just for this example \usepackage{ulem} \begin{document} Lorem ipsum dolor sit amet, \sout{consectetur adipiscing elit. Praesent} in nisi magna. Mauris \sout{auctor gravida} fermentum. Proin enim \uline{massa, \sout{\textbf{lobortis in} ligula} vel, convallis} fermentum nulla. \uline{Nam in mattis nulla}. Vestibulum vel \uline{auctor orci. Praesent \textit{\textbf{ornare, eros} ac} euismod} congue, turpis est facilisis nisi, a sollicitudin massa lectus imperdiet tellus. Duis at tempor velit. \sout{Nulla \uline{gravida}, dolor in cursus}. \end{document}
-
soul
:The
soul
documentation explicitly states that "nestingsoul
commands don't work":As such, the following example does not compile without errors:
\documentclass{article} \usepackage[a6paper,showframe]{geometry}% Just for this example \usepackage{soul} \begin{document} Lorem ipsum dolor sit amet, \st{consectetur adipiscing elit. Praesent} in nisi magna. Mauris \st{auctor gravida} fermentum. Proin enim \ul{massa, \st{\textbf{lobortis in} ligula} vel, convallis} fermentum nulla. \ul{Nam in mattis nulla}. Vestibulum vel \ul{auctor orci. Praesent \textit{\textbf{ornare, eros} ac} euismod} congue, turpis est facilisis nisi, a sollicitudin massa lectus imperdiet tellus. Duis at tempor velit. \st{Nulla \ul{gravida}, dolor in cursus}. \end{document}
Ideally I'd like to be able to use these font "effect" macros interchangeably: strike-out inside underline, or underline inside strike-out with no impact on the use of fonts (like italic or bold). Here's the output from Word:
(See also the followup question: Underline + strike-through using soul)
Best Answer
Here is an adaptation to Martin's answer at Cool Text Highlighting in LaTeX where I have defined
\tikzst
based on Martin's\tikzul
.This shows examples of
Note:
Usually,
\tikzmark
solutions require two runs. As there are nested uses of\tikzmark
, this require at three runs. (Thanks @Werner for pointing this out).The additional run is required as the nested
tikzmark
's locations depends on the location of the parent's\tikzmark
. So, the first run stabilizes the location of the "outer"\tikzmark
, the second stabilizes the location of the "inner"\tikzmark
, and the third to do the actual drawing.The
\tikzmark
is from Adding a large brace next to a body of text.Code: