TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

I'm using the package mcode to show matlab code in my thesis. This package requires the xcolor package so it automatically loads it. My problem is that I have to call the table option in the xcolor package but when I call it after mcode I get an error because it was previously called in mcode. How can I resolve the issue?

share|improve this question
so is mcode loaded by your class ? – David Carlisle Dec 24 '12 at 0:52
You should have a look at the matlab-prettifier package; it improves upon mcode in many ways. See this answer, for instance. – Jubobs Apr 28 '14 at 15:25
up vote 20 down vote accepted



before \documentclass{...} and no need of loading xcolor by yourself.

Or add the option table to document class itself:

share|improve this answer
Yeah tahnks so much...it works...I will accept your ans soon – Mazzy Dec 24 '12 at 0:48

Just use


before loading mcode

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.