2

How can I shift the arrow more to the far way from the components and color both arrows and labels differently as in the image?

enter image description here

(Placing the label below the arrow probably makes it look a bit better but I prefer to put it on top.)

I have been trying to apply this from manual but couldn't make it work.

enter image description here

\documentclass[border=0.1mm]{standalone}
\usepackage[american,siunitx,RPvoltages]{circuitikz}


\begin{document}

\begin{tikzpicture}[thick]

\ctikzset{bipoles/cuteinductor/voltage/distance from node/.initial=0.4};
\ctikzset{bipoles/capacitor/voltage/distance from node/.initial=0.7};

\ctikzset{!i/.style={ no i symbols}};

\newcommand{\iarronly}[1]{% name
\node [currarrow, color=red, anchor=center,
rotate=\ctikzgetdirection{#1-Iarrow}] at (#1-Ipos) {};
}

\draw (0,0) node[ocirc,scale=2]{} to [C,
i>^=$I_C$,
v^=$V_C$
] ++(3,0)  to
[cute inductor,
v^=$V_L$, 
i^>= $I_L$,
voltage/american label distance=0.8pt] ++(1.5,0) to 
[short, name=  LL,!i] ++(1,0)node[ocirc,scale=2] {};


% \iarronly{LL};

\end{tikzpicture}


\end{document}
7
  • Can't confirm, but the no i symbol needs a current specifier to get the direction and above/below position. Try ` to [short, name= LL, i, !i] ++(1,0)` (or i< or whatever).
    – Rmano
    Dec 13, 2022 at 6:49
  • @jsbibra Nice drawig but I want to place the arrow on the circuit instead and also be able to move the arrow along to some desired position. The built-in arrow always places too close to the component.
    – internet
    Dec 13, 2022 at 7:16
  • @Rmano probably something else as those two don't work. I also tried to change like i> but it doesn't work as well.
    – internet
    Dec 13, 2022 at 7:17
  • 1
    @internet I don't think --- the problem is that color is a path-wide property in TikZ, you can't change it locally. For this the "advanced" thing exists --- to be able to use another path (there is something in the FAQ in the manual). RL calling now, I'll try to check why your code is not working later.
    – Rmano
    Dec 13, 2022 at 8:59

1 Answer 1

4

Like this?

enter image description here

(without use of at use current arrow scale=...

Edit: You can scale currents arrows by option current arrow scale=<denominator of size>. Now added to \ctikzset, but can be inserted locally too.

\documentclass[margin=3mm]{standalone}
\usepackage[american,siunitx,RPvoltages]{circuitikz}

\begin{document}

\begin{circuitikz}
\ctikzset{bipoles/capacitor/width/.initial=.075,
          current arrow scale=8 
          }
\draw   (0,0)   node[ocirc] {}
                to [short, i=$I_{C}$, color=red,
                    bipole current append style={color=red}]   ++ (1,0)
                to [C, v^=$V_C$] ++ (2,0)
                to [cute inductor, v^=$V_L$] ++ (2,0)
                to [short, i=$I_{L}$, color=blue,
                    bipole current append style={color=blue}]   ++ (1,0)
                node[ocirc] {};
    \end{circuitikz}


\end{document}

at use current arrow scale=8

enter image description here

11
  • Exactly, very nice. I was looking for how to draw arrow tip only as an alternative.
    – internet
    Dec 13, 2022 at 7:48
  • How would you scale the arrow head? Just prepare if I need it in the future.
    – internet
    Dec 13, 2022 at 7:56
  • 1
    @internet, so far, as I know, this is not possible without use of node (as you try) . What you like (me too) seems to be new feature request. We should wait to respond of package author ...
    – Zarko
    Dec 13, 2022 at 7:58
  • 1
    @internet, for scaling of current arrows exist option current arrow scale=<denominator>. See edited answer.
    – Zarko
    Dec 13, 2022 at 8:06
  • Trust @Zarko to know circuitikz way better than me! 🎉
    – Rmano
    Dec 13, 2022 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .