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

Error when using angle pic in another pic #1068

Closed
knuesel opened this issue Nov 2, 2021 · 2 comments · Fixed by #1069
Closed

Error when using angle pic in another pic #1068

knuesel opened this issue Nov 2, 2021 · 2 comments · Fixed by #1069

Comments

@knuesel
Copy link

knuesel commented Nov 2, 2021

Brief outline of the bug

Using the angle pic in the definition of a new pic triggers an error.

Minimal working example (MWE)

\documentclass[crop,tikz]{standalone}
\usetikzlibrary{angles}
\usetikzlibrary{quotes}
\begin{document}
\begin{tikzpicture}
    \tikzset{
        myangle/.pic={
            \draw (3,0) coordinate (A)
               -- (0,1) coordinate (B)
               -- (1,2) coordinate (C)
               pic [draw, "$\alpha$"] {angle};
        },
    }
    \pic { myangle };
\end{tikzpicture}
\end{document}

This produces the following error message:

! TeX capacity exceeded, sorry [grouping levels=255].
\XC@edef #1#2->\begingroup 
                           \ifnum \catcode `\!=13 \edef !{\string !}\fi \ifn...
l.14     \pic { myangle }
                         ;
!  ==> Fatal error occurred, no output PDF file produced!

Other people hit by this: see here (which suggests the workaround of using the angle pic in foreground code, but that doesn't seem to work in the case of this MWE) and here.

hmenke added a commit to hmenke/pgf that referenced this issue Nov 2, 2021
When angle (or right angle) pics appear within another pic, they may
cause a stack overflow because they don't reset /tikz/pics/code.
hmenke added a commit to hmenke/pgf that referenced this issue Nov 2, 2021
When angle (or right angle) pics appear within another pic, they may
cause a stack overflow because they don't reset /tikz/pics/code.

Signed-off-by: Henri Menke <henri@henrimenke.de>
@hmenke hmenke added the pic label Nov 2, 2021
@muzimuzhi
Copy link
Member

@knuesel Before next release, you can use ... pic [draw, "$\alpha$", pics/code=] {angle}; as a workaround.

@knuesel
Copy link
Author

knuesel commented Nov 3, 2021

Thanks for the fix and temporary workaround!

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

Successfully merging a pull request may close this issue.

3 participants