7

Lets say I create a component like this

(0,0) to [R, l^=$R1$] (0,2)

How can I make it so that the value, R1, is say, on the right hand side, and the resistance, say, 1kohm is on the left hand side?

I've tried

(0,0) to [R, l^=$R1$, l_=$\SI{1}{\kilo\ohm}$] (0,2)

but that does not work because it just overwrites (or ignores) the first l^=...

Thanks.

Edit: Added example code that compiles and a picture of what I'm after.

\documentclass[a4paper,journal]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[american]{circuitikz}


\begin{document}

\begin{circuitikz}[scale=1,transform shape]
\draw
    % Left half of circuit.
    (0,0)   to [sV, l=$v_\mathrm{s}$]           (0,2)
            to [short, -o]                      (1.5,2)
            to [R, l=$R_\mathrm{G}$, -o]            (4,2)
            to [open, v^=$v_\mathrm{gs}$]       (4,0)
            to [short, o-o]                     (1.5,0)
            to [short]                          (0,0)

    % Right half of circuit.        
    (7,2)   to [cI, i_=$g_m v_\mathrm{gs}$]     (7,0)
    (7,2)   to [short, -*]                      (8.5,2)
            to [R, l=$r_    \mathrm{o}$]                (8.5,0)
            to [short, *-]                      (7,0)

    (8.5,2) to [short, -o]                      (9.5,2)
            to [short, -o]                      (13,2)  node[right] {$v_\mathrm{o}$}

    (8.5,0) to [short, -o]                      (9.5,0)
            to [short]                          (12,0)

    (10.5,2)    to [R, l=$R_\mathrm{D}$, *-*]       (10.5,0)
    (12,2)  to [vR, l=$R_\mathrm{l}$, *-]       (12,0)

    (3.5,0) to [short, -*]                      (7,0)

    (1.5,0) node[below] {S}
    (9.5,0) node[below] {S}
    (1.5,2) node[above] {G}
    (9.5,2) node[above] {D}
    ;
\end{circuitikz}


\end{document}

Circuit

2
  • 2
    It helps if you post a complete minimum working example (MWE) beginning with \documentclass{} and ending with \end{document} that demonstrates the problem. In that way, the users of this site, who may be interested in helping you, only have to fix a line, rather than write a whole block of code. Commented Aug 8, 2013 at 1:41
  • Okay, I've taken your advice and added a bunch of stuff!
    – user968243
    Commented Aug 8, 2013 at 5:33

2 Answers 2

7

Around the resistor are anchor points. You can name the resistor node using the n= style, the anchor point opposite the label is (normally) "s".

\documentclass[a4paper,journal]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[american]{circuitikz}


\begin{document}
\begin{circuitikz}[scale=1,transform shape]
\draw
% Left half of circuit.
(0,0)   to [sV, l=$v_\mathrm{s}$]           (0,2)
        to [short, -o]                      (1.5,2)
        to [R, l=$R_\mathrm{G}$, n=res, -o] (4,2)
        to [open, v^=$v_\mathrm{gs}$]       (4,0)
        to [short, o-o]                     (1.5,0)
        to [short]                          (0,0)

(1.5,0) node[below] {S}
(1.5,2) node[above] {G}
(res.s) node[below]{1k$\Omega$} %here is the added code
;
\end{circuitikz}
\end{document}
0
1

From the manual version 0.8.3 (2017/05/28) page 34: "Since Version 0.7, besides the original label (l) option, there is a new option to place a second label, called annotation (a) at each bipole. Up to now this is a beta-test and there can be problems."

enter image description here

\documentclass[a4paper,journal]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[american,siunitx]{circuitikz}

\begin{document}

\begin{circuitikz}[scale=1,transform shape]
\draw
    % Left half of circuit.
    (0,0)   to [sV, l=$v_\mathrm{s}$]           (0,2)
            to [short, -o]                      (1.5,2)
            to [R, l=$R_\mathrm{G}$, -o,a=1<\kilo\ohm>] (4,2)
            to [open, v^=$v_\mathrm{gs}$]       (4,0)
            to [short, o-o]                     (1.5,0)
            to [short]                          (0,0)

    % Right half of circuit.        
    (7,2)   to [cI, i_=$g_m v_\mathrm{gs}$]     (7,0)
    (7,2)   to [short, -*]                      (8.5,2)
            to [R, l=$r_    \mathrm{o}$]                (8.5,0)
            to [short, *-]                      (7,0)

    (8.5,2) to [short, -o]                      (9.5,2)
            to [short, -o]                      (13,2)  node[right] {$v_\mathrm{o}$}

    (8.5,0) to [short, -o]                      (9.5,0)
            to [short]                          (12,0)

    (10.5,2)    to [R, l=$R_\mathrm{D}$, *-*]       (10.5,0)
    (12,2)  to [vR, l=$R_\mathrm{l}$, *-]       (12,0)

    (3.5,0) to [short, -*]                      (7,0)

    (1.5,0) node[below] {S}
    (9.5,0) node[below] {S}
    (1.5,2) node[above] {G}
    (9.5,2) node[above] {D}
    ;
\end{circuitikz}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .