tags:

views:

4779

answers:

7

How to remove a blank page that gets added automatically after \part{} or \chapter{} in a book document class?

I need to add some short text describing the \part. Adding some text after the part command results in at least 3 pages with an empty page between the part heading and the text:

  1. Part xx
  2. (empty)
  3. some text

How to get rid of that empty page?

P.S. Latex: How to remove blank pages coming between two chapters IN Appendix? is similar but it changes the behavior for the rest of the text while I need to remove the empty page for this one \part command only.

+1  A: 

I believe that in the book class all \part and \chapter are set to start on a recto page.

from book.cls:

\newcommand\part{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \thispagestyle{plain}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null\vfil
  \secdef\@part\@spart}

you should be able to renew that command, and something similar for the \chapter.

Mica
I tried your suggestion by replacing the \if@openright block with \clearpage (since i know that @openright is not defined) but it did not work - \part{}s after this definition turned into garbage...Thanks for the suggestion, it seems a good way to go. Could you suggest how to get it working?
CaptSolo
if you have something like \documentclass[12pt,twoside]{book}, change twoside to oneside. that did it for me, and, someone correct me if i'm wrong, but i believe the only thing that will change other than the \cleardoublepage would be the margins, which is a difference that i've found that nobody cares about.
Mica
That would not answer my question about changing the behavior locally, for one individual instance of \part{} and not for the whole document. However, I have got the solution now. Will post it below.
CaptSolo
+3  A: 

You don't say what class you are using, but I'm guessing it is the standard book. In which case the page clearing is a feature of he class which you can override as Mica suggests, or solve by switching to another class. The standard report class is similar to book, or the memoir class is an improved book and is very flexible indeed.

dmckee
not sure if he wants to switch document classes, but i recommend the memoir class as well, i've found it quite easy to control most aspects of the layout with it, the documentation is excellent and goes *very* deep.
Mica
i am cautious of switching document classes as i need to focus on writing right now and not exploring LaTeX. but if switching to memoir is seamless, i might try to do it.
CaptSolo
A: 

I think you can simply add the oneside option the book class?

i.e.

\documentclass[oneside]{book}

Although I didn't test it :)

gromgull
I need this modification locally, just for one \part{} statement only.
CaptSolo
A: 

A solution that works:

Wrap the part of the document that needs this modified behavior with the code provided below. In my case the portion to wrap is a \part{} and some text following it.

\makeatletter\@openrightfalse
\part{Whatever}

Some text

\chapter{Foo}
\@openrighttrue\makeatother

The wrapped portion should also include the chapter at the beginning of which this behavior needs to stop. Otherwise LaTeX may generate an empty page before this chapter.

Source: folks at the #latex IRC channel on irc.freenode.net

CaptSolo
Mica
no, it is the 2nd part of the three. both the 1st and the 3rd part remain as they were, unaffected.or are you saying that this solution would not work if I needed to modify the 1st \part?
CaptSolo
A: 

Although I guess you don't need an answer any longer, I give the solution for those who will come to see this post.

from book.cls

\def\@endpart{\vfil\newpage
              \if@twoside
                \null
                \thispagestyle{empty}%
                \newpage
              \fi
              \if@tempswa
                \twocolumn
              \fi}

It is "\newpage" at the first line of this fragment that adds a redundant blank page after the part header page. So you must redefine the command \@endpart. Add the following snippet to the beggining of your tex file.

\makeatletter
\renewcommnd\@endpart{\vfil
              \if@twoside
                \null
                \thispagestyle{empty}%
                \newpage
              \fi
              \if@tempswa
                \twocolumn
              \fi}
\makeatother
Anon.
A: 

I know it's a bit late, but I just came across this post and wanted to mention that I don't really see way everybody wants to do it in a difficult way... The problem here is just that the book class takes twoside as default, so, as gromgull said, just pass oneside as argument and it's solved.

The question was how to do this for a particular part or chapter, leaving the rest of the document twoside like it was before.
CaptSolo
A: 

It leaves blank pages so that a new part or chapter start on the right-hand side. You can fix this with the "openany" option for the document class. ;)

J Shibby