Is it possible to remove blank (empty) lines in minted, and gobble multiple blank lines to a specified amount, like the emptylines option in listings?

% I want something like the emptylines option
int i = 0;

int i = 0;

  • Thanks Marco, it seems I have programmed to much C++ today.
    – Juri Robl
    Sep 29, 2012 at 17:55
  • Af far I know you can globbe the star of lines or disable numbering of blank lines (numberblanklines=false) but wihout removing lines.
    – Fran
    Jul 7, 2013 at 22:07

1 Answer 1


The minted package uses fancyvrb behind the scenes. This package doesn't have a build-in facility to skip blank lines. It is possible to add a test to skip blank lines, for example

    \ifx\FV@Line\@empty % Test added here

Dealing with picking particular numbers of blank lines is more tricky: Id be tempted to simply go for listings or edit the code source rather than try to alter this.

Your Answer

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

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