第一章页面在偶数页,不在奇数页

第一章页面在偶数页,不在奇数页

我正在尝试用 LaTex 制作一本 500 页的书,以生成 PDF 以供按需打印。大部分工作都正常。特别是,我希望章节位于右手边的页面上,如果前面有一个空白页,则空白页不应有页码。所有这些适用于 10 个章节和 4 个附录。

但在最后一个附录中,就在索引之前,我得到了一个空白的偶数页(第 466 页),正如预期的那样。然后奇数页(右手边的页面)有页码(467),但没有内容。该页的内容(附录标题和内容)出现在下一页(468)。然后是 469 上的索引。

附录的全部内容(一页)在一个物理页面上显示得很好,但是有一个“额外的”空白页正在插入。我正在使用 pdflatex,日志显示:

\output 处于活动状态时,发生 \vbox 未满(不良率 10000)[3] \output 处于活动状态时,发生 \vbox 过满(9.17294pt 太高)[4]

我认为这说明附录(表格)的内容有点太长了。事实上,如果我从表格中删除最后两行,一切都会按预期进行。

但一页上只有两行是不可取的,而且它确实都适合——只剩下这张我不需要的空白页了。

我可以理解如果 LaTeX 认为表格无法放在一页上,因此将其推到第二页,只留下附录标题,但它会将它们全部放在一起。

我在其他地方看到 LaTeX 似乎只是决定插入多余的垂直空白空间,但我可以使用 \vspace(-5mm) 左右来解决它们,但在这里我希望它“备份”整个页面,并且“在”触发移动到新页面的附录标题“之前”,所以我不知道如何解决这个问题。

我有一个我认为是最小工作示例的东西。出于某种原因,它似乎删除了额外空白页上的页码(示例中为第 3 页),但该页面仍在那里。

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

答案1

你收到警告

[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]

这意味着页面已经满了(其实不是很多)。因为章节标题和后面的文本之间没有合法的分页点,但有一个章节标题,TeX 将在那里中断并将材料移至下一页,但下一页会变得过满。

特别指定针对特殊情况的解决方案:添加负垂直空间。

实际情况可能需要不同的解决方法,例如将表分成两张。

一些注释。

  1. 9pt该课程没有选项book
  2. 没有必要,因为\cleardoublepage之前\chapter已经处理好了。
  3. 加载包,而不是使用笨拙的代码来获取真正空白的页面emptypage
\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}

在此处输入图片描述

替代解决方案,将表分成两部分:

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

在此处输入图片描述

相关内容