Text Formattingoverlapping formatting with staggered start/stop

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
zackb
Posts: 1
Joined: Tue Dec 20, 2022 6:10 pm

overlapping formatting with staggered start/stop

Post by zackb »

Hi,

How can I generate text where I start \underline, then start \textbf, then end \underline, then end \textbf?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

overlapping formatting with staggered start/stop

Post by MjK »

I don't see any real problem in this respect, apart from the fact that underlining should generally be rather avoided.

Code: Select all

\documentclass{article}

\begin{document}
Text with \underline{start underline \textbf{start bf}} \textbf{end underline}
and end bf. Also possible and somehow better would be \underline{start underline \textbf{start bf}}\textbf{ end underline}
\end{document}
Note: \underline is like \fbox and therefore does not provide line breaks! It should not be used for more than a single word.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Post Reply