3

I am using the book document class and want to remove the blank pages it is adding after my title and after my TOC. I don't care to have any blank pages in this whole document actually, however these are the two places where blanks are present right now. I have tried to redefine /cleardoublepage as many Stackoverflow answers suggested, but I still see the new pages present and feel like I must be doing something wrong or missing a package.

Here is what my setup looks like currently for my tex:

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

\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}

\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}

\title{Assignment}
\author{Person One \and Person 2}

\begin{document}

\begingroup
\let\cleardoublepage\relax
\let\clearpage\relax  
\maketitle
\endgroup

\frontmatter
\begingroup
\let\cleardoublepage\relax
\let\clearpage\relax
\tableofcontents
\endgroup


\mainmatter

\chapter{Report}

\end{document}
4
  • I suppose using a different document class is not an option? Commented Oct 14, 2016 at 4:56
  • The blank pages are inserted by \frontmatter and \mainmatter. They reset the page number and the \cleardoublepage ensures that the page with value 1 is a right page.
    – esdd
    Commented Oct 14, 2016 at 8:15
  • @esdd The resetting like that of the page numbers is exactly what I want so that in my TOC I can have the front matter content numbered via roman numerals, and then switch to alpha for the real content. Is there an alternate way to accomplish this or get rid of the blank pages? Commented Oct 14, 2016 at 14:34
  • @JohnKormylo It is an option. I was originally using the article document class but I couldn't get some of the things formatted correctly using it. Commented Oct 14, 2016 at 14:35

1 Answer 1

9

The extra page is generated by \chapter which is outside the group where \cleardoublepage was redefined.

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

\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}

\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}

\title{Assignment}
\author{Person One \and Person 2}

\let\cleardoublepage=\clearpage

\begin{document}

\maketitle

\frontmatter
\tableofcontents

\mainmatter

\chapter{Report}

\end{document}

A somewhat safer options is to use report class and play with the page numbers directly.

\documentclass[12pt,oneside,openany]{report}

\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}

\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}

\title{Assignment}
\author{Person One \and Person 2}

\begin{document}
\maketitle

\clearpage
\renewcommand{\thepage}{\roman{page}}
\setcounter{page}{1}

\tableofcontents

\clearpage
\renewcommand{\thepage}{\arabic{page}}
\setcounter{page}{1}

\chapter{Report}

\end{document}
5
  • I went with your second option of switching it back to article however now it seems like the headers are no longer displaying. I thought fancyhdr should still work fine here? Commented Oct 14, 2016 at 16:49
  • Ah I see, it looks like that in the article document class it is not showing the header for some reason on the TOC or on the first page of a chapter. When I added in some text to make it go past the first page then I would see the header on the new pages. Commented Oct 14, 2016 at 16:56
  • I don't think article class supports \chapter, only \section and \subsection. Commented Oct 15, 2016 at 3:15
  • It seems to have worked, however I had to make some other modifications to get it to work. Regardless it is now working as expected and your answer helped. Thanks. Commented Oct 15, 2016 at 4:55
  • you saved me man! Commented Sep 6, 2017 at 0:52

You must log in to answer this question.

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