fancyhdr \leftmark, \rightmark 條目為 \section*

fancyhdr \leftmark, \rightmark 條目為 \section*

我有以下乳膠文檔,我想包含一個沒有編號的“縮寫列表”部分。這也應該出現在目錄中(它應該類似於“圖表列表”和“表格列表”部分)。到目前為止一切順利,我成功地用\addcontentsline{toc}{section}{List of Abbreviations}命令做到了這一點。

但是,我仍然有一個問題\fancyhdr\leftmark選擇。它仍然列CONTENTS在該部分的標題中List of Abbreviations。我怎樣才能解決這個問題?

\documentclass[11pt, bibliography=totoc, twoside]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage[onehalfspacing]{setspace}

\usepackage{float}
\usepackage{acronym}
\usepackage{geometry}
\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor=black,urlcolor=blue,citecolor=blue}
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[LE]{\rightmark}
\fancyhead[RO]{\leftmark}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{14pt}


\usepackage{blindtext}

\title{dummy}
\author{my name}
\date{December 2019}

\begin{document}

\maketitle

\pagestyle{fancy}

\tableofcontents 
\newpage

\pagenumbering{Roman} 
\section*{List of Abbreviations}
\addcontentsline{toc}{section}{List of Abbreviations}
\begin{acronym}\itemsep0pt
\acro{ABC}{Alphabet}
\end{acronym}
\newpage

\listoffigures
\addcontentsline{toc}{section}{\listfigurename}
\newpage

\listoftables
\addcontentsline{toc}{section}{\listtablename}
\newpage


\pagenumbering{arabic} 
\section{Introduction}
\blindtext
\newpage

\section{Section 2}
\blindtext[4]
\subsection{subsection 2.1}
\blindtext[4]
\subsection{subsection 2.2}
\blindtext[4]
\newpage

\section{Section 3}
\blindtext
\newpage


\end{document}

答案1

\section*不寫入標題,您必須手動執行此操作。添加

\markboth{List of Abbreviations}{List of Abbreviations}

相關內容