5

I'm trying to print the keys of my calculators in a TeX document, thanks to these packages :

Here is a MWE :

\documentclass[a4paper,12pt]{report}

\usepackage[color=real]{graph35} % Casio calculator \usepackage{tipfr} % TIcalculator \begin{document}

On a Casio calculator, type \key[scale=2]{sin} ; On a TI calculator, type \Touche .

\end{document}

I get an error saying : ! LaTeX Error: Option clash for package xcolor. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.9 \RequirePackage [zerostyle=d]{newtxtt} The package xcolor has already been loaded with options: [] There has now been an attempt to load it with options [dvipsnames,table] Adding the global options: ,dvipsnames,table to your \documentclass declaration may fix this.

But even if I put ,dvipsnames,table in my documentclass declaration, there is still an error. Does anyone would know how to prevent that clash between these two packages ?

Thanks for helping !

Alex
  • 61

2 Answers2

6

Just swap the order so the package using xcolor options is first

enter image description here

\documentclass[a4paper,12pt]{report}

\usepackage{tipfr} % TIcalculator \usepackage[color=real]{graph35} % Casio calculator

\begin{document}

On a Casio calculator, type \key[scale=2]{sin} ; On a TI calculator, type \Touche .

\end{document}

David Carlisle
  • 757,742
5

The tipfr package has

\RequirePackage[dvipsnames,table]{xcolor}

while graph35 has

\RequirePackage{tikz}

which loads xcolor without options.

Thus the order of the packages has to be reversed. If you need to pass further options to xcolor, load it with the options you need first, including dvipsnames and table.

\documentclass[a4paper,12pt]{report}

% uncomment the following if you need more options to xcolor %\usepackage[dvipsnames,table,<other options>]{xcolor}

\usepackage{tipfr} % TIcalculator \usepackage[color=real]{graph35} % Casio calculator

\begin{document}

On a Casio calculator, type \key[scale=2]{sin} ; On a TI calculator, type \Touche .

\end{document}

For instance, you may want to use monochrome for printing on a black-and-white printer:

\documentclass[a4paper,12pt]{report}

\usepackage[dvipsnames,table,monochrome]{xcolor}

\usepackage{tipfr} % TIcalculator \usepackage[color=real]{graph35} % Casio calculator

\begin{document}

On a Casio calculator, type \key[scale=2]{sin} ; On a TI calculator, type \Touche .

\end{document}

egreg
  • 1,121,712
  • Thanks it works ! In order to be more independant next time, where can I find the rules to load packages in the right order ? – Alex Dec 15 '22 at 18:36
  • @Alex there are no rules, it is mostly trial and error... see also https://tex.stackexchange.com/questions/635725/is-there-a-way-to-find-out-the-correct-order-to-load-packages and https://tex.stackexchange.com/questions/3090/packages-that-need-to-be-included-in-a-specific-order. – Marijn Dec 15 '22 at 21:05