# Opposite poles battery in circuitikz

This might be a simple question, but I would like the battery positive pole to be to the left, and to the right as the default,

(0,0) to [battery, v=$\varepsilon$] (2,0)


Also, is there an option within circuitikz to draw only one pair of poles instead of 2? I have seen the following solution Battery symbol in circuitikz but I would be happy to know if a circuitikz solution exists.

-
– Peter Grill Jan 8 '12 at 23:55

## 2 Answers

The easiest way I can come up with is to simply reverse the direction in which you place the battery. So instead of \draw (0,0) to [battery, ...] (2,0) you use \draw (2,0) to [battery, ..] (0,0) (as is the case in the second example below).

If you do not want to reverse the direction in which you place the nodes, you could use rotate=180,transform shape option. This unfortunately also ends up producing a mirror image of the text, which can be remedied by applying a \rotatebox{180}{} to the voltage label (two 180 rotations of the text returns the text back to the original orientation). By default, this place the direction arrow at the bottom. If you desire this at the top, you can use \circuitikzbasekey/bipole/voltage/position =below as is the case in the examples below:

\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}

\begin{document}
\begin{tikzpicture}
\draw (0,0) to [battery, v=$\varepsilon$] (2,0) node [right] {Default};
\end{tikzpicture}

\medskip
\begin{tikzpicture}
\draw (2,0) node [right] {Reverse  coordinates} to
[battery, v=$\varepsilon$,
\circuitikzbasekey/bipole/voltage/position = below] (0,0) ;
\end{tikzpicture}

\medskip

\begin{tikzpicture}
\draw (0,0) to
[rotate=180,transform shape,
battery, v=\rotatebox{180}{$\varepsilon$},
\circuitikzbasekey/bipole/voltage/position = below] (2,0)
node {Rotate text and symbol};
\end{tikzpicture}
\end{document}

-

To change the circuitikz defaults you may have to alter its .sty and .tex files. Instead you can change direction of the battery terminals by changing the order of the component directions. You can also use circuitikz' label mechanism (l^ and l_) to place the name above or below the component.

\documentclass{article}
\usepackage{tikz}
\usepackage[european,american]{circuitikz}
\begin{document}

\begin{tikzpicture}
\draw (0,0) to [battery, l^={$\varepsilon$}] (2,0);
\end{tikzpicture}

\begin{tikzpicture}
\draw (2,0) to [battery, l_={$\varepsilon$}] (0,0);
\draw (4,0) to [battery, l^={$\varepsilon$}] (3,0);
\end{tikzpicture}
\end{document}

-