pgf icon indicating copy to clipboard operation
pgf copied to clipboard

Commands/lines in code examples wrongly highlighted as comments

Open muzimuzhi opened this issue 5 years ago • 2 comments

Version: 3.1.7a

Some normal commands and/or whole lines in code examples are wrongly highlighted as comments.

  • page 864, code example for key /tikz/data visualization/arg1 from key, the \tikzset on last line is in gray. image
  • page 672, first code example in sec. 52.4 Externalizing Graphics, the whole line \usetikzlibrary{external} is in gray. image
  • More similar cases can be found in sec. 52.

muzimuzhi avatar Dec 14 '20 21:12 muzimuzhi

Can we have any idea how to fix that?

KZiemian avatar Sep 19 '22 21:09 KZiemian

Please test.

diff --git a/tex/latex/pgf/doc/pgfmanual-en-macros.tex b/tex/latex/pgf/doc/pgfmanual-en-macros.tex
index 68ecfffc..36497efc 100644
--- a/tex/latex/pgf/doc/pgfmanual-en-macros.tex
+++ b/tex/latex/pgf/doc/pgfmanual-en-macros.tex
@@ -1883,6 +1883,12 @@
     /codeexample/prettyprint/cs with args/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintcode{##2}}\pgfmanualclosebrace},
     /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
     /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintpgfkeys{##2}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/tikzset/.initial=1,
+    /codeexample/prettyprint/cs/tikzset/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintpgfkeys{##2}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/usetikzlibrary/.initial=1,
+    /codeexample/prettyprint/cs/usetikzlibrary/.code 2 args={\textcolor{cscolor}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\pgfmanualpdfref{##2}{##2}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/usepgflibrary/.initial=1,
+    /codeexample/prettyprint/cs/usepgflibrary/.code 2 args={\textcolor{cscolor}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\pgfmanualpdfref{##2}{##2}\pgfmanualclosebrace},
     /codeexample/prettyprint/cs arguments/begin/.initial=1,
     /codeexample/prettyprint/cs/begin/.code 2 args={\textcolor{black}{##1}\{\textcolor{cscolor}{\pgfmanualpdfref{##2}{\noligs{##2}}}\pgfmanualclosebrace},
     /codeexample/prettyprint/cs arguments/end/.initial=1,

hmenke avatar Sep 21 '22 19:09 hmenke