TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I follow a convention in which I make voltages blue and currents red.

Making the current direction red is pretty simple. I just add "color=red" to the options for the specific current direction. But what about the text?

The PGF manual suggests changing the style, like so:

\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\node [resistor,info=$3\Omega$] {};

The trouble with this is that it makes ALL the info labels red. I just want the current direction labels to be red.

Here is my minimal working example:





\begin{tikzpicture}[circuit ee IEC,x=2cm,y=1.5cm,
small circuit symbols,
set inductor graphic=var inductor IEC graphic,
set diode graphic=var diode IEC graphic]

\foreach \contact/\x in {0/0,2/3}
\node [contact] (upper contact \contact) at (\x,4) {};
\node [coordinate] (upper right limit) at (6,4) {};
\node [coordinate] (lower right limit) at (6,0) {};

\draw (upper contact 0) to[current direction={near start,color=red,text=red,info=$\text{I}_2$},resistor={info={$\text{R}_1$}}] (upper contact 2);



I tried adding "text=red", after I saw it in this example, but that does not work.

share|improve this question
up vote 3 down vote accepted

Try swapping this in:


enter image description here

Even shorter is Gonzalo's suggestion:

share|improve this answer
You can also use info={[red]$\text{I}_2$}. – Gonzalo Medina May 16 '12 at 18:17
Even easier! I'll add it. – qubyte May 16 '12 at 18:19
Excellent! Can anybody point me to where I would find this in the TikZ documentation? – Stephen Bosch May 16 '12 at 19:07
@MarkS.Everitt: is there a way to set this in a style, so that it applies only to current directions, for example? – Stephen Bosch May 16 '12 at 19:09
I just attempted this and then realised that you're unlikely to want the same label on the current all the time. I'm not sure of a way of making this a style without fixing the label text I'm afraid. – qubyte May 18 '12 at 15:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.