2

I can't find the way to reverse the polarity of a battery symbol in the circuitikz library! Surely there's a way! Can anybody point in the right direction?

3
  • 3
    Certainly there must be a way, but where is your code?
    – user11232
    May 14 '15 at 2:33
  • 1
    Well, you could draw it from the opposite direction. Instead of (A) -- to[battery] -- (B) use (B) -- to[battery] -- (A). May 14 '15 at 4:04
  • Several orientations are shown at [Circuitikz american controlled voltage signs]{tex.stackexchange.com/questions/212062/…}. Does that answer your question. If not, it would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. May 14 '15 at 7:05
3
  • For reversing, draw the component in the reverse direction, by simply changing source and destination node.
  • If there's an info label, change info to info' or the other way round.

Here's an example:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC, positioning}
\begin{document}
\begin{tikzpicture}[
    circuit ee IEC,
    every info/.style = {font = \scriptsize},
    set make contact graphic = var make contact IEC graphic,
  ]
  \node [contact]                              (left contact)    {};
  \node [contact, right = 3cm of left contact] (middle contact)  {};
  \node [contact, right = 3cm of middle contact] (right contact) {};
  \draw (left contact)  to [battery = {info = {battery}}]
        (middle contact);
  \draw (right contact) to [battery = {info' = {reversed battery}}]
        (middle contact);
\end{tikzpicture}
\end{document}

Battery and reversed battery

0

You can use to change battery polarity "invert"

\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
    \draw  (0,0) to [battery1] (3,0);             % without invert
    \draw  (0,-2) to [battery1, invert] (3,-2);   % with invert
\end{circuitikz}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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