I want to create a new environment to transform this:
\begin{listing}
\caption{some caption}
\label{code:label}
\begin{minted}[options]{language}
My code here
\end{minted}
\end{listing}
into this:
\begin{mycode}{language}{some caption}{code:label}
My code here
\end{mycode}
I've tried the code from Using minted to define a new environment without success.
edit
This is what I've tried:
\newenvironment{mycode}[3]{%
\VerbatimEnvironment
\minted@resetoptions
\setkeys{minted@opt}{linenos,fontfamily=courier, fontsize=\scriptsize, xleftmargin=21pt}
\begin{listing}
\caption{#2}
\label{#3}
% \centering
\begin{VerbatimOut}{\jobname.pyg}}
{%
\end{VerbatimOut}
\minted@pygmentize{#1}
\DeleteFile{\jobname.pyg}
\end{listing}}



figurebylistingand remove the\centering. Thanks @Hebert. I didn't knew\makeatletterand\makeatother, but now I do. The\minted@proglangthing I can't get yet. – Hugo Maia Vieira Jan 27 '12 at 02:26\floatstyle{ruled}at minted.sty. Exist an elegant way to do that? – Hugo Maia Vieira Jan 27 '12 at 02:55floatrowhow floating objects can be configured – Jan 27 '12 at 08:05