我正在编写report
并创建参考书目。我使用fancyhdr
创建一个标题,该标题应在章节的每一页上报告章节编号和章节名称。不幸的是,标题名称变成了参考书目的“参考文献”,并且对于参考书目之后和新章节之前的部分也是如此。
下面是一个 MWE(不是那么简单,但我想保留一些可能会产生一些问题的选项):
\documentclass[notitlepage, 12pt, twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[top=2cm,bottom=3cm,left=2cm,right=3cm]{geometry}
\usepackage{hyperref,todonotes,longtable}
\usepackage{graphics,epsfig,lscape,setspace,url,setspace,morefloats,comment,booktabs,color}
\usepackage{natbib}
\usepackage[labelfont=sc, singlelinecheck=false, font={small}]{caption}
\usepackage{amsfonts,amsmath,amsthm,amssymb}
\usepackage{blindtext}
\usepackage[flushmargin,hang,marginal,multiple, stable]{footmisc}
\usepackage{titling}
\usepackage{lipsum}
\hypersetup{pdfborder = {0 0 0}}
\renewcommand{\abstractname}{\bf ABSTRACT}
\makeatletter
\newenvironment{chapquote}[2][2em]
{\setlength{\@tempdima}{#1}%
\def\chapquote@author{#2}%
\parshape 1 \@tempdima \dimexpr\textwidth-2\@tempdima\relax%
\itshape}
{\par\normalfont\hfill \chapquote@author\hspace*{\@tempdima}\par\bigskip}
\makeatother
\pagestyle{plain}
\renewcommand{\abstractname}{\bf ABSTRACT}
\makeatletter
\def\blfootnote{\gdef\@thefnmark{}\@footnotetext}
\makeatother
\title{main title\\
{\Large somewhere}}
\author{Author 1}
\date{}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand\sectionmark[1]{}
\makeatletter
\renewcommand{\chaptermark}[1]
{\markboth{\ifnum\value{chapter}>0\@chapapp\ \thechapter\fi\hfill#1}{}}
\makeatother
\fancyhead[LE]{} \fancyhead[LO]{\nouppercase\leftmark}
\fancyhead[RE]{\nouppercase\leftmark} \fancyhead[RO]{}
\setlength{\headheight}{14.49998pt}
\setlength{\parskip}{0mm}
\begin{document}
% Two empty pages
\newpage\null\thispagestyle{empty}\newpage
\newpage\null\thispagestyle{empty}\newpage
\setcounter{page}{1}
\thispagestyle{empty}
\maketitle
%\pagenumbering{roman}
\renewcommand{\thepage}{\roman{page}}
\chapter*{Acknowledgment}
\begin{center}
something here
\end{center}
% Empty page after acknowledgement
\newpage\null
\thispagestyle{empty}
\newpage
\tableofcontents
\chapter*{Introduction and Summary}
\addcontentsline{toc}{chapter}{Introduction and Summary}
\section*{Chapter 1}
\addcontentsline{toc}{section}{Chapter 1}
\clearpage
%\pagenumbering{arabic}
\renewcommand{\thepage}{\arabic{page}}
\setcounter{page}{1}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\chapter{My chapter 1}
\title{\LARGE{\bf My chap 1 \vspace{0.5cm}} }
\author{\small \sc{Author1\thanks{Affiliation 1}}} %to mute
\date{}
\maketitle\emptythanks
\begin{abstract}{\noindent An abstract
\blfootnote{We thank X} %to mute
}
\end{abstract}
\thispagestyle{empty} \newpage
\section{Sec1}
\lipsum[2-4]
\section{Sec2}
\lipsum[2-4]
\chapter{My chapter 2}
\title{\LARGE{\bf My chap 2 \vspace{0.5cm}} }
\author{\small \sc{Author2\thanks{Affiliation 2}}} %to mute
\date{}
\maketitle\emptythanks
\begin{abstract}{\noindent An abstract
\blfootnote{We thank X} %to mute
}
\end{abstract}
\thispagestyle{empty} \newpage
\section{Sec1}
\section{Sec2}
\nocite*
\bibliographystyle{plain}
\bibliography{xampl}
\clearpage
\pagebreak
\section{Something with ``'Bibliography'' header}
\lipsum[2-8]
\chapter{My chapter 3}
\title{\LARGE{\bf My chap 3 \vspace{0.5cm}} }
\author{\small \sc{Author3\thanks{Affiliation 3}}} %to mute
\date{}
\maketitle\emptythanks
\begin{abstract}{\noindent An abstract
\blfootnote{We thank X} %to mute
}
\end{abstract}
\thispagestyle{empty} \newpage
\section{Sec1}
\section{Sec2}
\end{document}
您可以在这里看到问题: