TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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
@texenthusiast it is ok if i define shortcuts in my class file? As i said, i want to define the default formats for minted so i will not make the same settings for each code listing... i am a beginner and i want to learn, i need to understand how things are working so if you can give me some commands so i can document it will help me a lot. – Starlays Mar 15 '13 at 13:40

I solved the problem by using shortcuts.

I have done like so in my .cls file:

%php syntax highlight
samepage=false, %with this setting you can force the list to appear on the same page
showtabs =false,

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

 $foo = 'bar';

 class foobar
     //some var that can be accesed from outside
     protected $bar = 'foo';

     public function getvarvalue() {
         return $bar;
     \caption{Example of a listing.}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.