LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   LaTeX: don't want to *force* page break, just make the text respect the footer (https://www.linuxquestions.org/questions/programming-9/latex-dont-want-to-%2Aforce%2A-page-break-just-make-the-text-respect-the-footer-743576/)

titanium_geek 07-29-2009 12:10 AM

LaTeX: don't want to *force* page break, just make the text respect the footer
 
Ok. So, here is a screenshot of what is happening:

http://www.flickr.com/photos/32343725@N00/3767441785/

As you can see the text is floating past the page number "2".

This is the code:

Code:

\documentclass[a4paper,12pt]{article}

\usepackage{array}
\usepackage[pdftex]{graphicx}
\usepackage{cite}
\usepackage{multirow}

\setlength{\hsize}{16cm}
\setlength{\textwidth}{\hsize}
\setlength{\vsize}{22cm}
\setlength{\textheight}{\vsize}
\setlength{\parskip}{5mm}
\setlength{\parindent}{0cm}
\setlength{\hoffset}{-2cm}
\setlength{\voffset}{-1cm}

\title{\rule{0.6\linewidth}{1pt}
\ \\
Computer Systems 2 \\
Journal\\
\\
\rule[3mm]{0.6\linewidth}{1pt}
}

\author{Student
%your name here
\vspace*{15ex}
}

\begin{document}

\maketitle
%\thispagestyle{empty}

\begin{verbatim}
<snip>
\end{verbatim}



\newpage
\thispagestyle{plain}
\section{Tutorial One}
%you might want to add some thoughts here.
%Adding the date of your tutorial might be helpful also.

\section{Practical One}
%Add the date of your prac here.


\subsection{Understanding Python}
%Section 7.1 on Prac 1


\subsection{Knowing FTP and SVN}
%Section 7.2 on Prac 1

\subsection{Understanding the Mutual Update Problem}
%Section 7.3  on Prac 1

%%%%%%
<snip> (just multiple \section stuff)

%%%%%%%
\section{Final Thoughts}

%%%%%%%

\end{document}

I don't want to force a \pagebreak because eventually each heading will have text filled into it and that will mess with the formatting. (Right?) Trying to Google this just turns up results for \pagebreak and I don't know what else to google.

I'm using TeXshop on MacOSX.

Please tell me if you think I should just leave the formatting alone and fix it when the document is finished. This is sucky though because I was hoping to share the document as a template.

Thanks!

titanium_geek

Matz 07-29-2009 06:36 AM

I guess this problem will get fixed once the text inside sections and subsections is inserted. LaTeX cannot places the titles properly because there so many floating objects (titles) and so little text. That is my diagnosis. Hope it helps

Simon Bridge 07-29-2009 08:30 AM

Your title gets error
Code:

! LaTeX Error: There's no line here to end.
using: LaTeX2e <2005/12/01>

Better:
Code:

\title{\rule{0.6\linewidth}{1pt}\\
\vspace*{2ex}
Computer Systems 2 \\
Journal\\
\vspace*{2ex}
\rule[3mm]{0.6\linewidth}{1pt}
}

However - it is doubtful that this is the cause of your output anomaly.
Even with the error, pdf output I get from your file does not show the page overrun that you see.

For me - "final thoughts" is half-way down page 2 ... the footer should be at the bottom. It is not clear from your picture how the page is filled up. However, when fill the sections with lorem ipsum to bulk it out, or even just vertical space, the page size is honored.

This means that the trouble is either in your viewer or TeXshop.
Unless you've been playing around with custom page styles?

titanium_geek 07-30-2009 04:17 AM

Thanks Simon! Title Error fixed.

There are a total of 13 sections, I snipped from the code for readability.

No custom pagestyles.

Matz, your diagnosis looks like the correct one- copy-pasting various size lorem-ipsum text under each section and bingo, no evil page footer violations.

Thanks, both!

titanium_geek


All times are GMT -5. The time now is 02:02 PM.