I have a listing as follows:
\begin{lstlisting}[basicstyle=\scriptsize]
...
\end{lstlisting}
The listing is quite long (71 lines + caption), and I want it to fit on a single page. However, I currently get 70 lines on one page and the last line and caption appear on the next page. Is it possible to slightly change the font size in order to make the listing fit on one page? So I need some custom size that is slightly smaller than scriptsize. Tiny is too small. Or is there another way to make the listing fit on a single page?
\fontsize{<size>}{<baselineskip>}\selectfont
to use another size. See thefntguide
for more information. But do you really think that anyone would like to read a listing with such a small font size? Personally I'm usually not able to do so without headache and runny eyes.\baselineskip
a bit, or\enlargethispage{2.5\baselineskip}
, which would avoid changing the actual font size. But how this is done does depend on the document class. A small compilable example, beginning with\documentclass
and ending with\end{document}
would give potential helpers something to experiment with.enlargethispage
actually solved the problem already. Thanks!