From Zarko's answer to my preivous question by adding [short,...]
I can insert a current arrow on any wire section and can specify color of both label and the arrow. That is great and satisfy in most cases.
\draw (0,0) node[ocirc,scale=2] {} to [short, i>^= $I_L$, color=red, bipole current append style={color=red}] ++(0.5,0) to [cute inductor,
,bipole current append style={color=red}] ++( 1.5,0) node[ocirc,scale=2]{} ;
Now if I don't use [short,..]
I could do it like this but this would make the inductor red as well.
\draw (0,-1) node[ocirc,scale=2] {} to [cute inductor, i>^= $I_L$, color=red
,bipole current append style={color=red}] ++(2,0) node[ocirc,scale=2]{} ;
Assuming that I want to place the inductor in the middle between two ends as in the second case, how can I do that?
If I use [short,..]
with very small distance like (0,0) [short,..] ++(0.1,0)
it would place the arrow very close to the left terminal which is not desired.
The main reason for not using [short,...]
is that I made a lot of circuits with TikZ and now if I change that then I would have to change all things as many of them depends on the inductor coordinate. Also in some cases, the built-in current arrow is good and you don't want to add [short]
as it would probably require more space or make the inductor asymmetric as in the first image.
\documentclass[margin=3mm]{standalone}
\usepackage[american,siunitx,RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[ocirc,scale=2] {} to [short, i>^= $I_L$, color=red, bipole current append style={color=red}] ++(0.5,0) to [cute inductor,
,bipole current append style={color=red}] ++( 1.5,0) node[ocirc,scale=2]{} ;
\draw (0,-1) node[ocirc,scale=2] {} to [cute inductor, i>^= $I_L$, color=red
,bipole current append style={color=red}] ++(2,0) node[ocirc,scale=2]{} ;
\end{circuitikz}
\end{document}
short
. If will be needed, I will write answer late afternoon.