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'm having trouble using the facyvrb package. I have the following code:

\section{My section}

...lots of code...

However, pdflatex constructs a whole page just containing the subsection header, the rest of the page empty, and then, on the next page starts the verbatim section. How can I tell the Verbatim part to be exactly under the subsection, something like the [H] command with floats on figures?

share|improve this question
@Timo --- Please edit your question and add a complete example code that reproduces the problem you describe. – Ian Thompson Jun 22 '12 at 13:00
that is not possible with the package fancyvrb which you already load, it can have page breaks. Only the BVerbatim environment is put in a box (note the preceding B). As Ian wrote, give more informations ... – Herbert Jun 22 '12 at 13:03
listings is based on fancyvrb ... – Herbert Jun 22 '12 at 13:07
Does this happen always or only when the subsection title falls near the end of a page? – egreg Jun 22 '12 at 13:36

I can't see any problem.


\section{My section}
Verbatim line.

...lots of code...


enter image description here

share|improve this answer

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.