0

I use a bunch of packages. I eventually wanted to use bashful but now I have a clash with xcolor. How should I solve/investigate this?

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[a4paper, total={165mm,250mm}]{geometry}
\usepackage[xparse,skins,breakable]{tcolorbox}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{regexpatch}
\usepackage{realboxes}
\usepackage{textcomp}
\usepackage{xfrac}
\usepackage{tikzpagenodes}
\usepackage{inconsolata}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{tabularx,ragged2e}
\usepackage{zref-savepos}
\usepackage{bashful}

\usetikzlibrary{calc}

\begin{document} Lorem ipsum \end{document}

Here the error:

! LaTeX Error: Option clash for package xcolor.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.9 \usepackage {listings}

nowox
  • 1,375
  • your error is in line 9. You only have to make an educated guess (or look in the log-file) which packages before are loading xcolor. – Ulrike Fischer Jun 06 '22 at 08:51
  • Indeed, the error will follow the include of xcolor. If I move the usepackage, the error is somewhere else. I've also read that xcolor must come before listings. – nowox Jun 06 '22 at 08:52
  • 1
    search the site for option clash xcolor. – Ulrike Fischer Jun 06 '22 at 08:53
  • I did. I found plenty of answers :( – nowox Jun 06 '22 at 08:55
  • 3
    Try loading the [dvipsnames] option as an option of \documentclass. – Bernard Jun 06 '22 at 09:28
  • 5
    xcolor had to be before tcolorbox. – Zarko Jun 06 '22 at 09:29
  • 1
    The error suggests you try to do load xcolor again with different options than other package did. It's very likely dvipsnames was not included before, hence the error. You could probably remove the line with \usepackage[dvipsnames]{xcolor}. However, you would need to follow @Bernard's suggestion to have access to dvipsnames. – Celdor Jun 06 '22 at 10:40
  • 2
    did you try typing h as the message suggests, so that the system tells you which options clash, and suggests a fix? – David Carlisle Jun 06 '22 at 11:37

1 Answers1

1

As @Zarko suggested in the comments, the error disappears (at least for me) if one loads xcolor before tcolorbox. Does this fix your problem? Here is a MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[a4paper, total={165mm,250mm}]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[xparse,skins,breakable]{tcolorbox}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{listings}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{regexpatch}
\usepackage{realboxes}
\usepackage{textcomp}
\usepackage{xfrac}
\usepackage{tikzpagenodes}
\usepackage{inconsolata}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{tabularx,ragged2e}
\usepackage{zref-savepos}
\usepackage{bashful}

\usetikzlibrary{calc}

\begin{document} Lorem ipsum \end{document}

This error probably occurs because tcolorbox loads xcolor with spesific options if it is not loaded before the package.

Here is a similar problem: https://tex.stackexchange.com/a/83102/199568

Vebjorn
  • 1,778
  • 3
    Please elaborate a little more your answer, otherwise is just Zarko's (or Bernard's) comment written as an answer – Luis Turcio Jul 06 '22 at 18:31