This is my standard environment for tikzpicture:
\documentclass{standalone}
\usepackage{pgf,tikz}
\usetikzlibrary{mindmap,shadows,positioning,fit,petri,backgrounds,shapes,arrows,through,calc,decorations.text,decorations.markings,intersections,fpu,circuits.ee.IEC,babel}
%Einstellungen von siunitx nach pgf übertragen
\SendSettingsToPgf
%%package ciruitikz is based on TikZ
\usepackage[straightvoltages,%uses arrows to define voltages, and and uses straight voltage arrows
european,%equivalent to europeancurrents, europeanvoltages, europeanresistors, europeaninductors, europeanports, europeangfsurgearrester
emptydiode,%the various diodes are drawn but not filled by default, i.e. when using styles such as D, sD, …Other diode styles can always be forced with e.g. Do, D-, …
RPvoltages,%(meaning Rising Potential voltages): the arrow is in direction of rising potential, like in oldvoltagedirection, but batteries and current sources are fixed to follow the passive/active standard
betterproportions,%nicer proportions of transistors in comparision to resistors;
compatibility%makes it possibile to load CircuiTikZ and TikZ circuit library together
]{circuitikz}
\tikzset{circuit declare annotation={HorizontalAnnotation}{0pt}{edge[to path={[-]
($(-0.5,-0.5\tikzcircuitssizeunit)+(0,-0.5\pgflinewidth)$) --
($( 0.5,-0.5\tikzcircuitssizeunit)+(0,-0.5\pgflinewidth)$)}] ()}
}
\tikzset{circuit declare symbol=fuse, set fuse graphic={
draw, circuit symbol size=width 4 height 1, HorizontalAnnotation},
transform shape
}
\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,1.0) to [resistor] (3,1.0) node [right] {resistor};
\draw (0,0.5) to [fuse] (3,0.5) node [right] {fuse};
\draw (0,0.5) to [fuse] (0,-2) to [fuse] (3,0.5);
\end{tikzpicture}
\end{document}
I learned from Fuse symbol with TikZ that I have to add this code in my document head to draw a fuse:
\tikzset{circuit declare annotation={HorizontalAnnotation}{0pt}{edge[to path={[-]
($(-0.5,-0.5\tikzcircuitssizeunit)+(0,-0.5\pgflinewidth)$) --
($( 0.5,-0.5\tikzcircuitssizeunit)+(0,-0.5\pgflinewidth)$)}] ()}
}
\tikzset{circuit declare symbol=fuse, set fuse graphic={
draw, circuit symbol size=width 4 height 1, HorizontalAnnotation},
transform shape
}
So far so good. But I need the symbol "fuse" in my normal tikzpicture enviroment, in other words I want to compile this body:
\begin{document}
\begin{tikzpicture}
\draw (0,1.0) to [resistor] (3,1.0) node [right] {resistor};
\draw (0,0.5) to [fuse] (3,0.5) node [right] {fuse};
\draw (0,0.5) to [fuse] (0,-2) to [fuse] (3,0.5);
\end{tikzpicture}
\end{document}
Notice that I change "\begin{tikzpicture}[circuit ee IEC]" to "\begin{tikzpicture}", because my normal environment is the package "circuitikz". How to draw my fuse in my environment without [circuit ee IEC]?
compatibility
(which is not advised, though) you have to prepend a*
to the path-style component ofcircuitikz
.circuit declare symbols
are activated by the "circuit ee IEC" and are completely independent to thecircuitikz
ones. Thecompatibility
key add a*
in front of theto
-style form ofcircuitikz
component to avoid (most) clashed between the two.circuititz
never looks at thecircuit ee IEC
keys. My personal advice is to choose one of the two and stick to it...sfuse
tocircuitikz
?