Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 !

share|improve this question

1 Answer 1

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}

Diagram

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}
share|improve this answer
    
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 ! –  Calixte May 28 '11 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. –  Gonzalo Medina May 28 '11 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... :( –  Calixte May 28 '11 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. –  Gonzalo Medina May 28 '11 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 ! –  Calixte May 29 '11 at 8:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.