-
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
Handle \relax and frozen \relax in tikz path #967
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what the CI thinks about this.
CI triggered by (isomorphic) commit hmenke@cb425a5 just gets passed. Discussions about code style here can still continue and I am willing to do a rebasing followed by force pushing at the end. |
b893845
to
43b4544
Compare
CI / build (dvisvgm) fails when setting up texlive environment, see https://github.com/pgf-tikz/pgf/pull/967/checks?check_run_id=1591472106#step:4:10
The CI for the same commit on my forked branch is ok. Guess this failure is caused by network problems. |
restarted just to double check |
I had to revert this. It broke |
Could you provide a specific broken example? I locally compiled the latest manual of |
Sure, sorry. The MWE was only communicated privately by @Rmano. \documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\pgfcircversion{} on \pgfversion
\begin{circuitikz}[american]
\draw (0,0) to [
R=R,
v=V,
i=I,
f=F,
] (3,0);
\end{circuitikz}
\end{document} bisection $ git bisect start
$ git bisect bad 3.1.8
$ git bisect good 3.1.7a
$ TEXMFHOME=/path/to/pgf git bisect run pdflatex --interaction=nonstopmode test.tex
[...]
79e613ae139f4e16f1f991114fe1a001d0dd9dab is the first bad commit
commit 79e613ae139f4e16f1f991114fe1a001d0dd9dab
Author: muzimuzhi <muzimuzhi@gmail.com>
Date: Tue Dec 22 05:24:18 2020 +0800
tikz: handle \relax and frozen \relax on path #966
tex/generic/pgf/frontendlayer/tikz/tikz.code.tex | 27 +++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
bisect run success |
@muzimuzhi @hmenke @muzimuzhi if you check out circuitikz 1.2.6, you can see the thing that puzzled me: if in the MWE you comment out just one of the decorations it will work. Just using the four of them (l= which is the same as giving the parameter to R, i=, f=, and v=) breaks. Comment one of them and it runs through. I tried to debug the core problem but it exceeds my TeX skills, and found almost by chance that an extra scope solved (or masked?) the problem. I am a bit busy today but I can help debugging. |
@Rmano No, I don't want you to add workarounds for PGF regressions. Please always report them, because you are most likely not the only one who is affected. |
Ok, let's see if I can understand why it broke, will remove the workaround in the next minor. My hunch, probably wrong, is that it was hitting some expansion limit, like the famous |
@hmenke If you referred to the chats on TeX-SX, they're public. See https://chat.stackexchange.com/transcript/message/56560034#56560034. I think the real cause is a hidden problem that The (expected) logic in
By introducing Some intermediate results that helped me when digging the problem:
|
@muzimuzhi If you want we can try again with your new patch. However, after thinking a bit more about this, encountering |
So, if I have understood correctly: that mechanism you describe is a safety mechanism to avoid infinity recursion --- but the counter was not reset so that using more than three "decorations" hit the limit value. So, adding the extra grouping made the changes to the counter local, and so it did not trigger the limit. Am I correct? |
@Rmano That describes it pretty accurately. You skipped the point where I fucked it up, though. |
:-; you can try to blame somebody else like in the chat, seems quite standard :-P |
Two discussions are mixed up. One for questioning why pgf 3.1.8 + circuitikz 1.2.6 is broken for some example, and another one for whether tikz should silently skipping The first one is what @Rmano is interested/involved in, if not the only one. And its cause is already uncovered. There is nothing wrong in circuitikz 1.2.6, but something wrong in pgf, especially 3.1.8. And that cause could have nothing to do with current PR if we adjusted the way to implement, for example the one originally posted in #966 (comment). Relax, it's ok if the second one didn't attract you. The second one is what this PR wanted to address. @hmenke My original purpose was to i) make the similar logic written in I don't have a strong opinion on both of them (about second one). |
In short, need some examples. |
I think we can handle |
Aha, seems another call for latex3 expandable macros |
Motivation for this change
As suggested in #966 (comment), this PR makes
\relax
and the frozen\relax
handled in tikz path parsing. An intro to frozen\relax
can be found in this TeX-SX answer andtexdoc interface3
, sec. XVI.7.PS: Perhaps
\tikz@frozen@relax@token
could be put inpgfutil-common.tex
.Fixes #966 (or, implements)
Checklist
Please check the boxes to explicitly state your agreement to these terms: