2

Sometime it is very useful to be able to see where the \coordinates that you are defining really are in a diagram. I am using what I think it's an hack to do it, defining a command and then change the definition in the final run (see below).

The first problem is that I would like that the pin did not change anything in the graph (in this case, they are changing at least the bounding box). Is it possible to have a kind of "overlay" pin? I checked that adding overlay to the pin options did not work...

And the second one... is there a better way to do it? For example, with a style that could be applied to every coordinate?

\documentclass[border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
    % \def\coord(#1){coordinate(#1)}
    \def\coord(#1){node[pin={[red]45:#1}](#1){}}
    \begin{circuitikz}[american, 
        ]
        \draw (0, 0) to [sV=$v_s$] ++(0,-5) node[ground](GND){};
        \draw (0, 0) to[short,-*] ++(2,0) \coord(inb) to[R, l=$R_1$] (inb |- GND) node[ground]{};
        \draw (inb) to [short] ++(2,0) \coord(re) to [R=$r_e$, i=$i_e$, -o] ++(0, -2.5) \coord(q1e) node[below right]{E};
        \draw (q1e) to[R, l=$R_{E1}$] (q1e |- GND) node[ground]{};
        \draw (q1e) to[short] ++(2,0) \coord(q1e2) to[R, l=$R_{E2}$] (q1e2 |- GND) node[ground]{};
        \draw (re) to [short] (q1e2 |- inb) to[short]  ++(2,0) \coord(alpha) to[american controlled current source,  l=$\alpha i_e$, -o] ++(0, -2.5) \coord(q1c);
        \draw (q1c) to[R=$R_C$] (q1c |- GND) node[ground]{};
        \draw (q1c) to[short, -o] ++(1,0) node[right]{$v_o$};
    \end{circuitikz}
\end{document}

result

4

When you add the overlay option, it is only added to the node but not to the edge of the pin. To this end you have to add the pin edge=overlay option on top.

\documentclass[border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
    % \def\coord(#1){coordinate(#1)}
    \def\coord(#1){node[pin={[pin edge=overlay,overlay,red]45:#1}](#1){}}
    \begin{circuitikz}[american, 
        ]
        \draw (0, 0) to [sV=$v_s$] ++(0,-5) node[ground](GND){};
        \draw (0, 0) to[short,-*] ++(2,0) \coord(inb) to[R, l=$R_1$] (inb |- GND) node[ground]{};
        \draw (inb) to [short] ++(2,0) \coord(re) to [R=$r_e$, i=$i_e$, -o] ++(0, -2.5) \coord(q1e) node[below right]{E};
        \draw (q1e) to[R, l=$R_{E1}$] (q1e |- GND) node[ground]{};
        \draw (q1e) to[short] ++(2,0) \coord(q1e2) to[R, l=$R_{E2}$] (q1e2 |- GND) node[ground]{};
        \draw (re) to [short] (q1e2 |- inb) to[short]  ++(2,0) \coord(alpha) to[american controlled current source,  l=$\alpha i_e$, -o] ++(0, -2.5) \coord(q1c);
        \draw (q1c) to[R=$R_C$] (q1c |- GND) node[ground]{};
        \draw (q1c) to[short, -o] ++(1,0) node[right]{$v_o$};
    \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.