9

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?

Vivi
  • 26,953
  • 31
  • 77
  • 79
Mazzy
  • 7,642

2 Answers2

15

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}
12

Just use

 \usepackage[table]{xcolor}

before loading mcode

David Carlisle
  • 757,742