2

This code compils on texlive 2014, 2016 and with overleaf. With Texlive2017 impossible :! Missing number, treated as zero. and ! Illegal unit of measure (pt inserted).

\documentclass[10pt, a4paper]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[top=2.5cm, bottom=2cm, left=2cm , right=2cm]{geometry} %permet de définir les marges


\usepackage[utf8]{inputenc}          
\usepackage[T1]{fontenc}         


\usepackage{tikz}
\usepackage[europeanresistors,americaninductors]{circuitikz}

\usetikzlibrary{babel}

\makeatletter

\pgfdeclareshape{op amp eur}
    {
      \anchor{center}{\pgfpointorigin}
      \savedanchor\northwest{%
    \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
    %\pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}
        \pgf@y=.4\pgf@y
    \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
    %\pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}
        \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
        \pgf@x=.5\pgf@x
      }
      \anchor{south}{
        \northwest
        \pgf@y=-\pgf@y
      }
      \anchor{north}{
        \northwest
      }
      \savedanchor\left{%
        \pgf@y=0pt
      }
      \savedanchor\inOne{%
    \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
    %\pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}
        \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
        \pgf@y=.4\pgf@y
        \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
    \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
    %\pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}
        \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
        \pgf@x=.5\pgf@x
      }   
      \anchor{-}{
        \inOne
      }
      \anchor{+}{
        \inOne
        \pgf@y=-\pgf@y
      }
      \savedanchor\up{%
    \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
    %\pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}
        \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
        \pgf@y=.4\pgf@y
        \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
        \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
        \pgf@x=.5\pgf@x
            \pgf@circ@res@up = \pgf@y 
            \pgf@circ@res@right = -\pgf@x
            \pgf@circ@res@left = \pgf@x
        \pgfpointlineattime{
            \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
            \pgfpoint{
                \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
                {\pgf@circ@res@up}}
            {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
      }
      \anchor{up}{
        \up
      }
      \anchor{down}{
        \up
        \pgf@y=-\pgf@y
      }
      \anchor{out}{
        \northwest
        \pgf@y=0pt
        \pgf@x=-\pgf@x
      }
        \anchor{west}{
            \left
          }
          \anchor{east}{
            \left
            \pgf@x=-\pgf@x
          }  

      \backgroundpath{          
            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}   


            \northwest
            \pgf@circ@res@up = \pgf@y 
            \pgf@circ@res@down = -\pgf@y
            \pgf@circ@res@right = -\pgf@x
            \pgf@circ@res@left = \pgf@x

    \pgfpathmoveto{\pgfpoint
        {\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
    \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$}


    \pgfpathmoveto{\pgfpoint
        {\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
    \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
    \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$}

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
    \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}

    \pgfusepath{draw}


    \pgfscope
        \pgfsetlinewidth{2\pgflinewidth}
        \pgftransformxshift{.7\pgf@circ@res@left}
        \pgf@circ@res@step=\pgf@circ@res@right
        \advance\pgf@circ@res@step by -\pgf@circ@res@left
        \pgf@circ@res@step=.7\pgf@circ@res@step

        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}

        \pgftext[left, at=\pgfpoint{0.52\pgf@circ@res@step}{-0.6\pgf@circ@res@down}]{$\rhd \infty$}
        \pgfusepath{draw}
    \endpgfscope 
      }
    }
\makeatother

\begin{document}



\begin{tikzpicture}
    \draw (3,3) node[op amp eur](opamp){};
\end{tikzpicture}
\end{document}

Where does the problem come from?

3
  • can you put \pgfversion in the body of your documents in different versions. It will print out the version of TikZ
    – percusse
    Aug 20, 2017 at 10:17
  • TikZ version 3.0.1.a
    – nikopol
    Aug 20, 2017 at 10:37
  • 4
    circuitikz doesn't set the initial value of the bipole length anymore. Your code compile if I add \pgfkeys{/tikz/circuitikz/bipoles/length/.initial=1.4cm} . But you should ask the author if this is intended. Aug 20, 2017 at 11:06

1 Answer 1

2

Have a look at this commit.

Just use \pgf@circ@Rlen instead of \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}

Best regards, Stefan.

You must log in to answer this question.

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