How can I get a battery symbol like this from either CircuiTikZ or TikZ's circuit libraries? I haven't been able to find any that have a thick negative terminal. pst-circ's \battery command is exactly what I want, but I'd prefer to stick to TikZ.

enter image description here





\begin{tikzpicture}[circuit ee IEC]
  \draw (0, 1) to [battery] (0, 0) {};

enter image description here

  • The third answer in tex.stackexchange.com/questions/33649/… does almost everything for you. You just hve to change the line thickness. – John Kormylo Oct 10 '15 at 15:46
  • @JohnKormylo, that changes the thickness of both terminals, I only want the negative terminal to be thicker. – JamesNZ Oct 11 '15 at 1:33

Perhaps I should have mentioned that you also have to split the component into two paths to implement two different line widths,

Note, you probably could reuse \linethickness instead of \tempwidth. A quick search of sty files only found it used in geometry and gkpmac(?). Besides, local changes won't get out of tikzpicture.



        \pgf@circ@res@step = -\ctikzvalof{bipoles/battery/width}
        \pgf@circ@Rlen \divide \pgf@circ@res@step by 2



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


  • Your battery symbol should be included into circuitikz as an option in selecting of battery symbols. – Zarko Oct 11 '15 at 15:33
  • @Zarko - I have no control over circuitikz, but I can add it to my collection elfsoft2000.com/projects/index.htm – John Kormylo Oct 11 '15 at 15:35
  • well, maybe you would write to author of circuitikz, that he include your impressive collection images. Thank you for link, it will be very useful for me. – Zarko Oct 11 '15 at 18:04
  • I have included the symbol to circuitikz named "battery2". It will be part of the next release and can be tried using the gitversion from here circuitikz.github.io/circuitikz – sistlind Sep 12 '16 at 15:20

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.