TransWikia.com

circuitikz: Controlling the size of poles

TeX - LaTeX Asked on June 12, 2021

documentclass[12pt,a4paper]{article}
usepackage{tikz}
usepackage{circuitikz}
begin{document}
    begin{tikzpicture}
                    node (a) at (0,0) [ocirc] {};
                    node (c) at (1.5,0) [ocirc] {};
                    node (b) at (3,0) [ocirc] {};
                    node (d) at (1.5,2) [ocirc] {};
                    node (e) at (1.5,-2)[ocirc] {};
                    
                    node[left] at (a) {$a$};
                    node[left] at (c) {$c$};
                    node[right] at (b) {$b$};
                    node[above] at (d) {$1$};
                    node[below] at (e) {$0$};
                    
                    path 
                    (a) edge           (d)
                    edge           (e)
                    (b) edge           (d)
                    edge           (e)
                    (d) edge           (c)
                    (c) edge           (e); 
                    end{tikzpicture}
end{document}

How do I control the size of the poles at a,b,c,1,0? I want to increase the radii of the poles.

One Answer

As described in the manual, the size of the poles is defined by the nodes width key, which by default is 0.04. This number is a fraction of some "basic length". Change it with e.g. ctikzset{nodes width=0.2}.

Below I used labels instead of adding extra nodes, but that's merely a suggestion.

enter image description here

documentclass[12pt,a4paper]{article}
usepackage{circuitikz}
ctikzset{nodes width=0.2} % default = 0.04
begin{document}
    begin{tikzpicture}
                    node (a) at (0,0) [ocirc, label=left:$a$] {};
                    node (c) at (1.5,0) [ocirc, label=left:$c$] {};
                    node (b) at (3,0) [ocirc, label=right:$b$] {};
                    node (d) at (1.5,2) [ocirc, label=above:$d$] {};
                    node (e) at (1.5,-2)[ocirc, label=below:$e$] {};
                    
                    
                    path 
                    (a) edge           (d)
                    edge           (e)
                    (b) edge           (d)
                    edge           (e)
                    (d) edge           (c)
                    (c) edge           (e); 
    end{tikzpicture}
end{document}

A couple of examples for how to apply this to just one diagram:

documentclass{article}
usepackage{circuitikz}
begin{document}
    begin{tikzpicture}
         node (a) at (0,0) [ocirc, label=left:$a$] {};
    end{tikzpicture}
    
    begin{tikzpicture}
        ctikzset{nodes width=0.2} 
         node (a) at (0,0) [ocirc, label=left:$a$] {};
    end{tikzpicture}
    
    begin{tikzpicture}
         node (a) at (0,0) [ocirc, label=left:$a$] {};
    end{tikzpicture}
    
    begin{tikzpicture}[/tikz/circuitikz/nodes width=0.2]
         node (a) at (0,0) [ocirc, label=left:$a$] {};
    end{tikzpicture}

   begin{tikzpicture}
         node (a) at (0,0) [ocirc, label=left:$a$] {};
    end{tikzpicture}
    
end{document}

Correct answer by Torbjørn T. on June 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP