Generallistings | Displayed Code not wrapped to next Page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
hvn
Posts: 13
Joined: Thu Feb 03, 2011 9:40 pm

listings | Displayed Code not wrapped to next Page

Post by hvn »

Hi,

I'm including C++ code using the listings package and one file is longer than one page. Usually no problem, except that here the last part of the code is not shown on the next page. It just disappears at the end of the page. How can I solve this? Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

listings | Displayed Code not wrapped to next Page

Post by cgnieder »

Please provide a Infominimal working example. Otherwise it is impossible to give an answer. Thanks.

Regards
site moderator & package author
hvn
Posts: 13
Joined: Thu Feb 03, 2011 9:40 pm

listings | Displayed Code not wrapped to next Page

Post by hvn »

Code: Select all

\usepackage[framed]{mcode}
\begin{document}
\begin{figure}[!ht]
\begin{lstlisting}
<long text>
\end{lstlisting}
\caption{main.cpp}
\label{main}
\end{figure}
All code is placed between the lstlisting. In 1 occasion it exceeds the page, but instead of continuing on the next, it just drops off the bottom.
Last edited by Stefan Kottwitz on Mon Jul 30, 2012 7:45 am, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

listings | Displayed Code not wrapped to next Page

Post by localghost »

This is not a minimal example, only a loosely code snippet. Please follow the link that Clemens has given you and obey exactly the instructions for building a proper example.


Thorsten
Post Reply