Wednesday, 21 August 2013

ToC page numbering occasionally wrong after using vspace

ToC page numbering occasionally wrong after using vspace

I'm writing my dissertation and have a few sections that are small, less
than a page, each with a figure. I'm letting the figures float to the next
section to keep them from being on a page by themselves (they don't merit
a full page, and there are lots anyway). The problem comes when I end up
with a section starting on the last line or two of a page, with no text
following it before the page break which is a no-no. If I can, I use
\clearpage, but that doesn't allow a figure from a previous section to be
placed in the next section. If I can't use \clearpage without orphaning a
figure, I am using \vspace{3em} in front of the next section command just
to bump it to another page. When I do this, though, the Table of Contents
entry for the second section displays the page for the first section.
Here's the MWE:
\documentclass[12pt]{report}
\begin{document}
\pagenumbering{roman}
\pagestyle{plain}
Abstract
\addcontentsline{toc}{chapter}{Abstract}
\tableofcontents
\include{table_of_contents}
\pagenumbering{arabic}
\chapter{}
\section{First section}
This takes up just enough space so the section title of the NEXT section is a
line all by itself at the bottom of the last page of this section.
\vspace{30em}
\section{Second section}
\end{document}
I'm looking for a way to either get the ToC page numbers to be correct or
to bump the section title down in a way that lets the figures float around
still (which will presumably ALSO get the ToC numbers right).

No comments:

Post a Comment