[Tex/LaTex] Option clash for package xcolor – undetermined problem

color

I have a problem with LaTeX packages. My problem seems to be with xcolor, and very close from this question, but their solution does not work for me.

Unfortunatly, even if I put \usepackage[table,xcdraw]{xcolor} before \usepackage{xcolor} the problem continues…

Is there a simple/magic solution?

Here is the packages I use:

\documentclass[
11pt, % The default document font size, options: 10pt, 11pt, 12pt
%oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
french, % ngerman for German
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
%toctotoc, % Uncomment to add the main table of contents to the table of contents
%parskip, % Uncomment to add space between paragraphs
%nohyperref, % Uncomment to not load the hyperref package
headsepline, % Uncomment to get a line under the header
%chapterinoneline, % Uncomment to place the chapter title next to the number on one line
%consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
table,
]{MastersDoctoralThesis} % The class file specifying the document structure

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{amsmath} % Use the Palatino font by default

\usepackage[table,xcdraw]{xcolor} % pas OK

\usepackage{xcolor} %OK

\usepackage{hyperref}

\usepackage[bottom]{footmisc}

\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)

\addbibresource{example.bib} % The filename of the bibliography

\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography

\usepackage{capt-of}

\usepackage{subfigure}

\usepackage{caption}

\usepackage{float}

\usepackage{graphicx}

\usepackage{amssymb}

\usepackage{amsfonts}

\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\mdfdefinestyle{MyFrame}{%
    linecolor=black,
    outerlinewidth=2pt,
    roundcorner=20pt,
    innertopmargin=\baselineskip,
    innerbottommargin=\baselineskip,
    innerrightmargin=20pt,
    innerleftmargin=20pt,
    backgroundcolor=gray!20!white}

And here is the table I used in one of the chapters (from this website):

% Please add the following required packages to your document preamble:
% \usepackage[table,xcdraw]{xcolor}
% If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer}
\begin{table}[]
\begin{tabular}{|c|
>{\columncolor[HTML]{FFFFFF}}c |
>{\columncolor[HTML]{EFEFEF}}c |
>{\columncolor[HTML]{FFFFFF}}c |
>{\columncolor[HTML]{EFEFEF}}c |
>{\columncolor[HTML]{FFFFFF}}c |
>{\columncolor[HTML]{EFEFEF}}c |
>{\columncolor[HTML]{FFFFFF}}c |}
\hline
Row 1: & \#1   & \#2  & \#3   & \#4   & \#5      & \#6     & \#7     \\ \hline
Row 2: & 12 \% & 1 \% & 15 \% & 25 \% & 18.75 \% & 12.5 \% & 6.25 \% \\ \hline
\end{tabular}
\end{table}

Best Answer

\PassOptionsToPackage{table,xcdraw}{xcolor}
\documentclass{...}

 everything _without_ xcolor

\begin{document}
...
\end{document}

Package tikz (via package framed) already loads xcolor internally

Related Question