Skip to content

Commit

Permalink
pgfkeys: enhance edef keys, pgf-tikz#305
Browse files Browse the repository at this point in the history
This requires \expanded, which wasn't supported by pdftex and xetex
until texlive 2019.
  • Loading branch information
muzimuzhi committed Mar 24, 2021
1 parent 1671cf9 commit 2081482
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tex/generic/pgf/utilities/pgfkeys.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
\csname @@end\expandafter\endcsname\expandafter\end%
\fi

% e-TeX primitives and beyond

\ifx\contextversion\undefined
\let\pgfkeys@expanded \expanded
\let\pgfkeys@unexpanded \unexpanded
\else
\let\pgfkeys@expanded \normalexpanded
\let\pgfkeys@unexpanded \normalunexpanded
\fi


% Set a key to a value
%
% #1 = key
Expand Down Expand Up @@ -74,9 +85,8 @@
}

\long\def\pgfkeyssetevalue#1#2{%
\edef\pgfkeys@temp##1##2##3##4##5##6##7##8##9{#2}%
\pgfkeys@temptoks=\expandafter{\pgfkeys@temp{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}%
\expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}%
\expandafter\edef\csname pgfk@#1\endcsname
{\pgfkeys@unexpanded\expandafter{\pgfkeys@expanded{#2}}}%
}

% Add text to a key at the end
Expand Down

0 comments on commit 2081482

Please sign in to comment.