8

This is my very first question i'm going to ask here. Allready found very helpfull tips, so i hope you can help me.

I'm drawing a circuit with circuitikz. In there i only want to change the size of the resistor, but not of the other components. Therefore i used the commands \ctikzset{bipoles/resistor/height=0.15} and \ctikzset{bipoles/resistor/width=0.4}. This worked fine with american resistors but i'd like to use the european ones. Is there a simillar command for achieving this?

Here a minimal example:

\documentclass{minimal}

\usepackage{circuitikz}

\begin{document}

% original size
\begin{tikzpicture}
    \draw (0,0) to[R] (2,0) to[Do] (4,0);
    \ctikzset{resistor = european}
    \draw (6,0) to[R] (8,0) to[Do] (10,0);
\end{tikzpicture}

% shrink resistor
\ctikzset{resistor = american}
\ctikzset{bipoles/resistor/height=0.15}
\ctikzset{bipoles/resistor/width=0.4}
\begin{tikzpicture}
    \draw (0,0) to[R] (2,0) to[Do] (4,0);
    \ctikzset{resistor = european}
    \draw (6,0) to[R] (8,0) to[Do] (10,0); % this one is NOT smaller 
    % than the one above, but I WANT IT TO BE SMALLER
\end{tikzpicture}

\end{document}
1
  • Use the new resistors/scale= command in circuitikz.
    – skvery
    Jun 9, 2021 at 17:27

1 Answer 1

5

It seems to me as this is not possible in this way. bipoles/resistor/height and width has been hardcoded for the American variants. The only possibility I am seeing here is to change the length of the bipole. The length is a possible parameter of each bipole.

This could look like in my MWE below:

% arara: pdflatex

\documentclass[preview]{standalone}
\usepackage{circuitikz}

\begin{document}    
    % original size
    \begin{tikzpicture}
    \draw (0,0) to[R] (2,0) to[Do] (4,0);
    \ctikzset{resistor = european}
    \draw (6,0) to[R] (8,0) to[Do] (10,0);
    \end{tikzpicture}

    % shrink resistor
    \ctikzset{bipoles/resistor/height=0.15}
    \ctikzset{bipoles/resistor/width=0.4}
    \begin{tikzpicture}
    \draw (0,0) to[R] (2,0) to[Do] (4,0);
    \ctikzset{resistor = european}
    \draw (6,0) to [/tikz/circuitikz/bipoles/length=20pt, R] (8,0) to[Do] (10,0);
    \end{tikzpicture}   
\end{document}

enter image description here

1
  • 1
    Thank you for your quick help. With a \tikzset{rLength/.style={/tikz/circuitikz/bipoles/length=20pt}} i could shorten the to option measurably, cause i've got many resistors in my circuit.
    – Allaria
    Aug 4, 2014 at 13:09

You must log in to answer this question.

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