Take the 2-minute tour ×
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.

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
4  
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 at 15:25
add comment

2 Answers

up vote 17 down vote accepted

Add

\PassOptionsToPackage{table}{xcolor}

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

Or add the option table to document class itself:

\documentclass[table]{article}
share|improve this answer
    
Yeah tahnks so much...it works...I will accept your ans soon –  Mazzy Dec 24 '12 at 0:48
add comment

Just use

 \usepackage[table]{xcolor}

before loading mcode

share|improve this answer
add comment

Your Answer

 
discard

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.