目录/参考书目中的双页标题采用 fancyhdr 和 fancyplain 样式

目录/参考书目中的双页标题采用 fancyhdr 和 fancyplain 样式

我注意到参考书目和目录、图表列表等在每个标题上都有两次“章节标题”,分别在左侧和右侧——我在正文中只定义了标题的右侧部分,其中包含当前章节名称(如果还没有章节名称,则为章节名称)。我如何才能使这与文档的其余部分保持一致,即参考书目不分左右,只分在右侧?

MWE(显示了参考书目的问题,但目录和图表/表格部分列表也存在问题)

\begin{filecontents*}{test.bib}
@misc{test,
title= "The title",
howpublished= "Publisher"
}
@misc{test1,
title= "The title",
howpublished= "Publisher"
}
@misc{test2,
title= "The title",
howpublished= "Publisher"
}
@misc{test3,
title= "The title",
howpublished= "Publisher"
}
@misc{test4,
title= "The title",
howpublished= "Publisher"
}
@misc{test5,
title= "The title",
howpublished= "Publisher"
}
@misc{test6,
title= "The title",
howpublished= "Publisher"
}
@misc{test7,
title= "The title",
howpublished= "Publisher"
}
@misc{test8,
title= "The title",
howpublished= "Publisher"
}
@misc{test9,
title= "The title",
howpublished= "Publisher"
}
@misc{test10,
title= "The title",
howpublished= "Publisher"
}
@misc{test11,
title= "The title",
howpublished= "Publisher"
}
@misc{test12,
title= "The title",
howpublished= "Publisher"
}
@misc{test13,
title= "The title",
howpublished= "Publisher"
}
@misc{test14,
title= "The title",
howpublished= "Publisher"
}
@misc{test15,
title= "The title",
howpublished= "Publisher"
}
@misc{test16,
title= "The title",
howpublished= "Publisher"
}
@misc{test17,
title= "The title",
howpublished= "Publisher"
}
@misc{test18,
title= "The title",
howpublished= "Publisher"
}
@misc{test19,
title= "The title",
howpublished= "Publisher"
}
@misc{test20,
title= "The title",
howpublished= "Publisher"
}
@misc{test21,
title= "The title",
howpublished= "Publisher"
}
@misc{test22,
title= "The title",
howpublished= "Publisher"
}
@misc{test23,
title= "The title",
howpublished= "Publisher"
}
@misc{test24,
title= "The title",
howpublished= "Publisher"
}
@misc{test25,
title= "The title",
howpublished= "Publisher"
}

\end{filecontents*}
\documentclass{report}
\usepackage{setspace}
\usepackage{fancyhdr}

\begin{document}
\pagestyle{fancyplain}

\nocite{*}
\doublespacing
\bibliographystyle{IEEEtran}
\bibliography{test}

\end{document}

答案1

这是一个建议,但我不确定我是否理解期望的结果是什么

\documentclass{report}
\usepackage{setspace}
\usepackage{fancyhdr}
\pagestyle{fancy}% before redefining \chaptermark
\renewcommand{\chaptermark}[1]{%
  \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{\MakeUppercase{\chaptername\ \thechapter.\ #1}}%
}
\lhead{}
\rhead{\rightmark}

\usepackage{blindtext}% for dummy text

\begin{document}
\doublespacing
%\pagestyle{fancyplain}% <- removed
\tableofcontents

\chapter{Chapter One}
\Blindtext
\chapter{Chapter Two}
\section{Section One}
\Blindtext
\Blinddocument
\Blinddocument
\Blinddocument
\end{document}

在此处输入图片描述

但内容的开始仍然没有标题

在此处输入图片描述


或者带包装scrlayer-scrpage

\documentclass{report}
\usepackage{setspace}
\usepackage[headsepline,automark,autooneside=false]{scrlayer-scrpage}
\addtokomafont{pageheadfoot}{\upshape}
\clearpairofpagestyles
\ohead{\rightmark}
\cfoot*{\pagemark}

\usepackage{blindtext}% for dummy text

\begin{document}
\doublespacing
\tableofcontents

\chapter{Chapter One}
\Blindtext
\chapter{Chapter Two}
\section{Section One}
\Blindtext
\Blinddocument
\Blinddocument
\Blinddocument
\end{document}

相关内容