Page Layoutusing verbatim makes text run off the bottom of page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
hitchhiker42
Posts: 1
Joined: Sat Jun 04, 2011 4:57 pm

using verbatim makes text run off the bottom of page

Post by hitchhiker42 »

Hi,

I am having trouble with text running off the bottom of the page in my .tex file. I am trying to include a Java program that I wrote, and when I use pdflatex, the program listing runs off the end of the page. I am using:

Code: Select all

\begin{verbatim}
java program goes here
...
end of java program
\end{verbatim}
My program is about 4 pages long, but with pdflatex it simply runs off the end of one page. Then the next chapter begins. Has anyone else encountered this? I have the margins set with the graphics package, but for some reason they are being ignored when I use {verbatim}

here are the settings at the beginning of my document:

Code: Select all

\documentclass[letter]{report}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{letterpaper}
\geometry{height=9in}
\geometry{includefoot}
\graphicspath{{./images/}}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\raggedbottom

\begin{document}
...
Thanks for any help you guys can provide!
Last edited by Stefan Kottwitz on Sat Jun 04, 2011 6:09 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.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

using verbatim makes text run off the bottom of page

Post by Stefan Kottwitz »

Hi,

welcome to the board!

I recommend to use the listings package instead of a verbatim environment.

Stefan
LaTeX.org admin
Post Reply