Skip to content
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

Using @ in a nested .ecode does not work anymore (works in 3.0.1) #669

Closed
fshaked opened this issue Apr 30, 2019 · 4 comments
Closed

Using @ in a nested .ecode does not work anymore (works in 3.0.1) #669

fshaked opened this issue Apr 30, 2019 · 4 comments

Comments

@fshaked
Copy link

fshaked commented Apr 30, 2019

The minimal example below, which works with pgf 3.0.1, now fails with this error:

./test.tex:13: Undefined control sequence.
<inserted text> \some
                      @val
l.13 \tikzset{a}

The example:

\documentclass{article}
\usepackage{tikz}

\makeatletter
\def\some@val{}
\tikzset{
  a/.style={
    b/.ecode={\some@val},
  }
}
\makeatother

\tikzset{a}

\begin{document}
empty
\end{document}
@hmenke
Copy link
Member

hmenke commented Apr 30, 2019

Without having looked into this, it might be because of \scantokens in this bit

\long\def\pgfkeyssetevalue#1#2{%
\pgfkeys@temptoks={#2}%
\pgfkeys@temptoks=\scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}%
\expandafter\edef\csname pgfk@#1\expandafter\endcsname\expandafter{\the\pgfkeys@temptoks}%
}

which is unfortunately needed if /.code takes arguments. Otherwise you run into the hash doubling problem.

@hmenke hmenke added the pgfkeys label Apr 30, 2019
@hmenke
Copy link
Member

hmenke commented Apr 30, 2019

Workaround: Use \csname...\endcsname

\tikzset{
  a/.style={
    b/.ecode={\csname some@val\endcsname},
  }
}

@hmenke
Copy link
Member

hmenke commented Apr 30, 2019

Related: #305

@hmenke
Copy link
Member

hmenke commented Dec 15, 2019

@polgab You opened #305 long time ago and I merged your patch, but this led to the present issue. I'm tempted to revert back to the old behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants