minted
minted copied to clipboard
Option to remove blank lines from the input
It could be convenient to have an option to remove empty/blank lines from the input. At the moment, only removing their numbering is possible.
Thanks in advance.
That could be useful. Unfortunately, it would require a rewrite of some of the fancyvrb
internals, so it probably isn't something I can get to in the near future.
For future reference, the following will remove all empty lines globally. Now this needs to be adapted into an option that can be turned on/off. Also, there may need to be some modifications to take into account lines that consist entirely of whitespace.
\makeatletter
\AtBeginEnvironment{minted}{%
\def\FV@@PreProcessLine{%
\expandafter\ifstrempty\expandafter{\FV@Line}{}{%
\FV@StepLineNo
\FV@Gobble
\expandafter\FV@ProcessLine\expandafter{\FV@Line}}}%
}
\makeatother