4

I'm trying to do a minted \newenvironment I looked at this post new-environment-with-minted, but I would like to know if there's a more simple way to do that, like

\newenvironment{matlabcode}
        {\begin{minted}[mathescape,linenos=true]{matlab}}
        {\end{minted}}

In that case, I get a FancyVerbGetLine error As I know, it seems that I should use \CustonVerbatimEnvironment

5

Simply use the \newminted command as introduced in Section 6 of the »minted« manual.

\newminted{matlab}{mathescape,linenos=true}

You can use it in the same way as every other environment.

\begin{matlabcode}
% listing content
\end{matlabcode}

Note that the package will append code to the environment name by default as described in the manual.

| improve this answer | |
  • Oh, thanks a lot! I usually I get lost in the manuals with so much information. I'll take a look to that sections :) – PerroNoob Oct 16 '13 at 18:26
4
\newminted{matlabcode}{mathescape,linenos}

\begin{matlabcode}
...
\end{matlabcode}
| improve this answer | |

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.