Update
You have almost done it! A couple of tricks when designing components:
the default position is from left to right, so put the component in that direction while doing the drawing;
the linewidth of the wires is stored in \pgfstartlinewidth
, and it's in force when starting the drawing;
the reference dimensions of the component are marked by the upper-right corner \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}
and the lower left \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}
; in this case (but not for every component) they are symmetric around \pgfpoint{0pt}{0pt}
You go with \pgfpathmoveto{...}
, \pgfpathlineto{...}
and the other primitives you can find here, and then you stroke or fill the path (you need to do that every time you want to change the style of the line).
The rest of the changes are marked in the code:
\documentclass[margin=1cm]{standalone}
\usepackage{circuitikz}
\makeatletter
\pgfcircdeclarebipolescaled{sources}
{}
{\ctikzvalof{bipoles/isource/height}}
{isourcex}
{\ctikzvalof{bipoles/isource/height}}
{\ctikzvalof{bipoles/isource/width}}
{
% \draw the "across" line with the basic width
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfusepath{draw}
% draw the circle
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
% fill if needed
\pgf@circ@draworfill
% it seems that your "arrows" should be thicker. You can add
% a parameter, but for now let do that the easy way
\pgfsetlinewidth{1.5\pgflinewidth}
% \draw the first "caret"
\pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{-0.5\pgf@circ@res@up}}
% and the second one
\pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{-0.5\pgf@circ@res@up}}
% stroke the path
\pgfusepath{draw}
}
\pgfcirc@activate@bipole@opt{i}{isourcex}{isourcex}{my current source}{%
\circuitikzbasekey/bipole/is current=true}
% This must be the name of the bipole declaration above...
\pgfcirc@style@to@style{my current source}{isourcex}
\makeatother
\begin{document}
\begin{circuitikz}
\draw (0,0) to[isource] ++(2,0);
\draw (3,0) to[isourcex] ++(2,0);
\draw (6,0) to[isourcex, invert] ++(2,0);
\end{circuitikz}
\end{document}
original answer
To have a symbol like this completely integrated into the library, you can either:
follow the instruction on the circuitikz
manual, chapter 9, "Defining new components". It's not so difficult, but you need a basic knowledge of the basic layer of pgf
.
find a standard that uses this symbol and advocate for a feature request; notice that the package has a lot (probably even too many) symbols, so I'll add only well-supported ones.
I can offer a solution which is basically a self-plagiarism of this one, but you can do this:
\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\newcommand{\drawda}[2][0]{% draw a double arrow inside an empty source
\begin{scope}[rotate=#1]
\draw (#2.left) -- (#2.right);
\draw [thick] (#2.center) ++(-2mm,0) -- ++(2mm,3mm) -- ++(2mm,-3mm);
\draw [thick] (#2.center) ++(-2mm,-2mm) -- ++(2mm,3mm) -- ++(2mm,-3mm);
\end{scope}
}
\begin{document}
\begin{tikzpicture}[american]
\draw (0,0) to [esource, name=pulse1, l=$I_v$] ++(0,2)
to[esource, name=pulse2, l=$I_h$] ++(2,0)
to[esource, name=pulse3, l=$-I_h$] ++(2,0);
\drawda{pulse1}
\drawda[-90]{pulse2}
\drawda[90]{pulse3}
\end{tikzpicture}
\end{document}