General ⇒ listings | Displayed Code not wrapped to next Page
listings | Displayed Code not wrapped to next Page
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.
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
listings | Displayed Code not wrapped to next Page

Regards
listings | Displayed Code not wrapped to next Page
Code: Select all
\usepackage[framed]{mcode}
\begin{document}
\begin{figure}[!ht]
\begin{lstlisting}
<long text>
\end{lstlisting}
\caption{main.cpp}
\label{main}
\end{figure}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
listings | Displayed Code not wrapped to next Page
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10