2

Since Czech standards (ČSN) do not accept the IEC standards, I have to draw an inductor with only 3 arcs. Is there any solution for CircuiTikZ? I have already saw some papers typsetted with LaTeX using CircuiTikZ, so I am sure, there is way how to tackle with it.

Thanks for any help.

2
  • Welcome to TeX.SE. Please, always add a MWE (Minimal Working Example) of your problem to illustrate what you already have got and to keep the burden from us in doing all the work for your. In your special case, a sketch of circuit would be helpful.
    – Jan
    Commented Mar 12, 2017 at 20:59
  • See recent version of circuitikz (Version 0.8 (2017-03-08)). There are some novelties also for inductors.
    – Zarko
    Commented Mar 12, 2017 at 21:29

1 Answer 1

3

The good news is that you can specify the number of coils with the american inductor and the cute inductor. The bad news is that there is a bug in the american inductor code.

\documentclass{standalone}
\usepackage{circuitikz}

\ctikzset{bipoles/cuteinductor/coils=3}
\ctikzset{bipoles/americaninductor/coils=3}
\ctikzset{bipoles/vcuteinductor/coils=3}% variable
\ctikzset{bipoles/vamericaninductor/coils=3}

\begin{document}
\begin{circuitikz}
\draw (0,0) to[cute inductor] (2,0)
      (0,1) to[american inductor] (2,1)
      (0,2) to[variable cute inductor] (2,2)
      (0,3) to[variable american inductor] (2,3);
\end{circuitikz}
\end{document}

demo


Here is the bug fix for the american inductor:

\makeatletter
%% american inductor

\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
    \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} 
    \pgftransformationadjustments
    \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
    \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
    \divide \pgf@circ@res@step by 2
    \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
  \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
    {\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}}
    \pgfsetbuttcap
    \pgfsetbeveljoin
    \pgfusepath{stroke}
}
\makeatother
1
  • The mentioned bug is already fixed since the latest release 0.8 last week :)
    – sistlind
    Commented Mar 16, 2017 at 21:00

You must log in to answer this question.

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