Page LayoutPage break in table of contents after chapter

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
gandi
Posts: 23
Joined: Tue Oct 20, 2009 2:45 pm

Page break in table of contents after chapter

Post by gandi »

Hello,

in my toc there is a page break directly after a chapter (and before the first section in this chapter), which looks a bit odd. See the attached PDF-output of the MWE below. I would rather have the page break before the chapter or after one or two sections in that chapter. Does anyone know how to achieve this?

I'm using LyX, but I'd say this is mainly a LaTeX issue.

LaTeX MWE of this:

Code: Select all

\documentclass[a4paper, 11pt]{scrbook}

\usepackage{setspace}
\onehalfspacing

\begin{document}

\tableofcontents

\chapter{Chapter One}
\section{Section One}
blabla
\section{Section Two}
blabla
\section{Section Three}
blabla
\section{Section Four}
blabla
\section{Section Five}
blabla
\section{Section Six}
blabla
\section{Section Seven}
blabla
\section{Section Eight}
blabla
\section{Section Nine}
blabla
\section{Section Ten}
blabla
\section{Section Eleven}
blabla
\section{Section Twelve}
blabla

\chapter{Chapter Two}
\section{Section One}
blabla
\section{Section Two}
blabla
\section{Section Three}
blabla
\section{Section Four}
blabla
\section{Section Five}
blabla
\section{Section Six}
blabla
\section{Section Seven}
blabla
\section{Section Eight}
blabla
\section{Section Nine}
blabla
\section{Section Ten}
blabla
\section{Section Eleven}
blabla
\section{Section Twelve}
blabla

\chapter{Chapter Three}
\section{Section One}
blabla
\section{Section Two}
blabla
\section{Section Three}
blabla
\end{document}
Attachments
2010-05-24_toc.pdf
(26.26 KiB) Downloaded 727 times
Last edited by gandi on Sun May 30, 2010 3:53 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Page break in table of contents after chapter

Post by meho_r »

This code of yours works fine on my machine, no break displayed in the PDF document you attached. I even imported the code in LyX and tested, still no problematic break. Can you provide your .lyx file?
gandi
Posts: 23
Joined: Tue Oct 20, 2009 2:45 pm

Re: Page break in table of contents after chapter

Post by gandi »

Dear meho_r,

thanks for your reply. The LyX file where the problem occured first is my entire thesis, i.e. a bit bulky. That's why I tried to see if it is reproducible in a simple LaTeX file.

After you've told me that my MWE works fine for you I've tried it on a different machine (Win XP, MiKTeX) and the output was the way I want it, i.e. a page break before a chapter or after the first section, depending on how many entries there were.

So this seems to be related to the TeX Live installation on my other PC (running Ubuntu)... Has anyone experienced such a behaviour in TeX Live before? I might move this discussion to the Tex Live forum.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Page break in table of contents after chapter

Post by localghost »

I tested your example with a TeX Live 2009 system on openSUSE 11.2 and the page break occurs as desired before the last chapter entry. So this behaviour is not distribution specific. It's very likely that this is caused by older package versions. Ubuntu is known for shipping and older version of TeX Live. Add the \listfiles command as very first line to your code and post the file list from the newly generated log.

Code: Select all

 *File List*
 scrbook.cls    2009/07/24 v3.04a KOMA-Script document class (book)
scrkbase.sty    2009/07/24 v3.04a KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
 scrbase.sty    2009/07/24 v3.04a KOMA-Script package (KOMA-Script-independent basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2009/03/25 v3.03 KOMA-Script package (loading files)
tocbasic.sty    2009/06/08 v3.03b KOMA-Script package (handling toc-files)
scrsize11pt.clo    2009/07/24 v3.04a KOMA-Script font size class option (11pt)
typearea.sty    2009/07/24 v3.04a KOMA-Script package (type area)
setspace.sty    2000/12/01 6.7 Contributed and Supported LaTeX2e package
 ***********

Best regards
Thorsten
gandi
Posts: 23
Joined: Tue Oct 20, 2009 2:45 pm

Page break in table of contents after chapter

Post by gandi »

Thanks, Thorsten, that sounds very plausible.

Here's what I got:

Code: Select all

 *File List*
 scrbook.cls    2006/07/30 v2.95b KOMA-Script document class (book)
scrkbase.sty    2006/07/30 v2.95b KOMA-Script package (basics and keyval use)
scrlfile.sty    2006/03/28 v2.95 KOMA-Script package (loading files)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
    bk11.clo    2005/09/16 v1.4f Standard LaTeX file (size option)
typearea.sty    2006/07/30 v2.95b KOMA-Script package (type area)
setspace.sty    2000/12/01 6.7 Contributed and Supported LaTeX2e package
 ***********
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Page break in table of contents after chapter

Post by localghost »

As you can see, your version of KOMA Script is much older than mine. Seems to me that you have TeX Live 2007 installed. Think about updating the package manually or do a distribution upgrade. The current Ubuntu (10.04 »Lucid Lynx«) is shipped with TeX Live 2009.
gandi
Posts: 23
Joined: Tue Oct 20, 2009 2:45 pm

Page break in table of contents after chapter

Post by gandi »

You were right, Thorsten, after upgrading to Ubuntu 10.04 my MWE gave a satisfying result. However, in my thesis (written in LyX) the problem persisted. I have now reduced my thesis to another LaTeX MWE, which shows the problem:

Code: Select all

\documentclass[12pt,oneside,headsepline,tablecaptionabove]{scrbook}
%\documentclass[12pt,oneside,headsepline]{scrbook}
%\documentclass[12pt,oneside,tablecaptionabove]{scrbook}

\usepackage{setspace}
\onehalfspacing

\begin{document}

\tableofcontents{}

\chapter{Chapter One}
\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}
\section{Section Six}
\section{Section Seven}
\section{Section Eight}
\section{Section Nine}
\section{Section Ten}
\section{Section Eleven}

\chapter{Chapter Two}
\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}

\chapter{Chapter Three}
\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\chapter{Chapter Four}
\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}
\section{Section Six}

\end{document}
It appears that the combination of headsepline and tablecaptionabove causes the problem, see attached output "toc.pdf". If I use one of the two \documentclass lines in the example above which are commented out it works fine. I get the same result using MiKTeX / Win XP.
Attachments
toc.pdf
(38.67 KiB) Downloaded 376 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Page break in table of contents after chapter

Post by localghost »

I can comprehend the problem with your MWE. However, you should obtain a warning from the class in the log about an obsolete option. Note that the option assignment for the document class has changed significantly since Version 3 of KOMA Script. It uses now the »key=value« scheme. The problem disappears if you use the class compliant options.

Code: Select all

\documentclass[%
  12pt,
  oneside,
  headsepline,
  captions=tableabove
]{scrbook}
For further information on the new option system refer to the manual.
gandi
Posts: 23
Joined: Tue Oct 20, 2009 2:45 pm

Re: Page break in table of contents after chapter

Post by gandi »

Great, that did the job, also in my LyX file. Thanks!
Post Reply