1

My LaTeX looks as follows (I omit a lot of \usepackage and some fancy settings, e.g. open at odd pages):

\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}

My problems are two folds:

Table of contents has only one page, and CHAPTER 1 start directly after that. But I want it start one page later, still with numbering "1" (not "2"), i.e. Table of contents should have a virtual/empty 2nd page (which should be of plain style, no header/footer). How to achieve this?

And:

If I add more things in Table of contents, then the page header on the 2nd page of Table of contents appears as "Chapter 0. Table of contents" (on the right; the left is the page number "viii", which I want to keep, I would also be satisfied if no header/footer on the 2nd page of Table of contents)? Is there a way to make it as "Table of contents" only?

  • 1
    Could you add in your code the packages that are necessary to make it compilable? It will be easier to help you if we can compile your code and see exactly what's wrong! – Vincent Dec 10 '19 at 23:23
  • You could just use [oneside], since you are messing up the odd/even pages anyway. – John Kormylo Dec 11 '19 at 15:08
1

The following code template seems to address all of your concerns:

\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}

Specifically, here are some suggestions:

  • Use \pagestyle{plain} for the front part of your book (up to just before \mainmatter). The plain page style sets only the page number in the footer. It would be possible to append this to what \frontmatter does and therefore clean up your code a little more.

  • Use \pagestyle{fancy} for the main part of your book (after \mainmatter). It would be possible to append this to what \mainmatter does and therefore clean up your code a little more.

  • \cleardoublepage after \tableofcontents should clear the pages sufficiently so there's a blank page left between the end of the ToC and the start of the first chapter (if the ToC is only a single page).

  • Using \pagenumbering{arabic} resets the page number to 1, so you'll always start the first \chapter on page 1 if you have that preceding the first \chapter.

| improve this answer | |
  • This perfectly fixes my problems. Many thanks! – Lao-tzu Dec 11 '19 at 7:17
  • I didn't use etoolbox but it still works. Could you explain what it's good for? – Lao-tzu Dec 11 '19 at 7:30
  • @Lao-tzu: \patchcmd requires etoolbox. You may not have loaded it explicitly, but perhaps some other package you're loading loads it. You did mention that your code doesn't include all your \usepackages... – Werner Dec 11 '19 at 11:43
  • Thanks! I loaded a lot other packages, it should be some other have similar effect. – Lao-tzu Dec 11 '19 at 12:02
  • The header of my Appendix appears like "Chapter A", is there an easy way to make it as "Appendix A" or just "A"? Preferably it should be a small modification of my above setting of \fancyhead for the Appendix chapter only. Sorry to bother you again! – Lao-tzu Dec 16 '19 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.