-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pgfkeys doesn't play well with edef keys #305
Comments
Migrated from SourceForge https://sourceforge.net/p/pgf/bugs/_discuss/thread/3fba4423/f5f2/attachment/patch.txt I add the PS: you may thank wipet on stackexchange that finds the way to define |
Migrated from SourceForge https://sourceforge.net/p/pgf/bugs/_discuss/thread/3fba4423/b608/attachment/pgfkeys-tests.tex PS: with a test document. |
Migrated from SourceForge https://sourceforge.net/p/pgf/bugs/_discuss/thread/3fba4423/a81a/attachment/pgfkeys.code.tex |
Migrated from SourceForge
|
Migrated from SourceForge Thank you for reporting and providing the patch. It is included now. |
Here my new test file (with #669 example) with .txt extension as github don't support .tex attached file! Can you reopen this issue? Thanks. |
Do you also have actual use-cases? Most of the stuff that you sent looks very contrived. |
You are right! |
Open issues don't look nice on the bug tracker but they don't hurt. I'll leave this open so we don't forget about it. |
(Not sure if I should open a new issue, but since this one is open ...) In
A full example demonstrating the problem in current implementation and the effect of Example\documentclass{article}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{pgfkeys}
% helper macros
% execute \pgfkeys{#1}, then inspect #2/.@cmd and #2/.@body
\def\showKey#1#2{
\pgfkeys{#1}
\begingroup
\large\bfseries After \textcolor{key}{\detokenize{#1}}
\endgroup
\par
\smallskip
\showcs{pgfk@#2/.@cmd}
\showcs{pgfk@#2/.@body}
\medskip
}
\def\showcs#1{
\makebox[100pt][l]{\expandafter\string\csname #1\endcsname} =
\expandafter\meaning\csname #1\endcsname\par
}
\begin{document}
\parindent=0pt
\ttfamily
\section{Handler \texttt{.code}}
\colorlet{key}{orange!90!black}
\showKey{/key/.code={\def\test##1{<##1>}}}{/key}
\showKey{/key/.add code={}{\test{#1}}}{/key}
\section{Handler \texttt{.ecode}, current implementation}
\colorlet{key}{magenta!90!black}
\showKey{/ekey/.ecode={\def\noexpand\test##1{<##1>}}}{/ekey}
\showKey{/ekey/.add code={}{\test{#1}}}{/ekey}
% c.f. https://tex.stackexchange.com/a/509706
\long\def\pgfkeyssetevalue#1#2{%
\expandafter\edef\csname pgfk@#1\endcsname
{\unexpanded\expandafter{\expanded{#2}}}%
}
\section{Handler \texttt{.ecode}, new implementation using \texttt{\string\expanded}}
\colorlet{key}{cyan!90!black}
\showKey{/ekey/.ecode={\def\noexpand\test##1{<##1>}}}{/ekey}
\showKey{/ekey/.add code={}{\test{#1}}}{/ekey}
\end{document} |
Yes, this issue has been a source of a lot of headache. I have thought about using |
Perhaps the compatibility reason is weaker than you thought, because it only happens when a user uses
To sum up, I think most users who upgrade |
This requires \expanded, which wasn't supported by pdftex and xetex until texlive 2019.
Migrated from SourceForge
Author: mirandole
Timestamp: 2014-04-06 10:24:37.816000
Example :
confer
pgfkeys.code.tex
line 608 :/.@body
is NOT expanded in the definition !!The text was updated successfully, but these errors were encountered: