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
?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{minted}
\usepackage{listings}
% I want something like the emptylines option
\lstset{language=[Visual]{C++},emptylines=1}
\begin{document}
\begin{minted}[frame=single]{cpp}
int i = 0;
i++;
\end{minted}
\begin{lstlisting}
int i = 0;
i++;
\end{lstlisting}
\end{document}
Best Answer
The
minted
package usesfancyvrb
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 exampleDealing 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.