pgf
pgf copied to clipboard
Profiler documented code broken rendering
Version
3.1.9a
Details
In the Profiler Library, we can see:
There's a missing { before the 1, at the end of the line.
I checked the source code, and the { is actually there.
https://github.com/pgf-tikz/pgf/blob/89a9ef189a7420e0510fe97907285804bee4f670/doc/generic/pgf/pgfmanual-en-library-profiler.tex#L34-L36
So, I don't know how to fix this bug.
Note to myself: \pgfkeys is parsed specially, but for some reason that special parser jumps over the } and swallows the { after that.
Currently the code does not handle the case where a closing brace is encountered before the first opening brace, so it just keeps on scanning. This might fix it.
diff --git a/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex b/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
index d01b375a..c6c370ab 100644
--- a/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
+++ b/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
@@ -662,9 +662,22 @@
\the\t@afterpgfmanualprettyprinterhandlecollected
}%
\fi
+ \else\ifnum\c@pgfmanual@pretty@openbracecount<0
+ % we have somehow collected a closing brace too many
+ % reinsert it an back out
+ \edef\pgfmanual@loc@TMPc{\the\t@pgfmanual@allargs\the\t@pgfmanual@currentarg#1}%
+ \t@pgfmanual@allargs=\expandafter{\pgfmanual@loc@TMPc}%
+ \t@pgfmanual@currentarg={}%
+ % finish the loop
+ \edef\pgfmanual@pretty@collectargs@loop@NEXT{%
+ \noexpand\endgroup
+ \noexpand\def\noexpand\pgfmanualprettyprinternumcollectedargs{\the\c@pgfmanual@pretty@curargcount}%
+ \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@allargs}%
+ \the\t@afterpgfmanualprettyprinterhandlecollected
+ }%
\else
\t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
+ \fi\fi
\else
\ifnum13=\catcode`#1
% we found a white space (space, TAB or NL) or comment