5

I have to use a format that uses catoptions package; when I use it in conjunction with tikzcircuit I have a (mostly harmless, I think, but annoying in IDEs) warning ---

\documentclass[border=10pt, 12pt]{standalone}% adequate for simple figures
\usepackage{catoptions}
 %% the above packages is loaded in the class format --- suppose I can edit only
 %% below here (or use some class option, obviously). Baically, I have
 %% \documentclass{mycompanyclass}
 %% ...and the package catoptions is loaded before I can load any other package 
\usepackage[siunitx]{circuitikz}% Loading circuitikz with siunitx option
\usetikzlibrary{arrows}
\begin{document}
\null
\end{document}

which outputs (excerpt):

...
(/usr/share/texmf/tex/generic/pgf/libraries/pgflibraryarrows.code.tex)

Package catoptions Warning: Option 'europeanvoltages' multiply defined
(catoptions)                in family 'circuitikz.sty'
(catoptions)                (in package 'circuitikz').


Package catoptions Warning: Option 'europeanvoltage' multiply defined
(catoptions)                in family 'circuitikz.sty'
(catoptions)                (in package 'circuitikz').


Package catoptions Warning: Option 'europeanport' multiply defined
(catoptions)                in family 'circuitikz.sty'
(catoptions)                (in package 'circuitikz').

(/usr/share/texlive/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex
...

Is it possible to get rid of the warning?

  • 1
    load \usepackage{catoptions} after ciruitikz. – Zarko Oct 16 '15 at 11:11
  • @Zarko thanks, but I can't. The catoptions package is loaded in the format... I made myself clearer in the question. – Rmano Oct 16 '15 at 11:30
  • I don't understand what you mean "in format". Does it place in preamble influence on some its other function? Changing circuitikz is not good idea, what you will do at its upgrade? – Zarko Oct 16 '15 at 11:40
  • I have to use a "company" format (an ad-hoc class .cls) which loads catoptions, and that I can't modify to load circuittikz before... – Rmano Oct 16 '15 at 12:19
5

Use the silence package; either in "brutal" mode (suppressing all warnings from catoptions):

\documentclass[border=10pt, 12pt]{standalone}
\usepackage{catoptions}

% before loading circuitikz
\usepackage{silence}
\WarningsOff[catoptions]
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{arrows}

\begin{document}
\null
\end{document}

Or, selectively,

\documentclass[border=10pt, 12pt]{standalone}
\usepackage{catoptions}

% before loading circuitikz
\usepackage{silence}
\WarningFilter{catoptions}{Option}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{arrows}

\begin{document}
\null
\end{document}
  • 3
    Interesting solution! I wasn't aware of this package. – Zarko Oct 16 '15 at 14:41
  • Ok, that's the proof, you're a genius. Thanks! – Rmano Oct 16 '15 at 16:50
1

Try the following:

\RequirePackage[siunitx]{circuitikz}%Loading circuitikz with siunitx option
\documentclass[border=10pt, 12pt]{standalone}% adequate for simple figures
\usepackage{catoptions}
 %% the above packages is loaded in the class format ... Basically, I have
 %% \documentclass{mycompanyclass} and the package catoptions 
 %% is loaded before I can load any other package
\usetikzlibrary{arrows}
\begin{document}
\null
\end{document}

Its work for me.

Edit: Unfortunately for package xcolor trick used for circuitikz doesn't work (because it is than loaded twice). So you have now the following options:

  • contact your company document-class author and ask him to improve it. For example with tests if packages exist or with options, which packages it should load or simple add circuitikz in the list of of loaded packages (as least as option).
  • Draw your image with standalone package and include it in your document as (pdf) figure with \includegraphics{your image}. It seems that this is the simplest way to solve your problem.
  • This is a good idea. Unfortunately in my case it does not work (I have a option clash for package xcolor in mycomapnyclass.cls error). I didn't know you can load packages before the documentclass --- thanks! – Rmano Oct 16 '15 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.