I am using the packages listings to depict portions of source code in a tech report. However, I could not find any way of avoiding page breaks inside a listing.
Anyone knows which option avoids page breaks inside listings?
Thank you
Document Classes ⇒ Listings without page breaks?
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: Listings without page breaks?
To my knowledge, there is not such an option. However, you can put the listing inside a minipage. This will avoid page breaks.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Listings without page breaks?
Section 1.4 (Seduce to use, p. 6) of the listings manual describes how to put a caption to a listing and so make it float. Perhaps that helps.
Best regards
Thorsten¹
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10