Colors 如何像这样在LaTeX中为部分标题着色?
我无意中在我的乳胶TOC上创建了这个漂亮的彩色效果: 我喜欢并想保留它,我创造了这样的效果:Colors 如何像这样在LaTeX中为部分标题着色?,colors,formatting,latex,heading,Colors,Formatting,Latex,Heading,我无意中在我的乳胶TOC上创建了这个漂亮的彩色效果: 我喜欢并想保留它,我创造了这样的效果: \definecolor{Section1}{rgb}{0.09,0.21,0.36} \section{\color{Section1}Introdução} \section[Introdução]{\color{Section1}Introdução} 然而,正如你在TOC侧栏上看到的,有一个令人讨厌的副作用 我试着这样修复它: \definecolor{Section1}{rgb}{0.0
\definecolor{Section1}{rgb}{0.09,0.21,0.36}
\section{\color{Section1}Introdução}
\section[Introdução]{\color{Section1}Introdução}
然而,正如你在TOC侧栏上看到的,有一个令人讨厌的副作用
我试着这样修复它:
\definecolor{Section1}{rgb}{0.09,0.21,0.36}
\section{\color{Section1}Introdução}
\section[Introdução]{\color{Section1}Introdução}
但不起作用,侧边栏TOC已修复,但在TOC列表上,蓝色已消失,现在改为红色(默认为可单击的TOC标题链接)
我还尝试:
{\color{Section1}\section{Introdução}}
但效果是一样的,固定了TOC,但TOC列表上没有颜色
有什么建议吗?您正在寻找
\texorpdfstring{texString}{pdfString}
,您可以将其作为纯文本的替代参数提供给\section
。这应该起作用:
\section{\texorpdfstring{\color{Section1}Intro}{Intro}}
它起作用了,但是请改变你的例子,让人们意识到应该把它放在\section{}里面,我一开始没有意识到:P谢谢。