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

This question already has an answer here:

Is it possible to make circuitikz draw battery-symbols like this:

enter image description here

share|improve this question

marked as duplicate by Zarko, Mico, Jesse, barbara beeton, lockstep Nov 22 '15 at 16:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I know nothing about circutikz, but you can have a look at the battery symbol in the tikz circuits library. – cjorssen Nov 4 '11 at 13:08
    
Which "tikz circuits library"? How to use it? Could you give an example please? – student Nov 4 '11 at 13:16
    
See the pgfmanual mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf p.311 – cjorssen Nov 4 '11 at 13:35
    
@cjorssen: Thanks, I have found it in the manual. This led me to post another wuestion: tex.stackexchange.com/questions/33660/… – student Nov 4 '11 at 15:04
5  
up vote 5 down vote accepted

Sorry, I cannot provide any circuitikz solution. The following uses the tikz circuits library introduced in pgf 2.1 (and 2.0-cvs).

An example with a battery

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}

\begin{document}

\begin{tikzpicture}[circuit ee IEC]
  \draw (0,0) to [battery={info={$e_1$}}] ++(2,0) to
  [current direction' = {info = {$i$}, near start}, 
   resistor = {info = {$R$}, near end}] ++(0,3) to 
  [bulb] ++(-2,0) to[current direction' = {info = {$i$}}] (0,0);
\end{tikzpicture}

\end{document}
share|improve this answer

Use battery1:

\documentclass{standalone}
\usepackage{circuitikz}
\begin{document}

\tikz{
  \draw (0,0) to [battery1] (1,0);
  }

\end{document}

battery1 output

share|improve this answer
3  
Welcome to TeX.SX! Perhaps you could turn this into a complete minimal working example (MWE)? – Adam Liter Feb 10 '15 at 3:43
1  
Thank you for completing the MWE! Can you upload an image to the StackExchange servers, instead of using the PDF from dropbox? As you can see, the PDF is not able to be displayed as an image. If you need some help on getting an image, you can see this post: meta.tex.stackexchange.com/questions/5954/… You may also want to email the StackExchange staff via the "Contact Us" link to have your accounts here combined. Welcome to TeX.SX! – darthbith Feb 11 '15 at 12:42

I did it in such way:

\makeatletter
\ctikzset{bipoles/battery/width/.initial=.1}
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
        \pgf@circ@res@step = -\ctikzvalof{bipoles/battery/width}
        \pgf@circ@Rlen \divide \pgf@circ@res@step by 2

        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}

        \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}

        \pgfusepath{draw}
}
\makeatother
share|improve this answer

Source

Complementing what @RichardHDowney answered. The circuitikz manual contains all the information about the circuit elements that can be used with circuitikz, in section 3.2.4 Stationary sources of this manual two batteries will appear battery and battery1.

MWE with battery

\documentclass{minimal}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
      \draw (0,0) to [battery] (1,0);
\end{circuitikz}
\end{document}

output with battery

MWE with battery1

\documentclass{minimal}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
      \draw (0,0) to [battery1] (1,0);
\end{circuitikz}
\end{document}

Output with battery1

share|improve this answer

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