First chapter page is on even page, not odd

I am trying to do a 500 page book in LaTex, to produce PDF for print on demand. Mostly things work right. In particular, I want chapters to be on the right hand page, and if there is a blank page before it, the blank page should not have a page number. All that works for 10 chapters, and 4 appendices.

But on the last appendix, just before the index, I get a blank even page (page 466), as expected. Then the odd page (right hand page) has a page number (467), but no contents. And the contents for that page (the appendix title and contents) appear on the next page (468). Then the index on 469.

The entire contents of the Appendix (one page) shows up just fine on one physical page, but there is this "extra" blank page that is being inserted. I am using pdflatex, and the log says:

Underfull \vbox (badness 10000) has occurred while \output is active [3] Overfull \vbox (9.17294pt too high) has occurred while \output is active [4]

which I believe is saying that the contents of the appendix (a table) is a bit too long. And in fact, if I remove the last two lines from the table, everything works as desired.

But having two lines on a page by itself would be undesirable, and it does all fit -- there is just this blank page stuck in that I don't want.

I could understand if LaTeX decided that the table wouldn't fit on one page, and so pushed it to a second page, leaving just the appendix header, but it keeps them all together.

I have other places where LaTeX seems to just decide to throw in gratuitous extra blank vertical space, but I can work around them with a \vspace(-5mm) or so, but here I want it to "back up" over an entire page, and "before" an appendix header that triggers the move to a new page, so I don't know how to work around this.

I have what I think is a Minimum Working Example. For some reason, it seems to have dropped the page number on the extra blank page (page 3 for the example), but the page is still there.

% basic document is a book, with 9pt text
\documentclass[9pt]{book}

% font work
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
\usepackage{textcomp}
\usepackage{t1enc}

% here we are trying to reproduce our page layout.
% changing this means you have to check all the page breaks, and figure placements
% look for \vspace{} and \linebreak
\usepackage[paperwidth=6.25in,paperheight=9.25in,marginparwidth=50pt,footskip=0pt,textheight=7.25in,textwidth=4.7in]{geometry}

\usepackage{booktabs}

% latex code to allow no page number on completely blank pages
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{\clearpage {\pagestyle{empty}\origdoublepage}}
\let\cleardoublepage\clearemptydoublepage

% start the book
\begin{document}

\mainmatter
\cleardoublepage \chapter{BASIC COMPUTER ORGANIZATION}
\par
Computers, like automobiles, television, and telephones, are
becoming more and more an integral part of our society. As such,
more and more people come into regular contact with
computers.

\backmatter
\appendix
\cleardoublepage \chapter{APPENDIX E: MIX CHARACTER CODE}
\begin{tabular}{ccc}
\textbf{Character} & \textbf{Decimal} & \textbf{Octal} \\
\cmidrule{1-3}
blank & \texttt{00} & \texttt{00} \\
\texttt{A} & \texttt{01} & \texttt{01} \\
\texttt{B} & \texttt{02} & \texttt{02} \\
\texttt{C} & \texttt{03} & \texttt{03} \\
\texttt{D} & \texttt{04} & \texttt{04} \\
\texttt{E} & \texttt{05} & \texttt{05} \\
\texttt{F} & \texttt{06} & \texttt{06} \\
\texttt{G} & \texttt{07} & \texttt{07} \\
\texttt{H} & \texttt{08} & \texttt{10} \\
\texttt{I} & \texttt{09} & \texttt{11} \\
$\Theta$   & \texttt{10} & \texttt{12} \\
\texttt{J} & \texttt{11} & \texttt{13} \\
\texttt{K} & \texttt{12} & \texttt{14} \\
\texttt{L} & \texttt{13} & \texttt{15} \\
\texttt{M} & \texttt{14} & \texttt{16} \\
\texttt{N} & \texttt{15} & \texttt{17} \\
\texttt{O} & \texttt{16} & \texttt{20} \\
\texttt{P} & \texttt{17} & \texttt{21} \\
\texttt{Q} & \texttt{18} & \texttt{22} \\
\texttt{R} & \texttt{19} & \texttt{23} \\
$\Phi$     & \texttt{20} & \texttt{24} \\
$\Pi$      & \texttt{21} & \texttt{25} \\
\texttt{S} & \texttt{22} & \texttt{26} \\
\texttt{T} & \texttt{23} & \texttt{27} \\
\texttt{U} & \texttt{24} & \texttt{30} \\
\texttt{V} & \texttt{25} & \texttt{31} \\
\texttt{W} & \texttt{26} & \texttt{32} \\
\texttt{X} & \texttt{27} & \texttt{33} \\
\texttt{Y} & \texttt{28} & \texttt{34} \\
\texttt{Z} & \texttt{29} & \texttt{35} \\
\end{tabular}
\end{document}

• Remove that \cleardoublepage before the \chapter. \chapter already does a \cleardoublepage. – Phelype Oleinik Nov 6 '18 at 21:05
• There is no feasible page break between the chapter heading and the table, so first TeX is forced to move everything to the next page but after this it realizes that it cannot break and makes an overfull page. Use longtable instead. – egreg Nov 6 '18 at 22:55
• Phelype -- removing the \cleardoublepage before the chapter makes no difference. If \chapter does one too, it would seem to be idempotent -- doing two in a row makes no change from doing one. – James Peterson Nov 6 '18 at 23:03
• egreg -- Using a long table instead of a table does eliminate the "extra" blank page, but gives the last two rows on the next page, which is ugly at best. Clearly, at least by making an overfull page, it will all fit on one page. It seems that LaTeX is, as you say, deciding it won't all fit on one page, skipping forward to the next page, and then realizing that it still won't fit, so making it an overfull page, but not "un-doing" the decision to move on to the next page. – James Peterson Nov 6 '18 at 23:09

You get the warning

[1{/usr/local/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
[2] (/usr/local/texlive/2018/texmf-dist/tex/latex/base/t1cmtt.fd)
Underfull \vbox (badness 10000) has occurred while \output is active [3]
Overfull \vbox (9.17294pt too high) has occurred while \output is active
[4]


which means that the page is overfull (not really much). Since there is no legal page break point between the chapter heading and the following text, but there is one before the chapter heading, TeX will break there and move the material to the next page, which however becomes overfull.

Ad hoc solution for the particular case: add a negative vertical space.

The real situation might need a different workaround, for instance splitting the table into two.

Some notes.

1. There is no 9pt option for the book class.
2. There is no need for \cleardoublepage before \chapter, which already takes care of that.
3. Instead of the clumsy code for getting really blank pages, load the emptypage package.
\documentclass{book}

% font work
\usepackage[T1]{fontenc} % not t1enc
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
\usepackage{textcomp}

% here we are trying to reproduce our page layout.
% changing this means you have to check all the page breaks, and figure placements
% look for \vspace{} and \linebreak
\usepackage[
paperwidth=6.25in,
paperheight=9.25in,
marginparwidth=50pt,
footskip=0pt,
textheight=7.25in,
textwidth=4.7in,
]{geometry}

\usepackage{booktabs}

% latex code to allow no page number on completely blank pages
\usepackage{emptypage}

% start the book
\begin{document}

\mainmatter
\chapter{BASIC COMPUTER ORGANIZATION}

Computers, like automobiles, television, and telephones, are
becoming more and more an integral part of our society. As such,
more and more people come into regular contact with
computers.

\backmatter
\appendix
\chapter{APPENDIX E: MIX CHARACTER CODE}

\vspace*{-12pt}

\begin{tabular}{ccc}
\textbf{Character} & \textbf{Decimal} & \textbf{Octal} \\
\cmidrule{1-3}
blank & \texttt{00} & \texttt{00} \\
\texttt{A} & \texttt{01} & \texttt{01} \\
\texttt{B} & \texttt{02} & \texttt{02} \\
\texttt{C} & \texttt{03} & \texttt{03} \\
\texttt{D} & \texttt{04} & \texttt{04} \\
\texttt{E} & \texttt{05} & \texttt{05} \\
\texttt{F} & \texttt{06} & \texttt{06} \\
\texttt{G} & \texttt{07} & \texttt{07} \\
\texttt{H} & \texttt{08} & \texttt{10} \\
\texttt{I} & \texttt{09} & \texttt{11} \\
$\Theta$   & \texttt{10} & \texttt{12} \\
\texttt{J} & \texttt{11} & \texttt{13} \\
\texttt{K} & \texttt{12} & \texttt{14} \\
\texttt{L} & \texttt{13} & \texttt{15} \\
\texttt{M} & \texttt{14} & \texttt{16} \\
\texttt{N} & \texttt{15} & \texttt{17} \\
\texttt{O} & \texttt{16} & \texttt{20} \\
\texttt{P} & \texttt{17} & \texttt{21} \\
\texttt{Q} & \texttt{18} & \texttt{22} \\
\texttt{R} & \texttt{19} & \texttt{23} \\
$\Phi$     & \texttt{20} & \texttt{24} \\
$\Pi$      & \texttt{21} & \texttt{25} \\
\texttt{S} & \texttt{22} & \texttt{26} \\
\texttt{T} & \texttt{23} & \texttt{27} \\
\texttt{U} & \texttt{24} & \texttt{30} \\
\texttt{V} & \texttt{25} & \texttt{31} \\
\texttt{W} & \texttt{26} & \texttt{32} \\
\texttt{X} & \texttt{27} & \texttt{33} \\
\texttt{Y} & \texttt{28} & \texttt{34} \\
\texttt{Z} & \texttt{29} & \texttt{35} \\
\end{tabular}
\end{document}


Alternative solution, split the table into two parts:

\backmatter
\appendix
\chapter{APPENDIX E: MIX CHARACTER CODE}

\begin{tabular}[t]{ccc}
\textbf{Character} & \textbf{Decimal} & \textbf{Octal} \\
\cmidrule{1-3}
blank & \texttt{00} & \texttt{00} \\
\texttt{A} & \texttt{01} & \texttt{01} \\
\texttt{B} & \texttt{02} & \texttt{02} \\
\texttt{C} & \texttt{03} & \texttt{03} \\
\texttt{D} & \texttt{04} & \texttt{04} \\
\texttt{E} & \texttt{05} & \texttt{05} \\
\texttt{F} & \texttt{06} & \texttt{06} \\
\texttt{G} & \texttt{07} & \texttt{07} \\
\texttt{H} & \texttt{08} & \texttt{10} \\
\texttt{I} & \texttt{09} & \texttt{11} \\
$\Theta$   & \texttt{10} & \texttt{12} \\
\texttt{J} & \texttt{11} & \texttt{13} \\
\texttt{K} & \texttt{12} & \texttt{14} \\
\texttt{L} & \texttt{13} & \texttt{15} \\
\texttt{M} & \texttt{14} & \texttt{16} \\
\end{tabular}\hfill
\begin{tabular}[t]{ccc}
\textbf{Character} & \textbf{Decimal} & \textbf{Octal} \\
\cmidrule{1-3}
\texttt{N} & \texttt{15} & \texttt{17} \\
\texttt{O} & \texttt{16} & \texttt{20} \\
\texttt{P} & \texttt{17} & \texttt{21} \\
\texttt{Q} & \texttt{18} & \texttt{22} \\
\texttt{R} & \texttt{19} & \texttt{23} \\
$\Phi$     & \texttt{20} & \texttt{24} \\
$\Pi$      & \texttt{21} & \texttt{25} \\
\texttt{S} & \texttt{22} & \texttt{26} \\
\texttt{T} & \texttt{23} & \texttt{27} \\
\texttt{U} & \texttt{24} & \texttt{30} \\
\texttt{V} & \texttt{25} & \texttt{31} \\
\texttt{W} & \texttt{26} & \texttt{32} \\
\texttt{X} & \texttt{27} & \texttt{33} \\
\texttt{Y} & \texttt{28} & \texttt{34} \\
\texttt{Z} & \texttt{29} & \texttt{35} \\
\end{tabular}


• Excellent suggestions all around. I will incorporate them. – James Peterson Nov 7 '18 at 1:05
• I can't split the table -- I already have (for codes 30 to 55 (decimal)). I dropped those to make the example simpler. Adding the negative spacing seems easiest in this case. Special thanks for the comment about 9pt in book; the output seemed to match a printed 9pt book; I'll have to look into that more. Apparently I need extbook. The book design says "9/12 pt Helvetica". – James Peterson Nov 7 '18 at 1:17
• @egreg -- why wouldn't \enlargethispage{2\baselineskip}(just after the \chapter{...} command) be s reasonable alternative? – barbara beeton Nov 7 '18 at 1:47
• @barbarabeeton Because the page number would not be moved. – egreg Nov 7 '18 at 7:47
• @egreg -- thanks. i keep forgetting that unpleasant limitation. – barbara beeton Nov 7 '18 at 16:02