12

I'm using TexLive2013 and the Circuitikz package.

I'm trying to draw the ground symbol but it appears as just a line and not the proper symbol.

The code I'm using is:

\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{center}
  \begin{circuitikz} 
    \draw (0,0) to [ground] (0,-1); 
  \end{circuitikz} 
\end{center}
\end{document}

But what I get is this:

enter image description here Anyone know why?

James
  • 123

2 Answers2

15

This is absolutely normal: the symbol ground is a node shape, hence it mandatory to adopt the TikZ \node syntax.

Specifically, one should change

\draw (0,0) to [ground] (0,-1); 

into

\draw (0,0) to (0,-1) node[ground]{}; 

or the equivalent

\draw (0,0) -- (0,-1) node[ground]{}; 

A complete example:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz} 
\draw (0,0) -- (0,-1) node[ground]{}; 
\end{circuitikz}
\end{document}

The result:

enter image description here

  • Note: the previous edit suggesting \draw (0,0) node[ground]{} to (0,-1) ; option has been removed since it is very unlikely to place a ground in the middle of a wire within a circuit. – Claudio Fiandrino Apr 24 '14 at 14:40
1

Using \usetikzlibrary{circuits.ee.IEC} conflicts with the ground and causes this behaviour.

Torbjørn T.
  • 206,688
  • 2
    Welcome to TeX.SX! That cannot be the cause here though, as the OP doesn't load that library. – Torbjørn T. Oct 10 '16 at 12:05
  • In my case, that was the reason. I load the library circuits.ee.IEC Thanks for the hint, very helpfull for me. I have lost an hour to fix this. – Michael.H Nov 30 '21 at 20:15