[Tex/LaTex] error: option clash for package xcolor

colorerrors

When trying to load I get the error message 'Option clash for package xcolor'. I have already understood that this is because other packages I loaded before also automatically load this package. All I need to know is which package does this, such that I can put the 'xcolor' option in the command. My preamable is below.

\documentclass[a4paper,12pt]{report}
\usepackage{graphicx}
\usepackage[backend=biber, natbib=true, style=authoryear]{biblatex}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{smartdiagram}
\usepackage{amsfonts}
\usepackage[table,xcdraw]{xcolor}
\usepackage{float}
\smartdiagramset{circular distance=4cm,
font=\normalsize,
text width=2.5cm,
arrow line width=0.2cm
}
\newsavebox{\mybox}
\savebox{\mybox}{%
\smartdiagram[circular diagram]{Insured \\ policy holder,Insurer \\ company}
}

Best Answer

Finding out which package loads what is often a daunting task. Instead pass the options before document class. If there is still an option clash then you cannot use that option together with the other package loading. Also smartdiagram -> tikz -> {graphicx,xcolor}.

\PassOptionsToPackage{table,xcdraw}{xcolor}
\documentclass[a4paper,12pt]{report}
\usepackage[backend=biber, natbib=true, style=authoryear]{biblatex}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath,amsfonts}
\usepackage{smartdiagram}
\usepackage{float}

\smartdiagramset{circular distance=4cm,
font=\normalsize,
text width=2.5cm,
arrow line width=0.2cm
}
\newsavebox{\mybox}
\savebox{\mybox}{%
\smartdiagram[circular diagram]{Insured \\ policy holder,Insurer \\ company}
}
\begin{document}
.
\end{document}