Can anyone see from the following LaTeX fragment why the page got formatted the way it can be seen in the picture below? For some reason everything got centered vertically across the whole page.
\section{Another way to double-space a file}
\begin{lstlisting}
awk 'BEGIN { ORS="\n\n" }; 1'
\end{lstlisting}
\bb{BEGIN} is a special kind of pattern which is not tested against the input.
It is executed before any input is read. This one-liner double-spaces the file
by setting the \bb{ORS} variable to two newlines. As I mentioned previously,
statement "\bb1" gets translated to "\bb{\{ print \}}", and every print statement
gets terminated with the value of \bb{ORS} variable.
\pagebreak
I am doing anything fancy and my document declaration looks like this:
\usepackage{amsmath} %Never write a paper without using amsmath for its many new commands
\usepackage{amssymb} %Some extra symbols
\usepackage{makeidx} %If you want to generate an index, automatically
\usepackage{graphicx} %If you want to include postscript graphics
\usepackage{listings}
\usepackage{xcolor}
\usepackage{textcomp}
\begin{document}
\newcommand{\bb}[1]{\textbf{#1}}
\definecolor{codebg}{HTML}{EEEEEE}
\definecolor{codeframe}{HTML}{CCCCCC}
\lstset{language=Awk}
\lstset{backgroundcolor=\color{codebg}}
\lstset{frame=single}
\lstset{framesep=10pt}
\lstset{rulecolor=\color{codeframe}}
\lstset{upquote=true}
\lstset{emph={awk}, emphstyle=\textbf}

\pagebreaksolves it. Also take a look at this. – doncherry Apr 30 '11 at 10:20