From 00ef2e1f6f7ff70c1a1b0f586b3fc07189c992e6 Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sat, 11 Dec 2021 04:08:01 +0800 Subject: [PATCH 1/9] fix(animations): Add missing `\pgf@sys@tonumber` before `` "Private" implementations of `pgfmath` functions only accept unit-less numbers as their arguments, e.g., \pgfmathadd@{1.0}{1.0} So every dimension used as their argument must be prefixed by a `\pgf@sys@tonumber`, e.g., \pgfmathadd@{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y} This eliminates "Missing character" reports for `p` and `t`. Signed-off-by: muzimuzhi --- .../pgf/systemlayer/pgfsysanimations.code.tex | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex b/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex index 49ba41bfc..05bf9c332 100644 --- a/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex +++ b/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex @@ -890,7 +890,7 @@ % Interval too small: Goto end of interval \def\pgfmathresult{1.0}% \else% - \pgfmathdivide@{\pgf@ya}{\pgf@xa}% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% \fi% \pgf@x\pgfmathresult pt\relax% \expandafter\pgfsysanim@splitter\the\pgf@x% @@ -926,7 +926,7 @@ % Interval too small: Goto end of interval \def\pgfmathresult{1.0}% \else% - \pgfmathdivide@{\pgf@ya}{\pgf@xa}% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% \fi% \pgf@x\pgfmathresult pt\relax% \expandafter\pgfsysanim@splitter\the\pgf@x% @@ -971,7 +971,7 @@ % Interval too small: Goto end of interval \def\pgfmathresult{1.0}% \else% - \pgfmathdivide@{\pgf@ya}{\pgf@xa}% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% \fi% \pgf@x\pgfmathresult pt\relax% \expandafter\pgfsysanim@splitter\the\pgf@x% @@ -1001,7 +1001,8 @@ % Interval too small: Goto end of interval \def\pgfmathresult{1.0}% \else% - \pgfmathdivide@{\pgfsysanim@snap@repeat@arg}{\pgf@xa}% + % `\pgfsysanim@snap@repeat@arg` is a macro storing a dimen value, eg "4.0pt" + \pgfmathdivide@{\pgf@sys@tonumber\dimexpr\pgfsysanim@snap@repeat@arg}{\pgf@sys@tonumber\pgf@xa}% \fi% \pgf@x\pgfmathresult pt\relax% \expandafter\pgfsysanim@splitter\the\pgf@x% @@ -1823,7 +1824,7 @@ \def\pgfsysanim@frac@b{1}% \else% \let\pgfsysanim@divby\pgfmathresult% - \pgfmathsubtract@{\pgf@xc}{\pgfsysanim@prev@time}% + \pgfmathsubtract@{\pgf@sys@tonumber\pgf@xc}{\pgfsysanim@prev@time}% \pgfmathdivide@{\pgfmathresult}{\pgfsysanim@divby}% \ifdim\pgfmathresult pt<0pt\def\pgfmathresult{0}\fi% \ifdim\pgfmathresult pt>1pt\def\pgfmathresult{1}\fi% @@ -1875,7 +1876,7 @@ \pgf@ya\pgfsysanim@ft% \advance\pgf@ya by-\pgfsysanim@frac@a pt% \pgf@yb\pgf@x - \pgfmathreciprocal@{\pgf@yb}% + \pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% \ifdim\pgfmathresult pt>2.5pt% \def\pgfmathresult{2.5}% \fi% @@ -1906,7 +1907,7 @@ \pgf@ya\pgfsysanim@ft% \advance\pgf@ya by-\pgfsysanim@frac@a pt% \pgf@yb\pgf@x - \pgfmathreciprocal@{\pgf@yb}% + \pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% \ifdim\pgfmathresult pt>2.5pt% \def\pgfmathresult{2.5}% \fi% @@ -1938,7 +1939,7 @@ \pgf@ya\pgfsysanim@ft% \advance\pgf@ya by-\pgfsysanim@frac@a pt% \pgf@yb\pgf@x - \pgfmathreciprocal@{\pgf@yb}% + \pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% \ifdim\pgfmathresult pt>2.5pt% \def\pgfmathresult{2.5}% \fi% From 81f63abc38a6afc20cfb33a59dc79a7da59c4288 Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:19:58 +0800 Subject: [PATCH 2/9] fix(sys): Add missing `\pgf@sys@tonumber` before `` Signed-off-by: muzimuzhi --- tex/generic/pgf/systemlayer/pgfsys.code.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tex/generic/pgf/systemlayer/pgfsys.code.tex b/tex/generic/pgf/systemlayer/pgfsys.code.tex index fd87b0918..250db69b4 100644 --- a/tex/generic/pgf/systemlayer/pgfsys.code.tex +++ b/tex/generic/pgf/systemlayer/pgfsys.code.tex @@ -519,7 +519,7 @@ \pgf@ya#4% \advance\pgf@xa by-\pgf@x% \advance\pgf@ya by-\pgf@y% - \pgfmathdivide@\pgf@xa\pgf@ya% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@ya}% \let\aspectr\pgfmathresult% \pgf@xb#5% \pgf@yb#6% @@ -527,12 +527,12 @@ \pgf@yc#8% \advance\pgf@xc by-\pgf@xb% \advance\pgf@yc by-\pgf@yb% - \pgfmathdivide@\pgf@xc\pgf@yc% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@xc}{\pgf@sys@tonumber\pgf@yc}% \let\aspects\pgfmathresult% \ifdim\aspectr pt#9\aspects pt% - \pgfmathdivide@\pgf@xa\pgf@xc% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xc}% \else% - \pgfmathdivide@\pgf@ya\pgf@yc% + \pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@yc}% \fi% \advance\pgf@x by.5\pgf@xa% \advance\pgf@xb by.5\pgf@xc% From b65eddd2e96ac6b08ee700721bde3ea515fdd0af Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:20:58 +0800 Subject: [PATCH 3/9] fix(animations): Gobble `\pgf@stop` when parsing finishes This eliminates "Missing character" reports for `pgf@stop`, char by char. Signed-off-by: muzimuzhi --- tex/generic/pgf/modules/pgfmoduleanimations.code.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/generic/pgf/modules/pgfmoduleanimations.code.tex b/tex/generic/pgf/modules/pgfmoduleanimations.code.tex index 5384b1a71..c0a834681 100644 --- a/tex/generic/pgf/modules/pgfmoduleanimations.code.tex +++ b/tex/generic/pgf/modules/pgfmoduleanimations.code.tex @@ -648,7 +648,7 @@ \def\pgf@anim@protocol@path@size{% - \pgfutil@ifnextchar\pgf@stop\relax\pgf@anim@protocol@path@size@% + \pgfutil@ifnextchar\pgf@stop\pgfutil@gobble\pgf@anim@protocol@path@size@% }% \def\pgf@anim@protocol@path@size@#1#2#3{% \pgf@protocolanimsizes@direct{#2}{#3}% From e138ac70d0f50b69cf8cc03a9dbb45b715a6379e Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:25:38 +0800 Subject: [PATCH 4/9] fix(animations): Remove superfluous `/utils/exec` This eliminates "Missing character" reports for `/utils/exec`, char by char. Signed-off-by: muzimuzhi --- .../frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex index b917ad805..9a770a8e3 100644 --- a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex @@ -192,7 +192,7 @@ }% \def\tikz@animation@value@rest@base base{% - \tikz@anim@sync@scope{}{/utils/exec=\let\tikz@animation@time\tikz@anim@base@text\expandafter\tikz@anim@add\expandafter{\expandafter\tikz@anim@value\expandafter{\tikz@animation@value@head}}}{\tikz@anim@make@entry}% + \tikz@anim@sync@scope{}{\let\tikz@animation@time\tikz@anim@base@text\expandafter\tikz@anim@add\expandafter{\expandafter\tikz@anim@value\expandafter{\tikz@animation@value@head}}}{\tikz@anim@make@entry}% \pgfutil@ifnextchar\pgf@stop{\tikz@animation@value@rest=}{\tikz@animation@value@rest}% }% From cec1ee105210c05d3ba553bfdf6454b725f691a1 Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:28:12 +0800 Subject: [PATCH 5/9] fix(shapes): Remove superfluous `;` for shape `arrow box` Signed-off-by: muzimuzhi --- .../pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex b/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex index c2f06697c..be8cb3740 100644 --- a/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex +++ b/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex @@ -1308,7 +1308,7 @@ \arrowboxpoints% \ifdim\eastextend>0pt\relax% \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint% - \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}}; + \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}}% \else% \arrowboxcorner% \pgf@xa\pgf@x% @@ -1320,7 +1320,7 @@ \arrowboxpoints% \ifdim\westextend>0pt\relax% \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint% - \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}}; + \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}}% \else% \arrowboxcorner% \pgf@xa\pgf@x% @@ -1333,7 +1333,7 @@ \arrowboxpoints% \ifdim\eastextend>0pt\relax% \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint% - \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}}; + \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}}% \else% \arrowboxcorner% \pgf@xa\pgf@x% @@ -1345,7 +1345,7 @@ \arrowboxpoints% \ifdim\westextend>0pt\relax% \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint% - \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}}; + \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}}% \else% \arrowboxcorner% \pgf@xa\pgf@x% From 6d90ef5bfa4731e05a6f1902866db513cfe980e4 Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:34:00 +0800 Subject: [PATCH 6/9] fix(shapes): Wrap box content in `\pgfinterruptpicture` This eliminates "Missing character" reports for `logicgates` shapes when their gate symbols are typeset in text mode, e.g., nand gate IEC symbol=\color{black!30}\char`\& in engines other than LuaTeX. Signed-off-by: muzimuzhi --- .../circuits/pgflibraryshapes.gates.logic.IEC.code.tex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex index 69f27e7d0..115b3194c 100644 --- a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex +++ b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex @@ -55,7 +55,13 @@ % % Adjust for the width of the gate symbol. % - \setbox\pgf@hbox\hbox{{\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}}% add braces as color-aftergroup-fix TT + \setbox\pgf@hbox\hbox{% + % wrap in `\pgfinterruptpicture' to restore font, like how `\pgfnode` sets + % `\pgfnodeparttextbox` + \pgfinterruptpicture + {\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}% + \endpgfinterruptpicture + }% add braces as color-aftergroup-fix TT \pgf@xa.5\wd\pgf@hbox% \pgf@ya.5\ht\pgf@hbox% \advance\pgf@ya.5\dp\pgf@hbox% From 1e202a61b9d062a79332482321b54cf6e23e89af Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:38:34 +0800 Subject: [PATCH 7/9] docs: Remove superfluous `;` and `]` Signed-off-by: muzimuzhi --- doc/generic/pgf/pgfmanual-en-base-arrows.tex | 2 +- doc/generic/pgf/pgfmanual-en-base-transformations.tex | 4 ++-- doc/generic/pgf/pgfmanual-en-library-perspective.tex | 2 +- doc/generic/pgf/pgfmanual-en-pgfsys-animations.tex | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/generic/pgf/pgfmanual-en-base-arrows.tex b/doc/generic/pgf/pgfmanual-en-base-arrows.tex index 5d81abf79..290494d1c 100644 --- a/doc/generic/pgf/pgfmanual-en-base-arrows.tex +++ b/doc/generic/pgf/pgfmanual-en-base-arrows.tex @@ -110,7 +110,7 @@ \subsection{Terminology} \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis}; \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$}; - \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};; + \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$}; \end{tikzpicture} I have also added a coordinate system. The code for drawing an arrow tip always diff --git a/doc/generic/pgf/pgfmanual-en-base-transformations.tex b/doc/generic/pgf/pgfmanual-en-base-transformations.tex index afc5ed3d1..8277dc5cd 100644 --- a/doc/generic/pgf/pgfmanual-en-base-transformations.tex +++ b/doc/generic/pgf/pgfmanual-en-base-transformations.tex @@ -1032,7 +1032,7 @@ \subsubsection{Approximating Nonlinear Transformations Using Linear Transformati \pgfapproximatenonlineartransformation \draw [] (-10pt,-10pt) -- (10pt,10pt); \draw [] (10pt,-10pt) -- (-10pt,10pt); - \pgftext{foo}; + \pgftext{foo} \end{scope} \end{tikzpicture} \end{codeexample} @@ -1062,7 +1062,7 @@ \subsubsection{Approximating Nonlinear Transformations Using Linear Transformati \pgfapproximatenonlineartranslation \draw [] (-10pt,-10pt) -- (10pt,10pt); \draw [] (10pt,-10pt) -- (-10pt,10pt); - \pgftext{foo}; + \pgftext{foo} \end{scope} \end{tikzpicture} \end{codeexample} diff --git a/doc/generic/pgf/pgfmanual-en-library-perspective.tex b/doc/generic/pgf/pgfmanual-en-library-perspective.tex index 0c0518f92..fdf3718e9 100644 --- a/doc/generic/pgf/pgfmanual-en-library-perspective.tex +++ b/doc/generic/pgf/pgfmanual-en-library-perspective.tex @@ -294,7 +294,7 @@ \subsection{Examples} q = {(0,8,0)}, r = {(0,0,-8)}}] - \simplecuboid{2}{2}{2}] + \simplecuboid{2}{2}{2} \end{tikzpicture} \end{codeexample} diff --git a/doc/generic/pgf/pgfmanual-en-pgfsys-animations.tex b/doc/generic/pgf/pgfmanual-en-pgfsys-animations.tex index 2f115ca1b..8cab346cf 100644 --- a/doc/generic/pgf/pgfmanual-en-pgfsys-animations.tex +++ b/doc/generic/pgf/pgfmanual-en-pgfsys-animations.tex @@ -967,7 +967,7 @@ \subsection{Commands for Animating an Attribute: Transformations and Views} \scoped [meet={(-1,-2) (1,2)}, name=my view] { \draw (-5mm,-15mm) rectangle (7mm,8mm) node [font=\scriptsize, align=right, below left] - {target\\ view\\ box}; ; + {target\\ view\\ box}; \filldraw (0,0) circle [radius=3mm]; } } } \end{codeexample} From 01aedc441f73925ff67683a86dfe603541665db4 Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 21:39:18 +0800 Subject: [PATCH 8/9] docs: Promote `Missing character` to errors Signed-off-by: muzimuzhi --- doc/generic/pgf/pgfmanual-en-main-preamble.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/generic/pgf/pgfmanual-en-main-preamble.tex b/doc/generic/pgf/pgfmanual-en-main-preamble.tex index c26b54295..af4296a56 100644 --- a/doc/generic/pgf/pgfmanual-en-main-preamble.tex +++ b/doc/generic/pgf/pgfmanual-en-main-preamble.tex @@ -179,6 +179,10 @@ \usepackage[T1]{fontenc} \fi +% Promote `Missing character` reports to full errors +% require texlive 2021 or above +\tracinglostchars=3 + \graphicspath{{../../images/}} \input{pgfmanual-en-macros} From b30b657c4b87a2a6e82fb56274c607648076676a Mon Sep 17 00:00:00 2001 From: muzimuzhi Date: Sun, 12 Dec 2021 23:29:48 +0800 Subject: [PATCH 9/9] style: Comment has to go after the correct set of braces Co-authored-by: Henri Menke --- .../shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex index 115b3194c..4022cd605 100644 --- a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex +++ b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex @@ -59,9 +59,9 @@ % wrap in `\pgfinterruptpicture' to restore font, like how `\pgfnode` sets % `\pgfnodeparttextbox` \pgfinterruptpicture - {\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}% + {\pgfkeysvalueof{/pgf/#1 gate IEC symbol}}% add braces as color-aftergroup-fix TT \endpgfinterruptpicture - }% add braces as color-aftergroup-fix TT + }% \pgf@xa.5\wd\pgf@hbox% \pgf@ya.5\ht\pgf@hbox% \advance\pgf@ya.5\dp\pgf@hbox%