1

Is there a symbol for the trimmer capacitor in Circuitikz or a way to change the arrow of the variable capacitor to look like the trimmer capacitor symbol? I couldn't find anything concerning that in the Circuitikz 1.3.2 manual.

This enter image description here to something like thisenter image description here

My current solution is drawing a capacitor and drawing the "T" manually and I would really appreciate a better solution.

1 Answer 1

2

Will this do?

demo

\documentclass{standalone}
\usepackage{circuitikz}
\usepgflibrary{arrows.meta}

\makeatletter
%% Trimmed Capacitor
\pgfcircdeclarebipolescaled{capacitors}
{}
{\ctikzvalof{bipoles/vcapacitor/height}}
{tcapacitor}
{\ctikzvalof{bipoles/vcapacitor/height}}
{\ctikzvalof{bipoles/vcapacitor/width}}
{
    \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right

    \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
    \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
    \pgfusepath{draw}

    \pgfscope
        \pgfsetarrowsend{Bar}% changed
        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
        \pgfusepath{draw}
    \endpgfscope

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
    \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
    \pgfsetlinewidth{\pgfstartlinewidth}
    \pgfusepath{draw}
}
\pgfcirc@activate@bipole{l}{tcapacitor}{tcapacitor}{trimmed capacitor}
\pgfcirc@style@to@style{trimmed capacitor}{vC}
\makeatother

\begin{document}
\begin{circuitikz}
\draw (0,0) to[trimmed capacitor, mirror] (2,0);
\end{circuitikz}
\end{document} 
4
  • 2
    Nice! I think I will add an option to change the arrow tip of the "variable components".
    – Rmano
    Mar 17, 2021 at 10:38
  • I opened an issue: github.com/circuitikz/circuitikz/issues/504
    – Rmano
    Mar 17, 2021 at 10:47
  • @Rmano - Yup, that's how I'd do it too. Mar 17, 2021 at 15:17
  • In the next circuitikz version you'll be able to simply say \ctikzset{tunable end arrow={Bar}}. Thank you!
    – Rmano
    Apr 3, 2021 at 16:17

You must log in to answer this question.

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