Re: Option clash for package xcolor

#45588
Up
0
Down
::

Ho un file .sty con questo codice:

`
\documentclass[a4paper,titlepage]{scrbook}
\usepackage[utf8x]{inputenc}
\usepackage[english,italian]{babel}
\usepackage[OT2,T1]{fontenc} % OT2 per il cirillico
\usepackage{textcomp}
\usepackage{classicthesis-ldpkg}
\usepackage[linedheaders,pdfspacing,eulerchapternumbers,subfig,%
beramono,eulermath]{classicthesis}
\usepackage[table,dvipsnames]{xcolor}
\usepackage{multirow}
\usepackage{url}
\usepackage{colortbl}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{enumitem}
\newlist{myenum}{enumerate}{4}
\setlist[myenum]{label*=\emph{\alph*})}
\usepackage{calc}
\usepackage{booktabs} % serve per toprule, midrule e bottomrule
\usepackage{alltt}
\usepackage{upquote}
\usepackage{textcomp}
\usepackage{comment}
\usepackage{framed}
\usepackage{makeidx}
\definecolor{mycyan}{rgb}{0.99,1,1}
\definecolor{shadecolor}{rgb}{0.99,1,1}
\usepackage{listings}
\lstset{basicstyle=\small\ttfamily,
keywordstyle=\color{blue}\bfseries,
commentstyle=\color{blue},
stringstyle=\color{blue},
backgroundcolor=\color{mycyan},
moredelim=[is][\color{black}\textrm]{|*}{*|}}
\newlist{mytext*}{description}{1}
\setlist[mytext*]{noitemsep,style=sameline,font=\normalfont}
\setlist[mytext*]{itemsep=0.1cm,style=sameline,font=\normalfont}
\newenvironment{mytext}[1]
{\begin{mytext*}[leftmargin=\widthof{#1\hspace{4cm}}]}
{\end{mytext*}}
\makeindex
\definecolor{mybrown}{named}{Bittersweet}
\usepackage{hyperref}
\hypersetup{pdfborder=0,colorlinks,citecolor=black,filecolor=black,%
linkcolor=blue,linktocpage,urlcolor=mybrown,hyperindex}

% link cliccabili
\newcommand{\mail}[1]{\href{mailto:#1}{\textsf{#1}}}
\newcommand{\URL}[1]{\href{#1}{\textsf{#1}}}

% separare la numerazione dal titolo dei paragrafi in Indice
\usepackage{tocloft}
\settowidth{\cftsecnumwidth}{00.00\enspace}
\settowidth{\cftsubsecnumwidth}{00.00.00\enspace}

% intestazioni
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{\textbf{\thechapter. #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\textbf{\thesection. #1}}}
\renewcommand{\headrulewidth}{0.5pt}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}

\begingroup
\catcode`\'=\active
\gdef\doquotesingle{\let'\textquotesingle}
\endgroup
\newenvironment{code}
{\def\b{\textbackslash}%\small
\begin{shaded}\begin{alltt}%
\doquotesingle \let~\textasciitilde
\setlength{\parindent}{0pt}\ignorespaces}
{\end{alltt}\end{shaded}}

% cirillico
\newlanguage\fakelanguage
\newcommand\cyr{\fontencoding{OT2}\fontfamily{wncyr}\selectfont
\language\fakelanguage}
\DeclareTextFontCommand{\textcyr}{\cyr}
`

Alla compilazione però ricevo l’avviso:

`! LaTeX Error: Option clash for package xcolor.

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

l.22 \usepackage
{multirow}
? H
The package xcolor has already been loaded with options:
[dvipsnames]
There has now been an attempt to load it with options
[table,dvipsnames]
`

e la compilazione si blocca. Come faccio a identificare il pacchetto
che carica xcolor? O l’errore può essere dovuto ad altra causa?

Te lo dice il messaggio: uno dei pacchetti precedenti. Siccome ci sono solo quelli di classicthesis che possono dare il problema, la soluzione è caricare xcolor subito dopo textcomp

Ciao
Enrico

Go to top