TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I saw that several documentation packages use the environment to show macrocode long codes with page break, the example implementation of the package geometry. How do I do this? I wanted to show a code along with page break.

share|improve this question

The listings package provides this by default if you don't allow the code to float. Here's a little example:

enter image description here

\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{listings}% http://ctan.org/pkg/listings
for i:=maxint to 0 do
{ do nothing }
Write(’Case insensitive ’);
WritE(’Pascal keywords.’);
share|improve this answer
\usepackage{minted} \begin[linenos]{minted} bla bla bla \end{minted} – Regis da Silva Oct 2 '12 at 5:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.