1

In a 200 page book, I'm trying to use \usepackage{emptypage} to remove page numbers from the automatically generated blank pages before a new chapter. For the some of these pages, I am still getting a page numbers. I cannot see anything different in content to trigger this. I am stumped!

If I take any single line of the content out before the new chapter, emptypage works! So it's like LaTeX thinks the content is spilling to the blank page when it is not.

Any Ideas?

Here is code:

% Designed to run under "pdfLaTeX + BibTeX + MakeIndex" option in TeXworks
\documentclass[openright,twoside,10pt]{book}
% Page Setup:
\usepackage[
paperwidth=6in,
paperheight=9in,
bindingoffset=0.2in,
left=1.25in,
right=1.25in,
top=1.1in,
bottom=1.1in,
includefoot
]{geometry}
\usepackage{graphicx}
\usepackage[usenames]{xcolor}
% Header/Footer Page Numbering and color:
\usepackage{fancyhdr} 
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\setlength{\footskip}{45pt}
\fancyfoot[C]{\textcolor{gray}{\thepage}}
\pagestyle{fancy}
\fancypagestyle{frontmatter}{%
\renewcommand{\headrulewidth}{0pt}% No header rule
\renewcommand{\footrulewidth}{0pt}% No footer rule
\fancyhf{}% Clear header/footer
\fancyfoot[C]{\thepage}%
}
\fancypagestyle{mainmatter}{%
  \renewcommand{\headrulewidth}{.4pt}% Header rule
  \renewcommand{\footrulewidth}{.4pt}% Footer rule
  \fancyhf{}% Clear header/footer
  \fancyhead[L]{\leftmark}% Chapter in header Left
  \fancyhead[R]{\thepage}% Page number in header Right
}
% Remove page numbers on empty pages 
\usepackage{emptypage}
% Add dummy text:
\usepackage{lipsum}
% Paragraph Formatting:
\parindent=0in
\parskip=12pt
% Turn off section numbers (0=no numbers, 1=numbers):
\setcounter{secnumdepth}{0}
% package for adding pages after a page:
\usepackage{afterpage}
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{0}% change to -1 if you don't want page numbers additive
\newpage}
%
%---------------------------------------Begin Book--------------------------    -------------
%
\begin{document}
. . .
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\frontmatter
\pagestyle{frontmatter}
\section{Forward}
\lipsum[1-5]
\mainmatter
\pagestyle{frontmatter}


This is not where I want to live\\
In my heaven\\
Flags are for burning\\
And the only God is possibility\\
\\
We can change this\\
F-cked up world\\
Into whatever we want, so\\
Why does it always stay the same\\
\chapter*{Man With a Suitcase}
\thispagestyle{empty}
\addcontentsline{toc}{chapter}{Man With a Suitcase}
\newpage
\blankpage
\section{Two Little Sparrows}
All my heroes \\
have flown away \\
While the blossoms \\
\\
On the trees \\
Are bursting out \\
Beautiful, in the \\
\\
Spring air \\
Followed by the hot winds \\
That will blow across my face \\



\end{document}
9
  • 6
    If you want someone to debug your code it is necessary for you to show your code. Also check the log file for any warnings around that page break, underfull hbox badness 10000 for example could have the effect that you describe and is usually caused by mis-use of \\ May 13, 2018 at 7:27
  • 1
    As @DavidCarlisle correctly predicted, the issue is that you are abusing the use of \\. The correct solution would be to use a proper environment for your verse. See e.g. Package to typeset Poems.
    – Alan Munn
    May 13, 2018 at 17:07
  • 1
    the error is always there. If you put \\ at the end of a paragrapgh or two consecutive \\ then tex warns you about a box of badness 10000 that is maximum badness and you should not ignore it! it does not make a vertical space (which you want) it makes a horizontal line of the paragraph, with no text in it. Such a line is always wrong and in particular it is not discarded at a page break so the page is white but it is not empty. May 13, 2018 at 17:21
  • 1
    The simple answer is that you should almost never use \\ except in special environments like tabular. See When to use \par and when \\, or blank lines.
    – Alan Munn
    May 13, 2018 at 17:26
  • 1
    \\ to force a linebreak is Ok but never do ..possibility\\ \\ with two consecutive \\ and never do ...across my face \\ with \\ at the end of a paragraph. Just use a blank line in both those cases. If you put \begin{verse} \end{verse}` around it the verses will be separated by vertical space May 13, 2018 at 17:38

1 Answer 1

3

Your example produces multiple warnings of the form

Underfull \hbox (badness 10000) in paragraph at lines 82--93

Note that that is the maximum badness TeX ever assigns, so TeX is warning you that the output is as bad as it gets according to its internal measure of the acceptability of the output.

Using \\ \\ or \\ at the end of a paragraph does not produce vertical space. it produces a line of the paragraph with no text "underfull" such a "white" line will not be discarded at a page break so will appear at the top of a normal page break, making the first line appear too low, and the final one may appear on a page on its own making a page that looks white but isn't empt.

Use a blank line not \\to mark a paragraph (or verse)

% Designed to run under "pdfLaTeX + BibTeX + MakeIndex" option in TeXworks

\documentclass[openright,twoside,10pt]{book}
% Page Setup:
\usepackage[
paperwidth=6in,
paperheight=9in,
bindingoffset=0.2in,
left=1.25in,
right=1.25in,
top=1.1in,
bottom=1.1in,
includefoot
]{geometry}
\usepackage{graphicx}
\usepackage[usenames]{xcolor}
% Header/Footer Page Numbering and color:
\usepackage{fancyhdr} 
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\setlength{\footskip}{45pt}
\fancyfoot[C]{\textcolor{gray}{\thepage}}
\pagestyle{fancy}
\fancypagestyle{frontmatter}{%
\renewcommand{\headrulewidth}{0pt}% No header rule
\renewcommand{\footrulewidth}{0pt}% No footer rule
\fancyhf{}% Clear header/footer
\fancyfoot[C]{\thepage}%
}
\fancypagestyle{mainmatter}{%
  \renewcommand{\headrulewidth}{.4pt}% Header rule
  \renewcommand{\footrulewidth}{.4pt}% Footer rule
  \fancyhf{}% Clear header/footer
  \fancyhead[L]{\leftmark}% Chapter in header Left
  \fancyhead[R]{\thepage}% Page number in header Right
}
% Remove page numbers on empty pages 
\usepackage{emptypage}
% Add dummy text:
\usepackage{lipsum}
% Paragraph Formatting:
\parindent=0in
\parskip=12pt
% Turn off section numbers (0=no numbers, 1=numbers):
\setcounter{secnumdepth}{0}
% package for adding pages after a page:
\usepackage{afterpage}
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{0}% change to -1 if you don't want page numbers additive
\newpage}
%
%---------------------------------------Begin Book--------------------------    -------------
%
\begin{document}
. . .
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\frontmatter
\pagestyle{frontmatter}
\section{Forward}
\lipsum[1-5]
\mainmatter
\pagestyle{frontmatter}

\begin{verse}
This is not where I want to live\\
In my heaven\\
Flags are for burning\\
And the only God is possibility

We can change this\\
F-cked up world\\
Into whatever we want, so\\
Why does it always stay the same
\end{verse}

\chapter*{Man With a Suitcase}
\thispagestyle{empty}
\addcontentsline{toc}{chapter}{Man With a Suitcase}
\newpage
\blankpage
\section{Two Little Sparrows}

\begin{verse}
All my heroes \\
have flown away \\
While the blossoms

On the trees \\
Are bursting out \\
Beautiful, in the

Spring air \\
Followed by the hot winds \\
That will blow across my face 
\end{verse}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .