1

How can I use the positive and the negative pins from a capacitor as reference to connect another parts in tikz?

[pC, l=$C_{21}$, name=C21, -]

Is it possible also for the normal capacitors?

[C, l=$C_{20}$, name=C20, -]
  • 2
    Welcome to TeX.SE! Can you please show us a short compilable tex code what you have tried so far? Can you also add an sketch/screenshot of that what you want to get? Then we do not have to guess what you are doing (and wnating) ... – Mensch Aug 14 at 20:37
3

If you want to draw only a symbol, use path command.

\documentclass[margin=3mm]{standalone}
\usepackage[oldvoltagedirection]{circuitikz}

\begin{document}

\begin{circuitikz}
\path (0,0) to [C, l=$C_{21}$, name=C21](1,0);
\end{circuitikz}
\end{document}

This code produces follow output.

enter image description here

Now you can use the anchors of this symbol using it's name, like:

\documentclass[margin=3mm]{standalone}
\usepackage[oldvoltagedirection]{circuitikz}

\begin{document}

\begin{circuitikz}
\path (0,0) to [C, l=$C_{21}$, name=C21](1,0);
\draw (C21.east)--++(45:1);
\end{circuitikz}
\end{document}

enter image description here

And using with some TiKz:

\documentclass[margin=3mm]{standalone}
\usepackage[oldvoltagedirection]{circuitikz}

\begin{document}

\begin{circuitikz}
\path (0,0) to [C, l=$C_{21}$, name=C21](1,0);

\node at (-2,0) [draw, circle, minimum size=1cm, inner sep=0pt](circ2){1}; 
\node at (2,2) [draw, circle, minimum size=1cm, inner sep=0pt](circ1){2}; 

\draw (C21.east)--(circ1.-90);
\draw (C21.west)--(circ2.0);
\draw (C21.east)--++ (0:1) to [R,l_=$R_1$](3,0);

\end{circuitikz}
\end{document}

enter image description here

  • Notice that instead of using a path of length 0, you can also use \node[Cshape](myC) at (whatever). You lose the labels (which are bound to the path, and given a path of 0 length, they work a bit out of luck), but it could be useful sometime. – Rmano Aug 20 at 9:31

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.