# Using circuitikz, how do I make a ground node and link to it from several others?

I'd like to get two or three nodes linking to a ground symbol (this is not an electric circuit), as in this attempt:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{circuitikz}
\begin{document}

\begin{tikzpicture}
\node[](a){X};
\node[](b)[right=of a]{Y};
\node[ground](g)[below=of a]{};
\draw[-] (a.south) -- (g.north);
\draw[-] (b.south) -- (g.north);
\end{tikzpicture}

\end{document}


But this fails with the following error:

! Package PGF Math Error: Unknown function north' (in 'north').

See the PGF Math package documentation for explanation.
Type  H <return>  for immediate help.
...

l.12 \node[ground](g)[below=of a.east]{};

?


And yet, TeX still outputs the PDF, which seems correct... What am I doing wrong?

(I am willing to use another library instead of circuitikz if it makes things easier)

edit: included an example with two nodes linking to ground, not only one

-

The monopole ground has only center anchor. So you can not refer to its north. Also positioning library uses that anchor when you say put it below such and such, so we have to reanchor it to its center. Hence everytime you want to refer to it either should use the node name or node name.center syntax. I would go with the TikZ' own circuit library to avoid such unforeseen problems.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{circuitikz}
\begin{document}

\begin{tikzpicture}
\node (a){X};
\node (b)[right=of a]{Y};
\node[ground,below=of a,anchor=center] (g) {};
\draw (a.south) -- (g);
\draw (b.south) -- (g);
\end{tikzpicture}

\end{document}
`

-
Thanks a lot, really! Now it all works as I intended. –  Jay Jun 30 '12 at 1:41