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?

0

2 Answers 2

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

1
  • 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. Apr 24, 2014 at 14:40
1

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

2
  • 2
    Welcome to TeX.SX! That cannot be the cause here though, as the OP doesn't load that library. Oct 10, 2016 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, 2021 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .