# Current arrow before bipole

I would like to have the current arrow before my bipole, not after as the default. I have the following circuit:

i_{r} is right after the resistor. However, I would like right after the node, i.e., before the resistor. How can I accomplish that? I used the following code:

\begin{circuitikz} \draw
(0,0) to[american current source, label=\mbox{$I_{f}$}] (0,4) -- (6,4)
(2,4) to[opening switch, label=\mbox{$t=0$}] (2,0)
(4,4) to[R, l_=R, i^=\mbox{$i_{r}$}] (4,0)
(6,4) to[C] (6,0)
(6,0) -- (0,0)
;
\end{circuitikz}

• See my answer here for a complete description of bipole current labeling locations and how to set them. Mar 12, 2016 at 21:30
• @PaulGessler I tried \draw (4,4) to[generic,i>^2=$i_1$] +(0,2);, my compiler timed out with that. Mar 12, 2016 at 22:24
• @ViniciusDantas Remove the 2 so you have \draw (4,4) to[generic,i>^=$i_1$] +(0,2);
– sodd
Mar 12, 2016 at 22:25
• Didn't notice that. It creates a rectangle bipole above (4,4), that's not what I need :/ Mar 14, 2016 at 0:31

To place the current label before the bipole component, the current direction specifier (> or <) must appear before the label location specifier (^ or _). Since you haven't specified the current direction here, the default direction (with the direction the component is drawn) and ordering (current after component, in the direction of drawing) is assumed.

See my answer at Electrical diagram for a complete description of current labeling specifications.

Note that using \mbox around the label text is only necessary when the label contains an equals sign.

In this case, use i>^=$i_{r}$ to place the current as desired (> to draw the current in the same direction that the bipole is drawn, ^ to place the label "above" the bipole [where "above" assumes the component is drawn from left to right], and in that order so that the current label is placed before the bipole component symbol.

\documentclass{standalone}
\usepackage{circuitikz}

\begin{document}
\begin{circuitikz} \draw
(0,0) to[american current source, label=$I_{f}$] (0,4) -- (6,4)
(2,4) to[opening switch, label=\mbox{$t=0$}] (2,0)
(4,4) to[R, l_=R, i>^=$i_{r}$] (4,0)
(6,4) to[C] (6,0)
(6,0) -- (0,0)
;
\end{circuitikz}
\end{document}