
\usepackage
私の LaTeX は次のようになります (奇数ページで開くなど、多くの設定といくつかの複雑な設定を省略しています)。
\documentclass[9pt,a4paper,reqno]{amsbook}
\usepackage{fancyhdr,etoolbox}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\nouppercase\rightmark}
\fancyhead[RE]{\nouppercase\leftmark}
\begin{document}
\frontmatter
\title{\textsc{AAAZZZ}}
\author{LZ}
\mainmatter
\pagenumbering{roman}
\maketitle
\chapter*{Abstract}
The goal of this notes is to describe...
\chapter*{Acknowledgements}
I offer my sincerest gratitude to...
\renewcommand{\contentsname}{Table of contents}
\makeatletter
\patchcmd{\@tocline}
{\hfil}
{\leaders\hbox{\,.\,}\hfil}{}{}
\makeatother
{\large {\tableofcontents}}
\addcontentsline{toc}{subsection}{Section name}
\thispagestyle{plain}
\pagenumbering{arabic}
\chapter{Preliminaries on A}
\chapter{Results on Z}
\end{document}
私の問題は2つあります:
Table of contents
ページは 1 つだけで、CHAPTER 1
その直後に始まります。しかし、1 ページ後に開始し、番号は「1」(「2」ではない) のままにし、つまりTable of contents
仮想/空の 2 ページ目 (プレーン スタイルで、ヘッダー/フッターがない) にする必要があります。これを実現するにはどうすればよいでしょうか。
そして:
目次にさらに内容を追加すると、目次の 2 ページ目のページ ヘッダーが「第 0 章 目次」と表示されます (右側。左側はページ番号「viii」で、これは保持したいのですが、目次の 2 ページ目にヘッダー/フッターがなくても問題ありません)。これを「目次」のみにする方法はありますか?
答え1
次のコード テンプレートは、すべての懸念に対処しているようです。
\documentclass{amsbook}
\usepackage{fancyhdr,etoolbox}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\nouppercase\rightmark}
\fancyhead[RE]{\nouppercase\leftmark}
\renewcommand{\contentsname}{Table of contents}
\makeatletter
\patchcmd{\@tocline}
{\hfil}
{\leaders\hbox{\,.\,}\hfil}{}{}
\makeatother
\begin{document}
\pagestyle{plain}
\frontmatter
\title{\textsc{AAAZZZ}}
\author{LZ}
\maketitle
\chapter*{Abstract}
The goal of this notes is to describe \ldots
\chapter*{Acknowledgements}
I offer my sincerest gratitude to \ldots
\tableofcontents
\mainmatter
\cleardoublepage
\pagenumbering{arabic}
\pagestyle{fancy}
\chapter{Preliminaries on A}
\chapter{Results on Z}
\end{document}
具体的には、次のような提案があります。
\pagestyle{plain}
本の前半部分( の直前まで\mainmatter
)に使用します。ページ スタイルは、フッターのページ番号のみを設定します。 にこれを追加して、コードをもう少し整理することもplain
可能です。\frontmatter
\pagestyle{fancy}
本の主要部分 ( の後) に を使用します。 これを に追加して、コードをもう少し整理することも\mainmatter
可能です。\mainmatter
\cleardoublepage
その後、\tableofcontents
目次の終わりと最初の章の始まりの間に空白ページが残るようにページを十分に空ける必要があります (目次が 1 ページのみの場合)。を使用するとページ番号が 1 にリセットされるため、最初の の前に がある場合は、
\pagenumbering{arabic}
常に最初のページが 1 ページ目から始まります。\chapter
\chapter