Text FormattingHighlight text with nested latex commands?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
stinkinrich88
Posts: 52
Joined: Sat Jun 07, 2008 11:56 am

Highlight text with nested latex commands?

Post by stinkinrich88 »

Hello,

How can I highlight (i.e. change the text background colour) of text which contains nested latex commands (such as text formatting or citations)?

The soul package cannot highlight nested commands and the \colorbox command cannot wrap text.

Thank you,

Richard

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Highlight text with nested latex commands?

Post by gmedina »

Hi,

perhaps the shaded environment provided by the framed package could be useful for you.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
stinkinrich88
Posts: 52
Joined: Sat Jun 07, 2008 11:56 am

Re: Highlight text with nested latex commands?

Post by stinkinrich88 »

Thanks! That's brilliant!

The only more I could ask for is to be able to highlight half of the text in a paragraph (i.e. not the entire paragraph), but I suppose that's not possible...?
Post Reply