1

Possible Duplicate:
Overfull box and broken pagination

I'm currently using Latex for the first time in about a year, and I've run into some trouble. I have two images in my document so far, using the code:

\documentclass[12pt]{article}
\usepackage[top=2cm,bottom=4cm,left=3.2cm,right=3.2cm]{geometry}

\usepackage{setspace}
\onehalfspacing
\usepackage{lipsum}
\usepackage{graphicx}
\graphicspath{{./images/}}
\usepackage{float}
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{listings}


\begin{document}

\title{Title}
\date{}
\maketitle

\section{Introduction}
Blahblahblah.

\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
\subsection{sub2}
\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
 \subsection{sub2}
\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
\subsection{sub2}
\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
\subsection{sub2}
\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
\subsection{sub2}
\section{Recommendations}
\subsection{sub1}
\subsubsection{subsub1}
\subsubsection{subsub2}
\subsection{sub2}

\end{document}  

This seems to have inserted the images as I would like, however, on the page containing the second image, all subsequent text seems to overun the bottom of the page, and the document ends. The page containing the first image ends as normal (page number, bottom margin, etc). I've never encountered this issue before, and looking at previous .tex files, this is the same method I used.

Trev
  • 11
  • Welcome to TEX.sx! Could you add the header etc to make your code a Minimal Working Example (MWE) – Peter Jansson Jan 03 '13 at 14:02
  • Hi Peter, thanks for the reply. I'm a bit rusty with Latex, as I am quickly gathering! I think I have added what you asked for. – Trev Jan 03 '13 at 14:10
  • 1
    no worries, an MWE should be complete so could you add the end of the document as well so that your problem can be reproduced – Peter Jansson Jan 03 '13 at 14:12
  • Done. I have however noticed that I still get this problem when I comment out the two figure environments. – Trev Jan 03 '13 at 14:16
  • 1
    A minimal example must not only be compilabe, but also show the problem at hand. – lockstep Jan 03 '13 at 14:18
  • 1
    I'm not sure what you mean by this. When I compile it, I am left with text the runs off the bottom of the page. Would a screenshot of my resulting .pdf file be more useful? – Trev Jan 03 '13 at 14:22
  • @Trev: That would help. We don't have the included image. – Martin Schröder Jan 03 '13 at 14:29
  • Trev I think the problem is the image you trying to use. Firstly the angle=180 will typeset it upside down, is that what you want? If the image aspect ratio h/w is very large, when you scale it with textwidth will give you issues. – yannisl Jan 03 '13 at 14:37
  • I just tried removing the angle=180 and still get the same problem. The aspect ratio of both images should be close to 1, as they are both almost square.

    I still however get the problem when I remove these figures. The problem looks to be caused by something else.

    – Trev Jan 03 '13 at 14:49
  • 1
    This is how the bottom of the last page looks. There should be quite a lot more text after this: image – Trev Jan 03 '13 at 14:52
  • @Trev I can't reproduce the problem with the code you posted. Add \usepackage{lipsum} and add some text to see if you can reproduce the problem in the minimal you posted. – yannisl Jan 03 '13 at 15:02
  • The example I posted probably doesn't contain enough text to give the problem. I tried adding the code you suggested to my report .tex file and the problem persists. I get 4 pages of correctly formatted text, and then the 5th page overruns as shown in the previous image. I've never encountered this before. – Trev Jan 03 '13 at 15:08
  • I tried adding more text to my example code, and I can replicate the problem. The text continues past the bottom margin, below the page number, and then off the bottom of the page. \usepackage{lip sum} did not help this either. Also, I can remove the figure and this still happens. – Trev Jan 03 '13 at 15:12
  • I have edited the original post with this new code. Perhaps you can try it and see if you encounter my issue. – Trev Jan 03 '13 at 15:13
  • In my experience LaTeX can't add pagebreaks to text that contains only sectioning commands. Try adding some lipsum between all the sectioning commands. – Martin Schröder Jan 03 '13 at 15:29
  • @MartinSchröder that was it! Simple! I had just added in sections for a structure to my report, I didn't realise this would cause this problem. I just added some words to the sections and the pages broke as expected. Thank's for the help. Sorry if my explanations were confusing! – Trev Jan 03 '13 at 15:33
  • @barbarabeeton: Found it: http://tex.stackexchange.com/a/57861/5763 – Martin Schröder Jan 03 '13 at 15:56

0 Answers0