A recent update of TikZ/pgf seems to have broken a newly defined command that came out of an earlier question of mine about crossing out terms in an equation.
Here's an MWE that illustrates the problem:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,tikzmark}
\newif\ifCancelToOverlay
\tikzset{CancelTo/.is family,
CancelTo,
angle/.initial=60,
name/.initial=tmp,
node/.style={},
arrow/.style={->},
topoffs/.initial=2pt,
nodeaboveoffs/.initial=1pt,
nodeleftoffs/.initial=0pt,
overlay/.is if=CancelToOverlay,
overlay=true
}
\newcommand{\CancelTo}[3][]{\bgroup\tikzset{CancelTo/.cd,#1}
\tikzmarknode{\pgfkeysvalueof{/tikz/CancelTo/name}}{#3}
\begin{tikzpicture}[overlay,remember picture]
\draw[/tikz/CancelTo/arrow] let \p1=($(\pgfkeysvalueof{/tikz/CancelTo/name}.north)-(\pgfkeysvalueof{/tikz/CancelTo/name}.south)$),\n1={0.5*\y1*cot(\pgfkeysvalueof{/tikz/CancelTo/angle})},\n2={\y1/sin(\pgfkeysvalueof{/tikz/CancelTo/angle})}
in ([xshift=-\n1]\pgfkeysvalueof{/tikz/CancelTo/name}.south) -- ++ (\pgfkeysvalueof{/tikz/CancelTo/angle}:\n2+\pgfkeysvalueof{/tikz/CancelTo/topoffs})
node[above left=\pgfkeysvalueof{/tikz/CancelTo/nodeaboveoffs} and \pgfkeysvalueof{/tikz/CancelTo/nodeleftoffs},inner sep=0pt,font=\scriptsize,/tikz/CancelTo/node] (tmplabel) {#2};
\path let \p1=($(tmplabel.north east)-(\pgfkeysvalueof{/tikz/CancelTo/name}.east)$) in
\pgfextra{\ifCancelToOverlay
\xdef\mydist{0pt}
\else
\xdef\mydist{\x1}
\fi};
\end{tikzpicture}\egroup\vphantom{\cancelto{#2}{#3}}\hspace{\mydist}}
\input{math-defs}
\begin{document}
\begin{equation*}
\CancelTo[nodeleftoffs=-11pt]{ignore}{\frac{x^2}{4}}
\end{equation*}
\end{document}
This code used to work, but now produces
! Package pgf Error: No shape named tmp is known.
See the pgf package documentation for explanation.
Type H <return> for immediate help.
...
l.39 ...nodeleftoffs=-11pt]{ignore}{\frac{x^2}{4}}
I'm running:
- pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019)
- pgf 2019/08/03 v3.1.4b (3.1.4b)
- tikz 2019/08/03 v3.1.4b (3.1.4b)
-interaction nonstopmodeas command line parameters topdflatex. – Skillmon Sep 24 '19 at 07:41-interaction nonstopmodeautomatically set. – Andrew Stacey Sep 24 '19 at 17:03