TikZ 座標シフトは新しいマシンでは異なる動作をする

TikZ 座標シフトは新しいマシンでは異なる動作をする

新しいコンピューターを使い始めたところ、以前使用した TikZ コードの 1 つが予期しない結果を生成しました。デバッグした後、次の MWE にたどり着きました。

\documentclass{article}
\usepackage{tikz}

\begin{document}
\thispagestyle{empty}
    \begin{tikzpicture}[remember picture,overlay]
        \coordinate  (CENTER) at (current page.center);
        \coordinate  (A) at ([xshift=1cm,yshift=-2cm] CENTER); %This coordinate is not shifted on PGF 3.1.5 running on texlive on windows; but it is shifted on PGFs 3.1 running on MacTex.
        \coordinate [xshift=1cm,yshift=-2cm] (B) at (CENTER); %This is shifted in both computers.

        \node at (CENTER) {XXX};
        \node at (A) {000};
        \node at (B) {111};
    \end{tikzpicture}
\end{document}

不思議なことに、シフトは座標 (A) に適用されないため、新しいマシン (Windows 上の新しいバニラ texlive、更新された PGF バージョン 3.1.5) でこのコードをコンパイルすると、座標 (A) は (CENTER) の上に残ります。ただし、以前のコンピューター (MACOS 上で PGF バージョン 3.1 の MacTex 2019 を実行) では、座標 (A) がシフトされるため、座標 (B) の上に表示されます。

この動作は座標では発生しますが、ノードでは発生しません。次のコードでは、ノード (A) と (B) は予想どおり同じ位置に表示されます。

\begin{tikzpicture}[remember picture,overlay]
    \node  (CENTER) at (current page.center) {XXX};
    \node  (A) at ([xshift=1cm,yshift=-2cm] CENTER) {000};
    \node [xshift=1cm,yshift=-2cm] (B) at (CENTER) {111};
\end{tikzpicture}%

なぜこのようなことが起こるのか知っている人はいますか? どこかにバグとして報告すべきでしょうか (どのように)? 新しいマシンでファイルをコンパイルするために、古いコードをすべて更新しなければならないのではないかと心配しています。

答え1

この問題は、すでにそれほど直接的ではないが、#809これは深刻な問題なので、修正プログラム 3.1.5aすでにリリースされており、数日以内に CTAN から入手できます。

その間に、アンリ・メンケ回避策を提供します:

\makeatletter
\def\tikz@@coordinate@at@math#1{%
  \pgf@process{#1}%
  \edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}%
  \expandafter\tikz@coordinate@caller\tikz@temp{}%
}%
\makeatother

3.1.5 の動作例:

\documentclass{article}
\usepackage{tikz}
\makeatletter
\def\tikz@@coordinate@at@math#1{%
  \pgf@process{#1}%
  \edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}%
  \expandafter\tikz@coordinate@caller\tikz@temp{}%
}%
\makeatother
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
  \coordinate (CENTER) at (current page.center);
  \coordinate (A) at ([xshift=1cm,yshift=-2cm] CENTER);
  \coordinate [xshift=1cm,yshift=-2cm] (B) at (CENTER); 
  \node at (CENTER) {XXX};
  \node at (A) {000};
  \node at (B) {111};
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

関連情報