\usepackage{lastpage} % number of last page
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\fancyhead[R]{\color{myblue}
\rmfamily \bfseries
\ifnum\value{chapter}>0 \chaptername\ \thechapter. \fi
\leftmark}
\renewcommand\footrule{\color{myblue}\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}\par}%
\renewcommand\headrule{\color{myblue}
\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
\end{minipage}}%
\lhead{}
\lfoot{}
\rfoot{Page \thepage\ of \pageref{LastPage}}
答案1
不幸的是,问题中没有 MWE,我不知道未编号章节的标题如何转到标题。所以这只是一个猜测:在命令的左侧标记中添加章节名称和章节编号\chaptermark
。也许你也必须使用\nouppercase
for \leftmark
。
\renewcommand{\chaptermark}[1]{%
\markboth{%
\ifnum\value{chapter}>0 \chaptername\ \thechapter. \fi% <-added (and removed in \fancyhead[R])
#1}{}}
\fancyhead[R]{\color{myblue}%
\rmfamily \bfseries
\nouppercase{\leftmark}% <- \nouppercase added
}