Menu

#509 spurious spaces in \pgfmathdeclarefunction

TeX Live 2019
closed-fixed
None
5
2019-01-27
2019-01-26
U_Fischer
No

I'm not quite sure if this count as a bug. In the following example the definition of testA contains a spurious space. This space deplaces the bounding box of the resulting tikzpicture/plot but curiously only with pdflatex and lualatex. With xelatex both bounding boxes are fine.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\pgfmathdeclarefunction{testA}{1}{%
        \pgfmathparse{2} %spurious space
    }

\pgfmathdeclarefunction{testB}{1}{%
        \pgfmathparse{2}%
    }

xx\begin{tikzpicture}
\begin{axis}
  \addplot {testA(1)};
\end{axis}
\end{tikzpicture}yy

xx\begin{tikzpicture}
\begin{axis}
  \addplot {testB(1)};
\end{axis}
\end{tikzpicture}yy

\end{document}

Discussion

  • Henri Menke

    Henri Menke - 2019-01-27
    • status: open --> closed-fixed
    • assigned_to: Henri Menke
     
  • Henri Menke

    Henri Menke - 2019-01-27

    Fixed in https://sourceforge.net/p/pgf/git/ci/00f4e8d4154dcb3133ed4a106b6254b8faf874e2/ but it broke gcd. I hope it won't break too much else.

    As a little gimmick you can get a spaces inside the definition using ~ like in expl3.