![scrbook 标题中的章节和节号颜色](https://linux22.com/image/417223/scrbook%20%E6%A0%87%E9%A2%98%E4%B8%AD%E7%9A%84%E7%AB%A0%E8%8A%82%E5%92%8C%E8%8A%82%E5%8F%B7%E9%A2%9C%E8%89%B2.png)
我怎样才能更改运行标题中章节/节号的颜色scrbook
?
梅威瑟:
\documentclass[headinclude=true]{scrbook}
\usepackage{lipsum}
\usepackage{xcolor}
\renewcommand*{\chapterformat}{%
\textcolor{red}{\thechapter}\autodot\enskip%
}
\renewcommand*{\sectionformat}{%
\textcolor{red}{\thesection}\autodot\enskip%
}
\renewcommand*{\subsectionformat}{%
\textcolor{red}{\thesubsection}\autodot\enskip%
}
\renewcommand*{\subsubsectionformat}{%
\textcolor{red}{\thesubsubsection}\autodot\enskip%
}
\begin{document}
\chapter{Things}
\section{Important things}
\lipsum[2-10]
\section{Other important things}
\lipsum[11-15]
\chapter{Other things}
\lipsum[16-20]
\end{document}
答案1
您可以在手册第 111 页找到如何重新定义标头:https://komascript.de/~mkohm/scrguien.pdf
基本上,您必须使用相同的\textcolor
命令,仅对于*mark*
命令,正如您在此处看到的:
\documentclass[headinclude=true]{scrbook}
\usepackage{lipsum}
\usepackage{xcolor}
\renewcommand*{\chapterformat}{%
\textcolor{red}{\thechapter}\autodot\enskip%
}
\renewcommand*{\sectionformat}{%
\textcolor{red}{\thesection}\autodot\enskip%
}
\renewcommand*{\subsectionformat}{%
\textcolor{red}{\thesubsection}\autodot\enskip%
}
\renewcommand*{\subsubsectionformat}{%
\textcolor{red}{\thesubsubsection}\autodot\enskip%
}
\renewcommand*{\chaptermarkformat}{%
\chapappifchapterprefix{\ }\textcolor{red}{\thechapter\autodot}\enskip}
\renewcommand*{\sectionmarkformat}{%
\textcolor{red}{\thesection\autodot}\enskip}
\renewcommand*{\subsectionmarkformat}{%
\textcolor{red}{\thesubsection\autodot}\enskip}
\begin{document}
\chapter{Things}
\section{Important things}
\lipsum[2-10]
\section{Other important things}
\lipsum[11-15]
\chapter{Other things}
\lipsum[16-20]
\end{document}