1

The sample code at the bottom of this post results in the following page order:

  1. title page
  2. metadata page
  3. table of contents
  4. blank page (seems to be continued from the table of contents)
  5. chapter

I'm really scratching my head about why the blank page (4) shows up. As best I can tell, it seems to be related to a \vspace*{\fill} command I placed on page (2). But this is confusing to me. Doesn't that come before the table of contents?

I want to keep the \vspace*{\fill} because (in the actual book I'm typesetting) I'm using it to vertically center the content on the metadata page.

What's going on?

\documentclass[12pt, oneside]{book}

%%%%%%%%
% Headers and footers.
\usepackage{fancyhdr}
\pagestyle{fancy}

\fancyhead[LE,RO]{\thepage}
\fancyhead[LO,RE]{\textit{\nouppercase{\leftmark}}}
\fancyfoot[C]{}

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\title{Sample title}
\author{Sample author}
\date{Sample date}

\begin{document}
\frontmatter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page.

\begin{titlepage}

Sample title page.

\end{titlepage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Metadata page.

\thispagestyle{empty}

\topskip0pt
\vspace*{\fill}

Sample metadata page.

\vspace*{\fill}

{
\setcounter{tocdepth}{0}
\tableofcontents
}

\mainmatter

\chapter{Sample chapter title}

Sample chapter text.

\end{document}
6
  • 1
    Why do you have (or need) \topskip0pt? Remove that and things turn back to normal...
    – Werner
    Jan 6 at 1:17
  • It's a workaround for this issue: tex.stackexchange.com/a/7290/11376 Jan 6 at 4:58
  • I.e. as far as I know you can't have true vertical centering without this. (If there's a better way to do that, I'm all ears.) Jan 6 at 4:59
  • 1
    You can use absolute positioning with eso-pic. It depends on what your metadata page looks like.
    – Werner
    Jan 6 at 5:19
  • 1
    There are many ways to perform vertical centering. The easiest is \parbox[c][\textheight][c]{...} \topskip isn't used since the height of the \parbox is larger. Jan 6 at 14:19
0

It seems that the \mainmatter command moves to the next odd page when you are using the oneside class option.

Try this modified version of your MWE, for which thank you.

% chapterprob.tex  SE 577746

\documentclass[12pt, oneside]{book}
%\documentclass[12pt]{book}

%%%%%%%%
% Headers and footers.
\usepackage{fancyhdr}
\pagestyle{fancy}

\fancyhead[LE,RO]{\thepage}
\fancyhead[LO,RE]{\textit{\nouppercase{\leftmark}}}
\fancyfoot[C]{}

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\title{Sample title}
\author{Sample author}
\date{Sample date}

\begin{document}
%\frontmatter
\pagenumbering{roman}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page.

\begin{titlepage}

Sample title page.

\end{titlepage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Metadata page.

\thispagestyle{empty}

\topskip0pt
\vspace*{\fill}

Sample metadata page.

\vspace*{\fill}

{
\setcounter{tocdepth}{0}
\tableofcontents
}

%\mainmatter
%\pagenumbering{arabic}

\chapter{Sample chapter title}
\pagenumbering{arabic}

Sample chapter text.

\end{document}

Note that instead of \frontmatter and \mainmatter I have used \pagenumbering to change the representation of the page numbers (which is one of the things that the \...matter macros do).

1
  • \mainmatter does contain a \cleardoublepage, so this is one way to work around it. Per the other comments though this seems to be a bad interaction with setting \topskip without using braces to properly scope it. (I still don't understand why, but it seems like the best explanation at this point.) Jan 7 at 0:12

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.