pgf-tikz 与 texlive 2017 之间的错误

pgf-tikz 与 texlive 2017 之间的错误

此代码可在 texlive 2014、2016 和 overleaf 上编译。使用 Texlive2017 则无法编译! Missing number, treated as zero.! 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}

问题出在哪里?

答案1

看一下这次提交

只需使用\pgf@circ@Rlen即可\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}

谨致问候,斯蒂芬。

相关内容