Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Suppress page break before Chapter in Report Class

21 views
Skip to first unread message

Bob Kerstetter

unread,
Jul 31, 2008, 11:32:17 AM7/31/08
to
While this works:

{\renewcommand\newpage{}\chapter{chaptername}}

(Thanks to Piet van Oostrum in this thread: suppress page break before
bib in book.)

Is there anyway to do this with \renewcommand\chapter ?

Thanks.

BK

Bob Kerstetter

unread,
Jul 31, 2008, 1:56:33 PM7/31/08
to


Well, you always sort of hate to answer your own questions.

While {\renewcommand\newpage{}\chapter{chaptername}} is a very cool
hack, and I will use it again, I found a different way.

The \chapter command is defined like this in report.cls

\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}


This statement adds the new page or pages before the chapter:
\if@openright\cleardoublepage\else\clearpage\fi

In the preamble of my doc I renewed the command and removed the
statement:

\makeatletter %keeps latex from stumbling over @ signs
\newcommand\chapter{\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\makeatother % resets @ signs to their normal usage in latex.

Works fine and does what I need.

So why do I need this? Okay. I am using twocolumns. Everytime I switch
the number of columns—that is use \onecolumn or \twocolumn—latex adds
a page break. When I switch \onecolumn before \chapter, both add a
page break. I figure \chapter is easier to fix than \onecolumn.

I would sure appreciate a prettier way to do this, but for now, it
works.

Oh, I cannot use the multicol package for this job because of its
limited support of floats.

Bob Kerstetter
http://villagehiker.com

Donald Arseneau

unread,
Jul 31, 2008, 3:26:00 PM7/31/08
to
On Jul 31, 10:56 am, Bob Kerstetter <texu...@gmail.com> wrote:

> So why do I need this? Okay. I am using twocolumns. Everytime I switch
> the number of columns—that is use \onecolumn or \twocolumn—latex adds
> a page break. When I switch \onecolumn before \chapter, both add a
> page break. I figure \chapter is easier to fix than \onecolumn.

If you are switching between two and one-column by hand, then
try without the [twocolumn] option. Then \chapter doesn't think it
needs to say \twocolumn[...] for the chapter title.

Donald Arseneau as...@triumf.ca

Ulrike Fischer

unread,
Aug 1, 2008, 5:27:30 AM8/1/08
to
Am Thu, 31 Jul 2008 10:56:33 -0700 (PDT) schrieb Bob Kerstetter:


> So why do I need this? Okay. I am using twocolumns. Everytime I switch
> the number of columns—that is use \onecolumn or \twocolumn—latex adds
> a page break. When I switch \onecolumn before \chapter, both add a
> page break. I figure \chapter is easier to fix than \onecolumn.

I can't reproduce this, I don't get unwanted page breaks:

\documentclass{report}
\usepackage{lipsum}

\begin{document}
\chapter{a}
\lipsum
\twocolumn
\chapter{b}
\lipsum
\onecolumn
\chapter{c}
\lipsum
\end{document}

--
Ulrike Fischer

0 new messages