1

I started using tripoles in circuitikz and now I realized I can't get stuff aligned anymore.

A simple example:

\usepackage{siunitx}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}
  \draw
  (0,0)
  node[npn](Q1){}
  (Q1.C)
  to[short]
  ++(1,0)
  to[V=${\SI{10}{\volt}}$]
  ++(0,-2.75)
  node[rground]{}

  (Q1.E)
  to[short]
  (0,-2)
  node[rground]{}

  (Q1.B)
  to[short]
  ++(-1, 0)
  to[V=${\SI{0.6}{\volt}}$]
  ++(0, -2)
  node[rground]{}
  ;
\end{circuitikz}

\end{document}

produces:

enter image description here

The rground-node below the 10V-Source is misaligned with the others. Is there a simple way to navigate through the circuit, so I get to the same coordinates from each anchor of a tripole?

1
  • ++(0,-2) is a relative coordinate, that is it moves from the current location 2cm down. (0,-2) is an absolute coordinate (relative to the origin). If you want them aligned, use absolute coordinates for all three. Jul 18 '16 at 16:11
2

Just assign a coordinate to the first gnd-node and reference to it at the following gnd-nodes, e.g.:

\documentclass{standalone}
\usepackage{siunitx}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}
  \draw
  (0,0)  node[npn](Q1){}
  (Q1.C) to[short] ++(1,0) to[V=${\SI{10}{\volt}}$] ++(0,-2.75)
  node[rground](gnd){}
  (Q1.E) to[short]  (Q1.E|-gnd)  node[rground]{}
  (Q1.B) to[short] ++(-1, 0) coordinate(top) to[V=${\SI{0.6}{\volt}}$] (top|-gnd) 
  node[rground]{}
  ;
\end{circuitikz}

\end{document}

enter image description here

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.