
Sind die „Standard“ tikz
-Schaltkreisbibliotheken und circuitikz
inkompatibel?
Betrachten Sie die folgenden MWE:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}\pgfplotsset{compat=1.9}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{positioning, shapes, fadings, calc,
% circuits, circuits.ee.IEC
}
\begin{document}
%Standard libraries battery:
%
%\begin{tikzpicture}[baseline, huge circuit symbols, circuit ee IEC,
% elec/.style={circle, inner sep=2pt, draw=blue, fill=blue},
% ]
% \node (E) [battery, info=135:$E$] at (0,3.4) {};
% \end{tikzpicture}
tikz circuit:
\begin{circuitikz}[
american,
]
\draw (0,0) to[R] (0,2);
\end{circuitikz}
\end{document}
Die Ausgabe ist wie erwartet:
aber wenn ich die kommentierten Teile entferne, habe ich:
...und wenn ich beispielsweise Beschriftungen hinzufüge, treten häufig Fehler in einer der beiden Umgebungen auf. Gibt es eine Möglichkeit, beide Schaltungsfunktionen im selben Dokument zu verwenden, oder ich muss einfach eine auswählen?
Danke!
Antwort1
Eigentlich könnte man diesen Trick verwenden, um jede Tikz-Bibliothek vorübergehend zu laden.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}\pgfplotsset{compat=1.9}
\usepackage[siunitx]{circuitikz}
\begin{document}
circuit ee IEC
\bgroup% local definitions
\usetikzlibrary{circuits.ee.IEC}
\begin{circuitikz}[circuit ee IEC]
\node (E) [battery, info=135:$E$] at (0,3.4) {};
\end{circuitikz}
\egroup
circuitikz components
\begin{tikzpicture}[american]
\draw (0,0) to[R] (0,2);
\end{tikzpicture}
\end{document}