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 currently have two minted environments in each their minipage environment, so that they can be situated next to each other:


  from pycsp_import import *

  def producer(cout):
    for i in [1,2,3,4,5]:

  def worker(cin):
    while True:
      print cin()

  c = Channel()






Is there a way to get rid of the need of the .. Can I somehow tell minted that there should be 19 lines, so that the two python environments are the same height?

share|improve this question
up vote 2 down vote accepted

If you want to do this you have to change the compilation by pygmentize. The required option is stripnl. For more details see: Available lexers

To set the option to the run you have to change the internal definition:

  \def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge
    \minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape}
    \minted@opt{startinline} \minted@opt{funcnamehighlighting}
    \minted@opt{linenos} -P "verboptions=\minted@opt{extra}"
    -O stripnl=false -o \jobname.out.pyg #1}
  % For debugging, uncomment:

However this influence all compilation by pygmentize. To avoid this you can declare a new option.

enter image description here

share|improve this answer
you are a god amongst men! It works just as expected. – Mads Ohm Larsen Apr 30 '12 at 20:22

If you used


they would line up on the first line even if different sizes/

share|improve this answer

Minted 2.1 has a stripnl option, you can set to false:

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.