Skip to content

Commit a55fc07

Browse files
committed
fix: expand functions before space trimming
Signed-off-by: Yukai Chou <[email protected]>
1 parent a4774c9 commit a55fc07

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tex/generic/pgf/frontendlayer/tikz/tikz.code.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,7 +3366,7 @@
33663366
\def\tikz@plot@filename{\tikz@plot@prefix\tikz@plot@id}%
33673367
\iftikz@plot@raw@gnuplot%
33683368
\def\tikz@plot@data{%
3369-
\pgfplotgnuplot[\tikz@plot@filename]{\pgfutil@trimspaces{#1}}}%
3369+
\pgfplotgnuplot[\tikz@plot@filename]{\pgfutil@trimspaces@e{#1}}}%
33703370
\else%
33713371
\iftikz@plot@parametric%
33723372
\def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
@@ -3375,13 +3375,13 @@
33753375
plot [t=\tikz@plot@domain]
33763376
[\tikz@plot@xrange]
33773377
[\tikz@plot@range]
3378-
\pgfutil@trimspaces{#1}}}%
3378+
\pgfutil@trimspaces@e{#1}}}%
33793379
\else%
33803380
\def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
33813381
set samples \tikz@plot@samples;
33823382
plot [x=\tikz@plot@domain]
33833383
\ifx\tikz@plot@range\pgfutil@empty\else[\tikz@plot@range]\fi
3384-
\pgfutil@trimspaces{#1}}}%
3384+
\pgfutil@trimspaces@e{#1}}}%
33853385
\fi%
33863386
\fi%
33873387
\tikz@@@plot%

tex/generic/pgf/modules/pgfmoduleplot.code.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@
490490
\pgfutil@read\pgfutil@inputcheck to\pgf@temp% ignored
491491
\pgfutil@read\pgfutil@inputcheck to\pgf@plot@line%
492492
\closein\pgfutil@inputcheck
493-
\edef\pgf@plot@code{#2}%
493+
\edef\pgf@plot@code{\pgfutil@trimspaces@e{#2}}% in case of leading spaces
494494
\ifx\pgf@plot@code\pgf@plot@line%
495495
\openin\pgfutil@inputcheck=\pgfretval\relax
496496
\ifeof\pgfutil@inputcheck%

tex/generic/pgf/utilities/pgfutil-common.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
\def\pgfutil@trimspaces@@#1Q#2{#1}
5050
\catcode`\Q=11
5151

52+
\def\pgfutil@trimspaces@e#1{%
53+
\expandafter\pgfutil@trimspaces\expandafter{\pgfutil@expanded{#1}}%
54+
}
55+
5256
% \pgfutil@ifx{<token 1>}{<token 2>}{<true code>}{<false code>}
5357
%
5458
% This macro is expandable.

0 commit comments

Comments
 (0)