我必须使用一种使用catoptions
包的格式;当我将它与我一起使用时,tikzcircuit
我有一个(我认为基本上无害,但在 IDE 中很烦人)警告---
\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}
输出(摘录):
...
(/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
...
是否有可能消除警告?
答案1
使用silence
包;要么处于“残酷”模式(抑制来自的所有警告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}
或者,选择性地,
\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}
答案2
请尝试以下操作:
\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}
这是对我的工作。
编辑:xcolor
不幸的是,用于的 包技巧circuitikz
不起作用(因为它被加载了两次)。因此,您现在有以下选择:
- 联系贵公司的文档类作者并请他改进它。例如,测试是否存在软件包或选项,应该加载哪些软件包或简单地将 circuitikz 添加到已加载软件包列表中(至少作为选项)。
- 使用独立包绘制图像,并将其作为 (pdf) 图形包含在文档中
\includegraphics{your image}
。看来这是解决问题的最简单方法。