# Belowskip on minted?

Is it possible to remove the spacing below the code of a minted environment? When I have a block of code underneath another it doesn't produce any spacing (which is what I want), but it does for text (which I don't want). Is there somthing similar like belowskip of the listings package that I can use as a global option?

\documentclass{article}

\usepackage{minted}

\begin{document}

\newminted{python3}{linenos=true} % belowskip=0pt?

\begin{python3code}
print("Hello world")
\end{python3code}

Some text

\end{document}

-

minted uses the package fancyvrb to create the environment. fancyvrb uses a modification of trivlist. So you can have to modify the trivlist.

One possibility is shown below. Here I created a new key belowskip.

EDIT

In combination width \newminted it also works (see comment below):

% pdflatex --shell-escape
\documentclass{article}

\usepackage{minted}
\makeatletter
\newlength\minted@belowskip
{\setlength{\minted@belowskip}{#1}}

\def\minted@endparenv{%
\def\FV@EndList{%
\FV@ListProcessLastLine
\FV@EndListFrame
\minted@endparenv
\endgroup
\@endpetrue}
\makeatother
\newminted{python3}{linenos=true, belowskip=4cm}
\begin{document}

\begin{python3code}
print("Hello world")
\end{python3code}

Some text

\begin{python3code}
print("Hello world")
\end{python3code}

Some text

\end{document}


Orig

% pdflatex --shell-escape
\documentclass{article}

\usepackage{minted}
\makeatletter
\newlength\minted@belowskip
{\setlength{\minted@belowskip}{#1}}

\def\minted@endparenv{%
\def\FV@EndList{%
\FV@ListProcessLastLine
\FV@EndListFrame
\minted@endparenv
\endgroup
\@endpetrue}
\makeatother
\begin{document}

\begin{minted}[belowskip=4cm]{python}
print("Hello world")
\end{minted}

Some text

\begin{minted}[belowskip=0pt]{python}
print("Hello world")
\end{minted}

Some text

\end{document}

-
Seems to break if I use it as an option in my environment: \newminted{python3}{linenos=true, belowskip=0pt} \begin{python3code} ...  – pg-robban Dec 4 '11 at 20:28
@pg-robban: It works also with \newmindet. – Marco Daniel Dec 4 '11 at 20:53
Must be a conflict with the other packages I'm using: package calc error 'xkv@tempa@toks' invalid at this point. But the MWE seems to be working so I'll accept this answer. Thank you! – pg-robban Dec 4 '11 at 21:13