Option clash for package xcolor

  • Creatore
    Topic
  • #45587
    samiel
    Partecipante
      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?

      Grazie mille
      M.

    Visualizzazione 5 filoni di risposte
    • Autore
      Risposte
      • #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

      • #45589
        samiel
        Partecipante
          Up
          0
          Down
          ::


          A questo punto però, una volta fatta l’inversione (avevo già provato
          una serie di spostamenti) ottengo:
          `(/usr/share/texmf-texlive/tex/latex/comment/comment.sty
          Excluding comment 'comment')
          (/usr/share/texmf-texlive/tex/latex/ltxmisc/framed.sty)
          (/usr/share/texmf-texlive/tex/latex/base/makeidx.sty)
          (/usr/share/texmf-texlive/tex/latex/fancyhdr/fancyhdr.sty

          ! LaTeX Error: Command \chead already defined.
          Or name \end… illegal, see p.192 of the manual.

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

          l.270 …chead}{\@ifnextchar[{\@xchead}{\@ychead}}`
          e la compilazione di blocca di nuovo…
          M.

        • #45590
          Up
          0
          Down
          ::

          A questo punto però, una volta fatta l’inversione (avevo già provato
          una serie di spostamenti) ottengo:
          `(/usr/share/texmf-texlive/tex/latex/comment/comment.sty
          Excluding comment 'comment')
          (/usr/share/texmf-texlive/tex/latex/ltxmisc/framed.sty)
          (/usr/share/texmf-texlive/tex/latex/base/makeidx.sty)
          (/usr/share/texmf-texlive/tex/latex/fancyhdr/fancyhdr.sty

          ! LaTeX Error: Command \chead already defined.
          Or name \end… illegal, see p.192 of the manual.

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

          l.270 …chead}{\@ifnextchar[{\@xchead}{\@ychead}}`
          e la compilazione di blocca di nuovo…
          M.

          Non ha senso caricare fancyhdr insieme a classicthesis (e nemmeno tocloft): per agire sull’indice devi usare i metodi descritti nel manuale di KoMa-script.

          Ciao
          Enrico

        • #45591
          samiel
          Partecipante
            Up
            0
            Down
            ::


            Già. In effetti era illogico.
            Un’ultimo dettaglio, tanto per non lasciare niente di oscuro.
            Avendo io usato:
            `\section{Lorem ipsum dolor sit amet, \\ consectetuer adipiscing elit}`
            in che considerazione devo tenere l’avviso:
            `Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
            (hyperref) removing `\\' on input line 25.`
            che ricevo in fase di compilazione?

            Grazie
            M.

          • #45592
            Up
            0
            Down
            ::

            Già. In effetti era illogico.
            Un’ultimo dettaglio, tanto per non lasciare niente di oscuro.
            Avendo io usato:
            `\section{Lorem ipsum dolor sit amet, \\ consectetuer adipiscing elit}`
            in che w devo tenere l’avviso:
            `Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
            (hyperref) removing `\\' on input line 25.`
            che ricevo in fase di compilazione?

            Usa \texorpdfstring{\\}{ }; ma prima assicurati che il titolo della sezione non possa proprio essere abbreviato.

            Ciao
            Enrico

          • #45593
            samiel
            Partecipante
              Up
              0
              Down
              ::


              Credevo che si usasse solo in caso di simboli matematici
              nel titolo. Buono a sapersi!

              Grazie mille
              M.

          Visualizzazione 5 filoni di risposte
          • Devi essere connesso per rispondere a questo topic.

          Go to top