在页眉中写上章节名称

在页眉中写上章节名称

以下是我写的内容

\documentclass{report}
 \usepackage{fancyhdr}
\chapter{Introduction}
\pagenumbering{arabic}
\pagestyle{fancyplain}

 \fancyhf{}

\lhead{\fancyplain{}{}}
\rhead{\fancyplain{}{\thepage}}
\end{document}

我希望能够在左侧标题上显示章节名称...我该怎么做?

答案1

我认为您只是在寻找以下内容。

\documentclass{report}
\usepackage{blindtext}
\usepackage{fancyhdr}

\fancyhf{}

\lhead{\leftmark}
%\lhead{\tiny\nouppercase{\leftmark}}% if not to be in all caps and very small
\rhead{\thepage}
\pagestyle{fancy}
\begin{document}
\chapter{Introduction}
\pagenumbering{arabic}
\blindtext[20]
\end{document}

另一种选择可能是scrlayer-scrpage来自 KOMA 包的包。它的功能非常丰富。内容和布局是分开的。

\documentclass{report}
\usepackage{blindtext}
\usepackage[automark,markcase=ignoreuppercase]{scrlayer-scrpage}
\addtokomafont{pagehead}{\upshape\tiny}
\begin{document}
\chapter{Introduction}
\pagenumbering{arabic}
\blindtext[20]
\end{document}

相关内容