Am Wed, 12 Jan 2022 15:41:54 +0000 schrieb Niemann, Hartmut: > I observed a strange thing when experimenting with colored text. > > ---8<---- > \documentclass{article} > \usepackage{xcolor} > \usepackage{bookmark} > \begin{document} > \tableofcontents > \newpage > \section{One} > \section{\color{red}Two} > \section{Three} > \end{document} > --8<------ > I ran this through xelatex (texlive 2018 on windows 10-64) three times to get > the toc right. > > There is a pdf bookmark for each section, but the second one is "redTwo" > instead of "Two". > > Is there a way to avoid that?
The standard way to avoid that something affects the bookmarks is to to use \texorpdfstring: \section{\texorpdfstring{\color{red}}{}Two} -- Ulrike Fischer https://www.troubleshooting-tex.de/