款頭顏色

款頭顏色

chapter我可以更改、section和頭部的顏色subsection,但這種方式不會改變頭部的顏色subsection*。這是一個例子:

\documentclass[a4paper,12pt,twoside]{book}
\usepackage{xcolor}
\usepackage{sectsty}
\chapterfont{\color{red}}
\sectionfont{\color{red}}
\subsectionfont{\color{red}}
\begin{document}
\chapter{My chapter}
\section{My section}
We will prove ..
\subsection{My subsection}
The sequence is a list..
\subsubsection*{Star Subsection}
We can ...
\end{document}

輸出是

在此輸入影像描述

感謝您的幫助。

答案1

儘管它的名字如此,你的「明星小節」並不是一個小節,而是一個子節部分。因此,要更改顏色,您需要\subsubsectionfont{\color{red}}(或僅用於\allsectionsfont{\color{red}}一次更改所有標題):

\documentclass[a4paper,12pt,twoside]{book}
\usepackage{xcolor}
\usepackage{sectsty}
\chapterfont{\color{red}}
\sectionfont{\color{red}}
\subsectionfont{\color{red}}
\subsubsectionfont{\color{red}}
%\allsectionsfont{\color{red}}

\begin{document}
\chapter{My chapter}
\section{My section}
We will prove ..
\subsection{My subsection}
The sequence is a list..
\subsubsection*{Star Subsection}
We can ...
\end{document}

在此輸入影像描述

相關內容