I use minted in LateX. My code in Python is too big, and one page is too little. I need to split my code for two pages. I know that minted has not auto wrap pages. So I tried this:

    \begin{mdframed}[linecolor=black, topline=true, bottomline=true,
    leftline=false, rightline=false,
    \inputminted[breaklines = true, frame=lines, framesep=2mm,
    baselinestretch=1.2, bgcolor=LightGray, fontsize=\footnotesize, linenos]

But pdflatex gets loop with:

Overfull \vbox ( [This number is changing] is too high ).

I think I need have hand-made split (somethinh like starline=15, endline=40), but I don't know how to make this. I have to read code from file.


1 Answer 1


The bgcolor option for minted is not compatible with page breaks. You should use mdframed to provide a background color instead, since it can break across pages. Depending on what you want, it may be best to make all of the frame lines with mdframed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy