1

I have simple document:

\subsubsection{Dodanie testu}
\begin{lstlisting}[caption={ComplexTest},label={lst:complex-test}]
    public class ComplexTest{

        public testComplexAddition(){
            Complex a = new Complex(1,2);
            Complex b = new Complex(3,4);           
    }
\end{lstlisting}    
Some text   
\subsubsection{Uruchomienie testów}
Some text  
\subsubsection{Napisanie kodu}
Some text

with these settings for my listings:

\lstset{
language=Java,
captionpos=t,
tabsize=3,
frame=none,
keywordstyle=\color{blue},
commentstyle=\color{darkgreen},
stringstyle=\color{red},
numbers=left,
numbersep=-8pt,
showstringspaces=false,
basicstyle={\small\ttfamily}
}

my output looks like for first page: First page

for second page:

Second page

but when I put \pagebreak just before \begin{lstlisting} to have it on the next page I have got strange vertical spaces between subsubsections and texts. There is the output:

Failure spaces

PS. The same occours when I put additional lines of code to my listing and Latex implicit breaks line and put these lines on next page.

klimat
  • 111

0 Answers0