2

I've done some searching but can't quite get (a) components like power supply to scale, and (b) adjust node distance. Specifically, when I make the power supply smaller, I want the '+' and '-' signs also to scale, which is not happening right now (power supplies/scale seems to have no effect). Changing the node distance doesn't seem to have any effect either (works only with of synatax?). I also tried using stuff like <\kilo\ohm> and it didn't work as expected.

I had asked this query as a comment to this answer and posting it as a separate question. Thanks for all your help.

\documentclass[12pt]{article}
\usepackage[dvips]{graphicx,color}

\usepackage{standalone}
\usepackage{tikz}
\usepackage[siunitx,american]{circuitikz}

\pagestyle{empty}

\begin{document}
\sffamily

\begin{figure}
\ctikzset{
    bipoles/length=1cm,
    power supplies/scale=0.5,  % has no effect
}

{\centering
\begin{circuitikz}[line width=1pt, scale=0.9, node distance=2cm]
% node distance works only with 'of' ?

\draw
    (0,0) -- ++(0,4)
    to [R, l=$10\,\Omega$] ++(2,0)
    to [V, v=$1\,V$, -*] ++(2,0)
    to [R, l_=$10\,\Omega$] ++(0,-2)
    to [V, v_=$2\,V$, invert] ++(0,-1)
    to [short, -*] ++(0,-1)
    ;   
\draw (0,0)
    to [short,-o] (6,0) coordinate (a);
\draw (4,4)
    to [short,-o] (6,4) coordinate (b);
\node[below=1ex] at (6,4) (){$+$};
\node[above=1ex] at (6,0) (){$-$};
\node at( $(a)!0.5!(b) $)(){$V_0$};

\end{circuitikz}
\caption{These are testing times}
}
\end{figure}

\end{document}

enter image description here

1
  • As Zarko said, the plus and minus symbols are characters, they have a font setting apart. The class scale do work, but only on the graphic of the symbol, not on the font. About the <> syntax, it is not really advised, but it should work inside labels and v-i-f. You do not show an example of it failing, though.
    – Rmano
    Sep 24, 2022 at 7:49

1 Answer 1

4

Edit: added are more explanation and improved (corected) code in the second example)

  • Your document preamble contain error. Instead of
\usepackage[dvips]{graphicx,color}

it should be

\usepackage[dvips]{color}
\usepackage{graphicx}
  • However, as pointed @Rmano in his comment below, circuitikz load xcolor package, so you not need to load color package again. At this can happen clash between options
  • Considering this correction with your circuitikz code I can't reproduce your image (see left image below)
  • If you wish to change size of symbols in voltage sources, see if the following \ctikzset at begin od scheme helps:
\ctikzset{bipoles/vsourceam/inner  plus={\scriptsize $+$},
          bipoles/vsourceam/inner minus={\scriptsize $-$}}
  • Use of node distance=... instruction has sence only if in scheme you have nodes and for their positioning use relative positioning, for example left=of <node name> (using positioning library syntax) or deprecated left of=<node name> without positioning library. Since in your scheme doesn't contain nodes, in your case this option hasn't any sense.
  • Your code can be a wee bit simplified (shortened), see MWE below.
    • first example is based on your code in question
    • the second example has increased voltage sources size as well reduced size of + and - symbols (you may like this changes)
\documentclass[margin=3mm]{standalone}
\usepackage[siunitx,american]{circuitikz}

\begin{document}
    \begin{circuitikz}[line width=1pt]
\draw   (0,0) -- ++(0,4)
    to [R=10<\ohm>]     ++(2,0)
    to [V= 1<V>, -*]    ++(2,0) coordinate (a)
    to [R=10<\ohm>]     ++(0,-2)
    to [V=2<V>, invert, -*] ++(0,-2)
    ;
\draw   (a)   
    to [short,-o]       ++ (2,0) 
    to [open, v^=$V_0$] ++ (0,-4)
    to [short,o-.]       ++ (-6,0) ;   
    \end{circuitikz}
    
\qquad
    \begin{circuitikz}[line width=1pt]
\ctikzset{bipoles/vsourceam/inner  plus={\scriptsize $+$},
          bipoles/vsourceam/inner minus={\scriptsize $-$},
          sources/scale=1.2}
\draw   (0,0) -- ++(0,4)
    to [R=10<\ohm>]     ++(2,0)
    to [V= 1<V>, -*]    ++(2,0) coordinate (a)
    to [R=10<\ohm>]     ++(0,-2)
    to [V=2<V>, invert, -*] ++(0,-2)
    ;
\draw   (a)
    to [short,-o]       ++ (2,0)
    to [open, v^=$V_0$] ++ (0,-4)
    to [short,o-.]       ++ (-6,0) ;
    \end{circuitikz}   
\end{document}

enter image description here

5
  • +1, and yes, Better not to load color at all, tikz will load xcolor and the only effect could be some option clay error...
    – Rmano
    Sep 24, 2022 at 7:44
  • @Rmano, in my MWE color is not presented, however, I didn't emphasize this. I will add your coment to answer ASAP. Thank you very much!
    – Zarko
    Sep 24, 2022 at 7:46
  • Thanks for pointing out the errors and what needs to be done to get what I want. Greatly appreciated.
    – CSR
    Sep 24, 2022 at 8:05
  • @CSR, you are welcome! BTW, you can upvote answer too ;-)
    – Zarko
    Sep 24, 2022 at 8:13
  • 1
    Upvoted it, too, with pleasure and gratitude!
    – CSR
    Sep 24, 2022 at 8:39

You must log in to answer this question.

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