Closed user202729 closed 6 months ago
Or, in a more general way, execute \tikz@uninstallcommands
and \tikz@installcommands
at the beginning and ending of \pgfextra
code, respectively? In this way, \path
and other tikz commands used in \pgfextra
code would take their definitions outside of tikzpicture
.
https://github.com/pgf-tikz/pgf/blob/12f17834c849a659b8829bbc9122bc459f585917/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex#L2558-L2566
Related to
Or, in a more general way, execute
\tikz@uninstallcommands
and\tikz@installcommands
at the beginning and ending of\pgfextra
code, respectively?
Hmm, No. The suggested way would disable (at least make it harder) use of
\pgfextra{\pgfinterruptpath \path ...; \endpgfinterruptpath}
This would break existing documents, therefore unfortunately rejected.
I think a document that issues \path
without \pgfinterruptpath
is buggy and should be fixed anyway.
Adding Tikz node in pgfextra triggers double drawing of containing path - TeX - LaTeX Stack Exchange (not exactly the same issue but related)
That said, we can just make it a warning. I see no harm (cf. pgfplots
run in stable mode by default, but upgrading pgfplots
may make the document issue an extra warning)
As in the title.
Disadvantage is that it will incur an additional check i.e. runtime penalty. Advantage is that it will prevent inadvertent errors in the code which can save user/developer's time.