Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

listings package: avoid page breaks inside (float) lstlisting environment

3,326 views
Skip to first unread message

ynimous

unread,
Oct 28, 2009, 10:33:27 AM10/28/09
to
Hi,

Assuming the following:

\begin{lstlisting}[float]
...
--- NO PAGE BREAK HERE ---
...
\end{lstlisting}

Is it possible to ensure that the whole listing is in the same page ?

Ulrike Fischer

unread,
Oct 28, 2009, 11:35:32 AM10/28/09
to

Sure. Do nothing. With option float the listing will always be on
one page.


--
Ulrike Fischer

ynimous

unread,
Oct 28, 2009, 12:26:22 PM10/28/09
to

You are correct.

My code didn't looked exactly like the above. The float parameter was
included
in a \lstset command and not in \begin{lstlisting}.

\begin{lstlisting}[float] works as expected.

Thanks!

0 new messages