# CircuitTikZ — relative coordinate

Is it possible to use relative coordinate for bipoles ?

For example to draw a conductor, we can use : (0,0)-- ++(2,0), and I'd like to do the same with bipoles.

Thanks !

Yes, it is possible:

\documentclass{article}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}\draw
(0,0)to[sI] (0,4)
to[R=$1\ k\Omega$,-*] (3,4) -- ++(1,0)
to[R=$2\ k\Omega$] ++(2,0) -- ++(0,-4) to[R=$2\ k\Omega$] ++(-2,0) -- (3,4);
\end{circuitikz}

\end{document}


I apologize: the diagram is just a random code example; I've no idea of what (if any) meaning could it have.

EDIT: I include a reduced version of the code, so that it can be tested with older versions of the packages:

\documentclass{article}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}
\draw (0,4) to[R=$1$] ++(3,4) -- ++(1,0)
to[R=$2$] ++(2,0) -- ++(0,-4) to[R=$3$] ++ (-2,0) -- (0,4);
\end{circuitikz}

\end{document}

• Thanks for your quick answer, but I have this error : ! Package tikz Error: ( expected. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.9 (0,0) to [R] + +(2,0) ?  Any idea how to resolve it ? Thank you ! May 28, 2011 at 22:12
• @Calixte: do you get this error with the code in my answer? If so, then perhaps some of your packages are outdated and you'll need to update your packages. May 28, 2011 at 22:16
• I copy/paste your code, and update my packages (sudo apt-get install texlive-full), and i still have this error, on Ubuntu and MacOS... :( May 28, 2011 at 23:00
• @Calixte: you are using the TeX Live version from the Ubuntu's repositories and unfortunately that's not the latest TeX Live version. If you want to use the most recent version of TeX Live you'll have to do an installation from: TUG, although right now TeX Live2010 has been frozen (TeX Live2011 will be released in a few months). Before thinking about re-installing your LaTeX system (and I suggest you do so in some moment), I'll reduce my example to a version that should compile with your current version. May 28, 2011 at 23:48
• Your reduced code doesn't work to. But I find a temporary solution here : olivierlemaire.wordpress.com/2010/12/25/… Thank very much for your help ! May 29, 2011 at 8:09