开发者

How to colorize section headings in LaTeX like this?

开发者 https://www.devze.com 2022-12-28 07:51 出处:网络
Accidently I created this nice colored effect on my LaTeX TOC: http://i43.tinypic.com/o5aptl.png Which I like and want to keep, I created this effect like this:

Accidently I created this nice colored effect on my LaTeX TOC: http://i43.tinypic.com/o5aptl.png

Which I like and want to keep, I created this effect like this:

\definecolor{Section1}{rgb}{0.09,0.21,0.36}
\section{\color{Section1}Introdução}

However, as you can see on the TOC sidebar, there was a nasty side effect.

I tried to fix it like this:

\section[Introdução]{\color{Section1}Introdução}

But didn't work, the开发者_开发百科 sidebar TOC was fixed but on the TOC list, the blue color was gone and was now red instead (default for clickable TOC heading links)

I also tried:

{\color{Section1}\section{Introdução}}

But the effect was the same, fixed TOC but no color on the TOC list.

Any suggestions?


You're looking for \texorpdfstring{texString}{pdfString}, which you can supply as an alternate to plaintext as an argument to \section. This should work:

\section{\texorpdfstring{\color{Section1}Intro}{Intro}}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号