# Set my own minted default options inside a class

Is there a way that I can set minted options inside a class? I want to set my own defaults format for minted inside a custom class that I have.

-
Welcome to TeX.sx! –  texenthusiast Mar 15 '13 at 8:09
Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. –  Claudio Fiandrino Mar 15 '13 at 8:23
@texenthusiast- How can i set all the options that are in minted documentation using fancyvrb? I want to set minted parameters like: gobble, funcnamehighlighting, label, labelposition etc. Can i set this options trought fancyvrb inside a custom made class? –  Starlays Mar 15 '13 at 8:26
@Starlays minted is based on fancyvrb, fancyvrb options are controlled by \fvset{..} and minted options via Defining shortcuts using \newminted{..}{..}. –  texenthusiast Mar 15 '13 at 8:54

I solved the problem by using shortcuts.

I have done like so in my .cls file:

...
%php syntax highlight
\RequirePackage[chapter]{minted}
\definecolor{mintedbackground}{rgb}{0.95,0.95,0.95}
\newmint{php}{
bgcolor=mintedbackground,
fontfamily=tt,
linenos=true,
numberblanklines=true,
numbersep=12pt,
numbersep=5pt,
gobble=0,
frame=leftline,
framerule=0.4pt,
framesep=2mm,
funcnamehighlighting=true,
tabsize=4,
obeytabs=false,
mathescape=false
samepage=false, %with this setting you can force the list to appear on the same page
showspaces=false,
showtabs =false,
texcl=false,
}
...


And in my .tex document i have done like this:

....
\begin{document}
\begin{listing}[H]
\begin{phplisting}
<?php
$foo = 'bar'; class foobar { //some var that can be accesed from outside protected$bar = 'foo';

public function getvarvalue() {
return \$bar;
}
}
\end{phplisting}
\caption{Example of a listing.}
%\label{lst:example}
\end{listing}
\end{document}

-