summaryrefslogtreecommitdiff
path: root/graphics/pgf/base
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base')
-rw-r--r--graphics/pgf/base/README.md (renamed from graphics/pgf/base/README)0
-rw-r--r--graphics/pgf/base/doc/ChangeLog200
-rw-r--r--graphics/pgf/base/doc/FILES1
-rw-r--r--graphics/pgf/base/doc/RELEASE_NOTES.md6
-rw-r--r--graphics/pgf/base/doc/pgfmanual.pdfbin10580316 -> 10185873 bytes
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex3
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-guidelines.tex2
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-library-edges.tex3
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-library-fpu.tex3
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-library-math.tex22
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-math-parsing.tex13
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-pgfkeys.tex3
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-graphs.tex2
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-shapes.tex4
-rw-r--r--graphics/pgf/base/doc/text-en/pgfmanual-en-tutorial.tex2
-rw-r--r--graphics/pgf/base/tex/pgf.revision.tex8
-rw-r--r--graphics/pgf/base/tex/pgfcalendar.code.tex1
-rw-r--r--graphics/pgf/base/tex/pgfkeys.code.tex16
-rw-r--r--graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex18
-rw-r--r--graphics/pgf/base/tex/pgfmoduleshapes.code.tex37
-rw-r--r--graphics/pgf/base/tex/pgfsys-dvips.def2
-rw-r--r--graphics/pgf/base/tex/pgfsys-dvisvgm4ht.def83
-rw-r--r--graphics/pgf/base/tex/pgfsys.code.tex25
-rw-r--r--graphics/pgf/base/tex/pgfutil-common.tex110
-rw-r--r--graphics/pgf/base/tex/pgfutil-context.def7
-rw-r--r--graphics/pgf/base/tex/pgfutil-latex.def7
-rw-r--r--graphics/pgf/base/tex/pgfutil-plain.def7
-rw-r--r--graphics/pgf/base/tex/tikz.code.tex157
-rw-r--r--graphics/pgf/base/tex/tikzlibrarycalendar.code.tex30
-rw-r--r--graphics/pgf/base/tex/tikzlibrarymath.code.tex3
-rw-r--r--graphics/pgf/base/tex/tikzlibraryspy.code.tex6
31 files changed, 502 insertions, 279 deletions
diff --git a/graphics/pgf/base/README b/graphics/pgf/base/README.md
index 8be5668d45..8be5668d45 100644
--- a/graphics/pgf/base/README
+++ b/graphics/pgf/base/README.md
diff --git a/graphics/pgf/base/doc/ChangeLog b/graphics/pgf/base/doc/ChangeLog
index 4e3c19950c..62f9b71680 100644
--- a/graphics/pgf/base/doc/ChangeLog
+++ b/graphics/pgf/base/doc/ChangeLog
@@ -1,3 +1,203 @@
+2021-05-15 Henri Menke
+
+ - Release 3.1.9a
+
+2021-05-08 Henri Menke
+
+ - Merge pull request #1012 from TorbjornT/incontrol_doc
+
+2021-05-08 Torbjørn T
+
+ - Specify that relative coord is to end point
+
+2021-04-12 Henri Menke
+
+ - Merge pull request #1005 from kechtel/patch-1
+
+2021-04-12 Christoph Kecht
+
+ - Fix typo in guidelines on graphics
+
+2021-04-11 Henri Menke
+
+ - CI: Expire the cache
+
+2021-04-11 Henri Menke
+
+ - Merge pull request #1004 from michal-h21/patch-1
+
+2021-04-11 Michal Hoftich
+
+ - Update pgfsys-dvisvgm4ht.def
+
+2021-04-03 Henri Menke
+
+ - Merge pull request #1003 from tknuth/patch-1
+
+2021-04-03 Dr. Tobias Knuth
+
+ - fixed typo
+
+2021-04-02 muzimuzhi
+
+ - Merge pull request #977 from muzimuzhi/pgf-point-node-border
+
+2021-04-01 muzimuzhi
+
+ - adjust comments
+
+2021-01-16 muzimuzhi
+
+ - \pgfpointshapeborder: measure by distance < 0.02pt
+
+2021-01-14 muzimuzhi
+
+ - \pgfpointshapeborder: more doc words
+
+2021-01-13 muzimuzhi
+
+ - doc: use paired `` and ''
+
+2021-01-13 muzimuzhi
+
+ - \pgfpointshapeborder: doc new behavior
+
+2021-01-13 muzimuzhi
+
+ - pgf/shapes: add warning when \pgfpointshapeborder gives up
+
+2021-01-10 muzimuzhi
+
+ - pgf/shapes: improve \pgfpointshapeborder, #908
+
+2021-03-25 Henri Menke
+
+ - Merge pull request #1002 from muzimuzhi/edef-keys
+
+2021-03-24 muzimuzhi
+
+ - pgfkeys: enhance edef keys, #305
+
+2021-03-05 Henri Menke
+
+ - fixup! build: copy the README into the TDS archive
+
+2021-03-02 Henri Menke
+
+ - build: copy the README into the TDS archive
+
+2021-03-02 Henri Menke
+
+ - Release 3.1.9
+
+2021-03-02 Henri Menke
+
+ - Merge pull request #996 from muzimuzhi/dvips-blend-mode
+
+2021-02-28 muzimuzhi
+
+ - dvips: fix displacement after blend group, #995
+
+2021-02-24 muzimuzhi
+
+ - Revert "syntax is similar to METAPOST not METAFONT"
+
+2021-02-23 muzimuzhi
+
+ - Merge pull request #994 from itmm/master
+
+2021-02-22 Timm Knape
+
+ - syntax is similar to METAPOST not METAFONT
+
+2021-02-14 Henri Menke
+
+ - Merge pull request #992 from joel-coffman/dev/fix-code-2-args-documentation
+
+2021-02-13 Joel Coffman
+
+ - Correct documentation for .code 2 args second arg
+
+2021-01-22 Henri Menke
+
+ - Merge pull request #987 from muzimuzhi/doc-typo
+
+2021-01-22 muzimuzhi
+
+ - doc: fix typo #986
+
+2021-01-14 muzimuzhi
+
+ - Merge pull request #981 from muzimuzhi/fix-tikz@handle
+
+2021-01-14 muzimuzhi
+
+ - Apply suggestions from code review
+
+2021-01-13 muzimuzhi
+
+ - tikz: fix uses of \pgfutil@switch
+
+2021-01-11 Henri Menke
+
+ - Merge pull request #979 from muzimuzhi/doc-install-only
+
+2021-01-11 muzimuzhi
+
+ - doc/fpu: fpu: mark /pgf/fpu/install only as not experimental
+
+2020-12-25 Henri Menke
+
+ - Fix and document dim() #964
+
+2021-01-04 Henri Menke
+
+ - Merge pull request #976 from muzimuzhi/tikz-math
+
+2021-01-05 muzimuzhi
+
+ - tikz/math: gobble spaces between for list and loop body
+
+2021-01-04 Henri Menke
+
+ - Merge pull request #970 from muzimuzhi/reset-tikz@expandcount
+
+2021-01-05 muzimuzhi
+
+ - tikz: retry to handle \relax on path #966
+
+2021-01-04 Henri Menke
+
+ - tikz/calendar: switch over \pgf@let@token in \tikz@lib@cal@handle
+
+2021-01-02 Henri Menke
+
+ - Merge pull request #973 from schtandard/spurious_show
+
+2021-01-02 schtandard
+
+ - Remove a spurious \show
+
+2021-01-02 Henri Menke
+
+ - Merge pull request #972 from alisaaalehi/patch-1
+
+2021-01-02 Ali Salehi
+
+ - doc: fix typo
+
+2021-01-01 Henri Menke
+
+ - tikz: switch over \pgf@let@token in \tikz@handle
+
+2020-12-29 Henri Menke
+
+ - tikz: improve \tikz@expandcount handling
+
+2020-12-29 muzimuzhi
+
+ - tikz: reset \tikz@expandcount more frequent #969
+
2020-12-27 Henri Menke
- Release 3.1.8b
diff --git a/graphics/pgf/base/doc/FILES b/graphics/pgf/base/doc/FILES
index 98478c08d6..eee8e8ce0c 100644
--- a/graphics/pgf/base/doc/FILES
+++ b/graphics/pgf/base/doc/FILES
@@ -1,6 +1,7 @@
doc/generic/pgf/ChangeLog
doc/generic/pgf/FILES
doc/generic/pgf/INSTALL
+doc/generic/pgf/README.md
doc/generic/pgf/RELEASE_NOTES.md
doc/generic/pgf/description.html
doc/generic/pgf/extract.lua
diff --git a/graphics/pgf/base/doc/RELEASE_NOTES.md b/graphics/pgf/base/doc/RELEASE_NOTES.md
index 6fc188431c..9c9e4b60e8 100644
--- a/graphics/pgf/base/doc/RELEASE_NOTES.md
+++ b/graphics/pgf/base/doc/RELEASE_NOTES.md
@@ -1,5 +1 @@
-Hotfix for handling of TeX conditionals on a path. We can't forward \relax and
-frozen \relax through the parser because there is existing code that relies on
-this.
-
-The recommendation is to use expandable conditionals where possible.
+Emergency release to fix pgfplots which depends on unreleased parts of PGF.
diff --git a/graphics/pgf/base/doc/pgfmanual.pdf b/graphics/pgf/base/doc/pgfmanual.pdf
index 47b3273441..a309703c55 100644
--- a/graphics/pgf/base/doc/pgfmanual.pdf
+++ b/graphics/pgf/base/doc/pgfmanual.pdf
Binary files differ
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
index 29034d17cb..19499ec551 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-base-nodes.tex
@@ -601,6 +601,9 @@ commands:
\end{pgfpicture}
\end{codeexample}
%
+ \emph{Remark:} If the given \meta{point} is almost identical to the center
+ of \meta{node}, the node center is returned and a warning message will be
+ printed.
\end{command}
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-guidelines.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-guidelines.tex
index e59a2b19ec..fa29cce302 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-guidelines.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-guidelines.tex
@@ -320,7 +320,7 @@ is ``the graphic looks nicer than the table'', try to answer the following
questions based on the information in the table or in the graphic:
%
\begin{enumerate}
- \item How many participants where there?
+ \item How many participants were there?
\item How many participants returned the feedback form?
\item What percentage of the participants returned the feedback form?
\item How many participants checked ``very good''?
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-edges.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-edges.tex
index 7207fb1612..51332af0cc 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-edges.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-edges.tex
@@ -253,7 +253,8 @@ this curve looks can be influenced via a number of options.
%
\begin{key}{/tikz/in control=\meta{coordinate}}
This option causes the \meta{coordinate} to be used as the target
- control point.
+ control point. You can use a coordinate like |+(1,0)| to specify
+ a point relative to the \emph{end} coordinate.
\end{key}
%
\begin{key}{/tikz/controls=\meta{coordinate}| and |\meta{coordinate}}
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-fpu.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-fpu.tex
index 04989eef44..6c0f62f5f5 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-fpu.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-fpu.tex
@@ -179,7 +179,8 @@ by \pgfname.
\endgroup
\end{codeexample}
%
- \emph{This key is experimental and can change or disappear at any time!}
+ This key is introduced in \pgfname v3.1.6 and marked stable since \pgfname
+ v3.1.8.
\end{key}
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-math.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-math.tex
index 7f0b429f1b..8fabb4998e 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-library-math.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-library-math.tex
@@ -68,7 +68,7 @@ following command:
};
};
int \f, \i;
- for \i in {0,1,...,20}{
+ for \i in {0,1,...,20} {
\f = fibonacci(\i);
print {\f, };
};
@@ -86,8 +86,8 @@ In addition to this command the following key is provided:
\tikz[x=0.25cm,y=0.25cm,
evaluate={
int \i, \j;
- for \i in {0,...,10}{
- for \j in {0,...,10}{
+ for \i in {0,...,10} {
+ for \j in {0,...,10} {
\a{\i,\j} = (\i+\j)*5;
};
};
@@ -295,7 +295,7 @@ following keyword.
\subsection{Repeating Things}
-\begin{math-keyword}{{for} \meta{variable} \texttt{in \{}\meta{list}\texttt{\}\{}\meta{expressions}\texttt{\};}}
+\begin{math-keyword}{{for} \meta{variable} \texttt{in \{}\meta{list} \texttt{\}\{}\meta{expressions}\texttt{\};}}
This is a ``trimmed down'' version of the |\foreach| command available as
part of \pgfname\ and \tikzname, but cannot currently be used outside of
the |\tikzmath| command. It is important to note the following:
@@ -310,7 +310,7 @@ following keyword.
\tikzmath{
int \x, \v;
\v=1;
- for \x in {1,...,{random(3,10)}}{
+ for \x in {1,...,{random(3,10)}} {
\v=\v*2;
};
print {$x=\x, v=\v$};
@@ -333,8 +333,8 @@ following keyword.
\tikzmath{
int \x, \y;
\y = 0;
- for \x1 in {1,...,5}{
- for \x2 in {10,20,...,50}{
+ for \x1 in {1,...,5} {
+ for \x2 in {10,20,...,50} {
\y = \y+\x1*\x2;
};
};
@@ -365,7 +365,7 @@ of an expression. In this case the following keyword can be used:
\begin{tikzpicture}
\tikzmath{
int \x;
- for \k in {0,10,...,350}{
+ for \k in {0,10,...,350} {
if \k>260 then { let \c = orange; } else {
if \k>170 then { let \c = blue; } else {
if \k>80 then { let \c = red; } else {
@@ -409,7 +409,7 @@ You can add functions by using the following keywords:
function product(\x,\y) {
return \x*\y;
};
- int \i, \i, \k;
+ int \i, \j, \k;
\i = random(1,10);
\j = random(20, 40);
\k = product(\i, \j);
@@ -441,7 +441,7 @@ options. Firstly, the following keyword can be used:
\tikzmath{
int \x, \y, \z;
\x = random(2, 5);
- for \y in {0,...,6}{
+ for \y in {0,...,6} {
\z = \x^\y;
print {$\x^\y=\z$, };
};
@@ -462,7 +462,7 @@ executed inside a |tikzpicture|.
\draw [help lines] grid (3,2);
\tikzmath{
coordinate \c;
- for \x in {0,10,...,360}{
+ for \x in {0,10,...,360} {
\c = (1.5cm, 1cm) + (\x:1cm and 0.5cm);
{ \fill (\c) circle [radius=1pt]; };
};
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-math-parsing.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-math-parsing.tex
index d694ef7355..c0d32d4d9c 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-math-parsing.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-math-parsing.tex
@@ -484,7 +484,7 @@ The following functions are recognized:
\begin{tikzpicture}
\foreach \f [count=\i from 0] in
{abs,acos,add,and,array,asin,atan,atan2,bin,ceil,cos,
- cosec,cosh,cot,deg,depth,div,divide,e,equal,factorial, false,
+ cosec,cosh,cot,deg,depth,dim,div,divide,e,equal,factorial, false,
floor,frac,gcd,greater,height,hex,Hex,int,ifthenelse,iseven,isodd,isprime,
less,ln,log10,log2,max,min,mod,Mod,multiply,
neg,not,notequal,notgreater,notless,
@@ -1332,6 +1332,17 @@ some notable exceptions.
%
\end{math-function}
+\begin{math-function}{dim(\mvar{x})}
+\mathcommand
+ This returns the dimension of the array \mvar{x}. The array must begin and
+ end with braces (e.g., |{1,2,3,4}|).
+ %
+\begin{codeexample}[]
+\pgfmathparse{dim({1,2,3,4})} \pgfmathresult
+\end{codeexample}
+ %
+\end{math-function}
+
The following hyperbolic functions were adapted from code suggested by Martin
Heller:
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-pgfkeys.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-pgfkeys.tex
index 641bae58f2..95994059da 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-pgfkeys.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-pgfkeys.tex
@@ -1025,9 +1025,6 @@ A number of handlers exist for defining the code of keys.
\pgfkeys{/page size={30cm}{20cm}}
\end{codeexample}
%
- The second argument is optional: if it is not provided, it will be the
- empty string.
-
Because of the special way the \meta{value} is parsed, if you set
\meta{value} to, for instance, |first| (without any braces), then |#1| will
be set to |f| and |#2| will be set to |irst|.
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-graphs.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-graphs.tex
index bfe669c724..0135679c6e 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-graphs.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-graphs.tex
@@ -270,7 +270,7 @@ preamble) results in the following somewhat more pleasing rendering:
\subsubsection{Concept: Edge Labels and Styles}
When connectors like |->| or |--| are used to connect nodes or whole chain
-groups, one or more edges will typically be created. These edges can be styles
+groups, one or more edges will typically be created. These edges can be styled
easily by providing options in square brackets directly after these connectors:
%
\begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-shapes.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-shapes.tex
index eb23cd90d8..aa9b1a8962 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-shapes.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-tikz-shapes.tex
@@ -2627,6 +2627,10 @@ Section~\ref{section-node-coordinates}. Suppose you have said
Likewise, |(1,1)--(x)| will also have the line end on the border in the
direction coming from |(1,1)|.
+ If the specified coordinate is almost identical to the node center, for
+ example |(x)--(0,0)|, no line will be drawn and a warning message will
+ be printed.
+
In addition to |--|, the curve-to path operation |..| and the path
operations \verb!-|! and \verb!|-! will also handle nodes without
anchors correctly. Here is an example, see also
diff --git a/graphics/pgf/base/doc/text-en/pgfmanual-en-tutorial.tex b/graphics/pgf/base/doc/text-en/pgfmanual-en-tutorial.tex
index 7f334ddc7f..ae2c47cdc9 100644
--- a/graphics/pgf/base/doc/text-en/pgfmanual-en-tutorial.tex
+++ b/graphics/pgf/base/doc/text-en/pgfmanual-en-tutorial.tex
@@ -793,7 +793,7 @@ from where the sine ends:
\end{codeexample}
Note that there is no |--| between |(30:1cm)| and |++(0,-0.5)|. In detail, this
-path is interpreted as follows: ``First, the |(30:1cm)| tells me to move by pen
+path is interpreted as follows: ``First, the |(30:1cm)| tells me to move my pen
to $(\cos 30^\circ,1/2)$. Next, there comes another coordinate specification,
so I move my pen there without drawing anything. This new point is half a unit
down from the last position, thus it is at $(\cos 30^\circ,0)$. Finally, I move
diff --git a/graphics/pgf/base/tex/pgf.revision.tex b/graphics/pgf/base/tex/pgf.revision.tex
index 796c7fbe8a..18d9909178 100644
--- a/graphics/pgf/base/tex/pgf.revision.tex
+++ b/graphics/pgf/base/tex/pgf.revision.tex
@@ -5,10 +5,10 @@
\catcode`\:=12
\catcode`\+=12
\catcode`\-=12
-\gdef\pgfrevision{3.1.8b}
-\gdef\pgfversion{3.1.8b}
-\gdef\pgfversiondatetime{2020-12-27 19:52:45 +0100}
-\gdef\pgfrevisiondatetime{2020-12-27 19:52:45 +0100}
+\gdef\pgfrevision{3.1.9a}
+\gdef\pgfversion{3.1.9a}
+\gdef\pgfversiondatetime{2021-05-15 12:06:55 +0200}
+\gdef\pgfrevisiondatetime{2021-05-15 12:06:55 +0200}
\gdef\pgf@glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3}
\xdef\pgfversiondate{\expandafter\pgf@glob@TMPa\pgfversiondatetime\relax}
\xdef\pgfrevisiondate{\expandafter\pgf@glob@TMPa\pgfrevisiondatetime\relax}
diff --git a/graphics/pgf/base/tex/pgfcalendar.code.tex b/graphics/pgf/base/tex/pgfcalendar.code.tex
index 579b6dccea..a954d4adf0 100644
--- a/graphics/pgf/base/tex/pgfcalendar.code.tex
+++ b/graphics/pgf/base/tex/pgfcalendar.code.tex
@@ -789,7 +789,6 @@
}
\pgfkeys{/pgf/calendar/Easter/.cd,.default=0,.code={%
- \show\pgfcalendarifdateyear
\pgfcalendareastersunday{\pgfcalendarifdateyear}{\pgf@cal@easter@julianday}%
\ifnum\pgfcalendarifdatejulian=\pgfinteval{\pgf@cal@easter@julianday+#1}
\expandafter\pgfcalendarmatchestrue
diff --git a/graphics/pgf/base/tex/pgfkeys.code.tex b/graphics/pgf/base/tex/pgfkeys.code.tex
index db89141aca..184506a185 100644
--- a/graphics/pgf/base/tex/pgfkeys.code.tex
+++ b/graphics/pgf/base/tex/pgfkeys.code.tex
@@ -45,6 +45,17 @@
\csname @@end\expandafter\endcsname\expandafter\end%
\fi
+% e-TeX primitives and beyond
+
+\ifx\contextversion\undefined
+ \let\pgfkeys@expanded \expanded
+ \let\pgfkeys@unexpanded \unexpanded
+\else
+ \let\pgfkeys@expanded \normalexpanded
+ \let\pgfkeys@unexpanded \normalunexpanded
+\fi
+
+
% Set a key to a value
%
% #1 = key
@@ -74,9 +85,8 @@
}
\long\def\pgfkeyssetevalue#1#2{%
- \edef\pgfkeys@temp##1##2##3##4##5##6##7##8##9{#2}%
- \pgfkeys@temptoks=\expandafter{\pgfkeys@temp{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}%
- \expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}%
+ \expandafter\edef\csname pgfk@#1\endcsname
+ {\pgfkeys@unexpanded\expandafter{\pgfkeys@expanded{#2}}}%
}
% Add text to a key at the end
diff --git a/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex b/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
index 6d1ec5b6ab..859d8266a9 100644
--- a/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
+++ b/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
@@ -272,17 +272,21 @@
\pgfmathdeclarefunction{dim}{1}{%
\begingroup
\pgfmath@count=0\relax
- \expandafter\pgfmath@dim@i\pgfutil@firstofone#1\pgfmath@token@stop
+ \expandafter\pgfmath@dim@i\pgfutil@firstofone#1{\pgfmath@token@stop}%
\edef\pgfmathresult{\the\pgfmath@count}%
\pgfmath@smuggleone\pgfmathresult%
\endgroup}
-\def\pgfmath@dim@i#1{%
- \ifx\pgfmath@token@stop#1%
- \else
- \advance\pgfmath@count by 1\relax
- \expandafter\pgfmath@dim@i
- \fi}
+\def\pgfmath@dim@i#1#{%
+ \pgfutil@ifempty{#1}{}{\advance\pgfmath@count by 1}%
+ \pgfmath@dim@ii{#1}}
+
+\def\pgfmath@dim@ii#1#2{%
+ \ifx\pgfmath@token@stop#2%
+ \else
+ \advance\pgfmath@count by 1\relax
+ \expandafter\pgfmath@dim@i
+ \fi}
% max function.
diff --git a/graphics/pgf/base/tex/pgfmoduleshapes.code.tex b/graphics/pgf/base/tex/pgfmoduleshapes.code.tex
index a22aca4757..efef54af7a 100644
--- a/graphics/pgf/base/tex/pgfmoduleshapes.code.tex
+++ b/graphics/pgf/base/tex/pgfmoduleshapes.code.tex
@@ -617,7 +617,42 @@
\pgf@process{\pgf@shape@interpictureshift{#1}}%%
\advance\pgf@xa by-\pgf@x%
\advance\pgf@ya by-\pgf@y%
- \csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ % Now (\pgf@xa, \pgf@ya) is a coord in shape's coord system, and
+ % relative to the anchor "center". If (xa, ya) is almost identical to
+ % the node center, which is determined by sqrt(xa^2+ya^2) < 0.02pt,
+ % just return the node center.
+ %
+ % \pgf@xb = 10*\pgf@xa if -1pt<\pgf@xa<1pt else 10pt
+ % - "10*\pgf@xa": reduce ruonding errors when \pgf@xa is small
+ % - "-1pt<\pgf@xa<1pt": guard against error "Dimension too large"
+ \pgf@xb=10pt
+ \ifdim\pgf@xa<1pt\ifdim\pgf@xa>-1pt
+ \pgf@xb=10\pgf@xa
+ \fi\fi
+ % \pgf@yb = 10*\pgf@ya if -1pt<\pgf@ya<1pt else 10pt
+ \pgf@yb=10pt
+ \ifdim\pgf@ya<1pt\ifdim\pgf@ya>-1pt
+ \pgf@yb=10\pgf@ya
+ \fi\fi
+ % if xb^2+yb^2 < 0.04pt, which means sqrt(xa^2+ya^2) < 0.02pt,
+ % return node center
+ \ifdim\dimexpr\expandafter\Pgf@geT\the\pgf@xb\pgf@xb
+ +\expandafter\Pgf@geT\the\pgf@yb\pgf@yb\relax<0.04pt
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+ {% return coord of "center"
+ \pgfwarning
+ {Returning node center instead of a point on node border. Did you
+ specify a point identical to the center of node
+ ``\pgfreferencednodename''?}%
+ \pgf@sh@reanchor{\csname pgf@sh@ns@#1\endcsname}{center}%
+ }
+ {% this calls the corresponding \anchorborder in shape declaration
+ \csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ }%
\pgfsettransform{\csname pgf@sh@nt@#1\endcsname}%
\pgf@pos@transform@glob%
\global\pgf@x=\pgf@x%
diff --git a/graphics/pgf/base/tex/pgfsys-dvips.def b/graphics/pgf/base/tex/pgfsys-dvips.def
index 678fdd4d0b..8a791ff5ad 100644
--- a/graphics/pgf/base/tex/pgfsys-dvips.def
+++ b/graphics/pgf/base/tex/pgfsys-dvips.def
@@ -567,7 +567,7 @@
\wd#1=0pt
\ht#1=0pt
\dp#1=0pt
- \hskip\pgf@picminx\box#1%
+ \hskip\pgf@picminx\box#1\hskip-\pgf@picminx
\pgfsys@outerinvoke{%
/pgffoa pgf@sys@foa def /pgfsoa pgf@sys@soa def
grestore
diff --git a/graphics/pgf/base/tex/pgfsys-dvisvgm4ht.def b/graphics/pgf/base/tex/pgfsys-dvisvgm4ht.def
index 2853147a8d..4235c75d64 100644
--- a/graphics/pgf/base/tex/pgfsys-dvisvgm4ht.def
+++ b/graphics/pgf/base/tex/pgfsys-dvisvgm4ht.def
@@ -15,51 +15,68 @@
%
% Load common pdf commands:
%
- %\input pgfsys-dvisvgm.def
+
+% we load the dvips driver by default. it doesn't support patterns and some other stuff,
+% but it handles better nested images and some formatting. if you use patterns or if you
+% have other issues with the default method, pass the "tikz-dvisvgm" option to make4ht.
+\ifdefined\ifOption
+\ifOption{tikz+}{\input pgfsys-dvisvgm.def}{\input pgfsys-dvips.def}
+\else
+% load the dvips driver by default
\input pgfsys-dvips.def
+\fi
+
+\def\texfourht@tikz@begin{%
+ \bgroup%
+ \def\run@pict@cmd{}% insert the \Picture hooks only in the top nesting level
+ \def\end@pict@cmd{}%
+ \ifdefined\EndPicture\else% We are already inside command that uses \Picture
+ \ifdefined\inside@pict@cmd% handle nested uses
+ \else
+ % use different version of \Picture depending on the vertical mode
+ \ifvmode\def\run@pict@cmd{\Picture*}\else\def\run@pict@cmd{\Picture+}\fi%
+ \def\end@pict@cmd{\EndPicture}%
+ \fi\fi%
+ % command used to detect nesting
+ \def\inside@pict@cmd{}%
+ \csname a:tikzpicture\endcsname%
+}
+\def\texfourht@tikz@end{%
+ \csname b:tikzpicture\endcsname%
+ \egroup%
+}
\AtBeginDocument{
- % configure the output picture format to svg
+ \NewConfigure{tikzpicture}{2}
+ \catcode`\:=11
+ \Configure{tikzpicture}{%
+ \protect\csname nested:math\endcsname% support display math
+ \run@pict@cmd{}%
+ }{\end@pict@cmd}
+ % configure the output picture format to svg, as it will require dvisvgm
+ % post processing.
\Configure{Picture}{.svg}
- % insert tex4ht hook to the code used at the start and end of each TikZ picture
- \def\pgfsys@beginpicture{%
- \bgroup%
- \ifdefined\inside@pict@cmd% handle nested uses
- \def\run@pict@cmd{}% insert the \Picture hooks only in the top nesting level
- \def\end@pict@cmd{}%
- \else
- % use different version of \Picture depending on the vertical mode
- \ifvmode\def\run@pict@cmd{\Picture*}\else\def\run@pict@cmd{\Picture+}\fi%
- \def\end@pict@cmd{\EndPicture}%
- \fi%
- % command used to detect nesting
- \def\inside@pict@cmd{}%
- \csname a:tikzpicture\endcsname%
- \orig@pgfsys@begin%
- }%
- \def\pgfsys@endpicture{%
- \orig@pgfsys@end%
- \csname b:tikzpicture\endcsname%
- \egroup%
- \par%
- }%
+ % insert tex4ht hooks around TikZ picture box
+ \def\pgfsys@typesetpicturebox#1{%
+ \texfourht@tikz@begin%
+ \orig@pgfsys@typesetpicturebox{#1}%
+ \texfourht@tikz@end%
+ }
+ %
+ \ConfigureEnv{tikzpicture}{\ifvmode\Picture*{}\else\Picture+{}\fi\def\inside@pict@cmd{}}{\EndPicture}{}{}
+ \ConfigureEnv{pgfpicture}{\ifvmode\Picture*{}\else\Picture+{}\fi\def\inside@pict@cmd{}}{\EndPicture}{}{}
+ \catcode`\:=12
}
% Make the code inserted by tex4ht configurable
+%
-\NewConfigure{tikzpicture}{2}
-\Configure{tikzpicture}{%
- % \ifvmode\IgnorePar\fi\EndP%\HtmlParOff
- \protect\csname nested:math\endcsname% support display math
- \run@pict@cmd{}%
-}{\end@pict@cmd}
-\let\orig@pgfsys@begin\pgfsys@beginpicture
-\let\orig@pgfsys@end\pgfsys@endpicture
-\def\pgf@sys@postscript@header#1{{\special{! #1}}}
+\let\orig@pgfsys@typesetpicturebox\pgfsys@typesetpicturebox
+%\def\pgf@sys@postscript@header#1{{\special{! #1}}}
\endinput
diff --git a/graphics/pgf/base/tex/pgfsys.code.tex b/graphics/pgf/base/tex/pgfsys.code.tex
index 000eef098c..fd87b09181 100644
--- a/graphics/pgf/base/tex/pgfsys.code.tex
+++ b/graphics/pgf/base/tex/pgfsys.code.tex
@@ -1715,7 +1715,30 @@
% inserted into the resulting .pdf/.ps/.xxx file.
-
+% String comparison
+\ifdefined\pdfstrcmp
+ \let\pgfsys@strcmp\pdfstrcmp
+\else\ifdefined\strcmp
+ \let\pgfsys@strcmp\strcmp
+\else\ifdefined\directlua
+ \directlua{
+ local lft = lua.get_functions_table()
+ lft[\string#lft+1] = function()
+ local lhs = token.scan_string()
+ local rhs = token.scan_string()
+ if lhs < rhs then
+ tex.sprint(-2, "-1")
+ elseif lhs == rhs then
+ tex.sprint(-2, "0")
+ else
+ tex.sprint(-2, "1")
+ end
+ end
+ token.set_lua("pgfsys@strcmp", \string#lft, "global")
+ }
+\else
+ \def\pgfsys@strcmp#1#2{\pgf@sys@fail{string comparison}}%
+\fi\fi\fi
% Discern the driver:
diff --git a/graphics/pgf/base/tex/pgfutil-common.tex b/graphics/pgf/base/tex/pgfutil-common.tex
index 37210d4870..952af70f55 100644
--- a/graphics/pgf/base/tex/pgfutil-common.tex
+++ b/graphics/pgf/base/tex/pgfutil-common.tex
@@ -32,6 +32,10 @@
\newif\ifpgfutil@format@is@plain
\newif\ifpgfutil@format@is@context
+% Aliases
+
+\let\pgfutil@exp\romannumeral
+\chardef\pgfutil@exp@end=0
% Simple stuff
@@ -45,13 +49,43 @@
\def\pgfutil@trimspaces@@#1Q#2{#1}
\catcode`\Q=11
-% \pgfutil@ifempty{<cs>}{<true code>}{<false code>}
+% \pgfutil@ifx{<token 1>}{<token 2>}{<true code>}{<false code>}
+%
+% This macro is expandable.
+\long\def\pgfutil@ifx#1#2{%
+ \ifx#1#2%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}
+
+% \pgfutil@ifstrequal{<lhs>}{<rhs>}{<true code>}{<false code>}
%
-% Check if <cs> is equal to \pgfutil@empty
+% Check if <lhs> and <rhs> are equal by string comparison
%
% This macro is expandable.
-\def\pgfutil@ifempty#1{%
- \ifx#1\pgfutil@empty
+\long\def\pgfutil@ifstrequal#1#2{%
+ \ifnum\pgfsys@strcmp{\pgfutil@unexpanded{#1}}{\pgfutil@unexpanded{#2}}=0
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi
+}
+
+% \pgfutil@ifxempty{<token 1>}{<true code>}{<false code>}
+%
+% Shortcut for \pgfutil@ifx\pgfutil@empty{<token 1>}{<true code>}{<false code>}
+%
+% This macro is expandable.
+\def\pgfutil@ifxempty{\pgfutil@ifx\pgfutil@empty}
+
+% pgfutil@ifempty
+%
+% Check if #1 is empty. No expansion is performed on #1.
+%
+% This macro is expandable.
+\long\def\pgfutil@ifempty#1{%
+ \if\relax\detokenize{#1}\relax
\expandafter\pgfutil@firstoftwo
\else
\expandafter\pgfutil@secondoftwo
@@ -64,11 +98,7 @@
%
% This macro is expandable.
\def\pgfutil@ifundefined#1{%
- \expandafter\ifx\csname#1\endcsname\relax
- \expandafter\pgfutil@firstoftwo
- \else
- \expandafter\pgfutil@secondoftwo
- \fi}
+ \expandafter\pgfutil@ifx\csname#1\endcsname\relax}
% A variant of \pgfutil@ifundefined which will NOT let #1 to \relax it
% is undefined.
@@ -79,6 +109,7 @@
\expandafter\pgfutil@firstoftwo
\fi
}
+
\long\def\pgfutil@firstofone#1{#1}
\long\def\pgfutil@firstoftwo#1#2{#1}
\long\def\pgfutil@secondoftwo#1#2{#2}
@@ -222,45 +253,42 @@
\def\pgfutil@iterate{\pgfutil@body \let\pgfutil@next\pgfutil@iterate \else\let\pgfutil@next\relax\fi \pgfutil@next}
\let\pgfutil@repeat=\fi % this makes \loop...\if...\repeat skippable
-
% \pgfutil@switch
%
-% #1: string to switch on
-% #2: sequence of label-value pairs
+% #1: comparison function of the form
+% \comp{<lhs>}{<rhs>}{<true code>}{<false code>}
+% Has to be expandable!
+% #2: lhs
+% #3: sequence of rhs-value pairs
+% #4: default statement in case of match
+% #5: default statement in case of no match
%
% Example:
%
-% \pgfutil@switch{foo}{%
-% {foo}{1}%
-% {bar}{2}%
-% {default}{X}%
-% }
-%
-% If a statement with the label `default' exists it will be executed
-% if no other label matches.
-
-\long\def\pgfutil@switch#1#2{%
- \begingroup
- \def\pgfutil@switch@selected{}%
- \pgfutil@switch@collect@statements#2{}{}%
- \ifcsname pgfutil@switch@choice@\detokenize{#1}\endcsname
- \expandafter\let\expandafter\pgfutil@switch@selected\csname pgfutil@switch@choice@\detokenize{#1}\endcsname
- \else
- \ifdefined\pgfutil@switch@choice@default
- \let\pgfutil@switch@selected\pgfutil@switch@choice@default
- \fi
- \fi
- \expandafter\endgroup\pgfutil@switch@selected
+% \pgfutil@switch\pgfutil@ifx\pgf@let@token{%
+% {(}{\tikz@movetoabs}%)
+% {+}{\tikz@movetorel}%
+% {-}{\tikz@lineto}%
+% }{}{\tikz@expand}
+
+\let\pgfutil@scan@mark\relax
+\let\pgfutil@scan@stop\relax
+
+\long\def\pgfutil@switch#1#2#3#4#5{%
+ \pgfutil@exp
+ \pgfutil@switch@@{#1}%
+ {#2}#3% user-defined cases
+ {#2}{}% default case
+ \pgfutil@scan@mark{#4}% true code
+ \pgfutil@scan@mark{#5}% false code
+ \pgfutil@scan@stop
}
-
-\long\def\pgfutil@switch@collect@statements#1{%
- \if\relax\detokenize{#1}\relax
- \else
- \afterassignment\pgfutil@switch@collect@statements
- \expandafter\def\csname pgfutil@switch@choice@\detokenize{#1}\expandafter\endcsname
- \fi
+\long\def\pgfutil@switch@@#1#2#3#4{%
+ #1{#2}{#3}%
+ {\pgfutil@switch@end{#4}}%
+ {\pgfutil@switch@@{#1}{#2}}%
}
-
+\long\def\pgfutil@switch@end#1#2#3\pgfutil@scan@mark#4#5\pgfutil@scan@stop{\pgfutil@exp@end#1#4}
% aux-read-hook
diff --git a/graphics/pgf/base/tex/pgfutil-context.def b/graphics/pgf/base/tex/pgfutil-context.def
index 651b1cd169..eddab09aba 100644
--- a/graphics/pgf/base/tex/pgfutil-context.def
+++ b/graphics/pgf/base/tex/pgfutil-context.def
@@ -367,10 +367,7 @@
% e-TeX primitives
-\pgfutil@IfUndefined{normalprotected}{%
- \def\pgfutil@protected{}%
-}{%
- \let\pgfutil@protected\normalprotected
-}
+\let\pgfutil@protected\normalprotected
+\let\pgfutil@unexpanded\normalunexpanded
\endinput
diff --git a/graphics/pgf/base/tex/pgfutil-latex.def b/graphics/pgf/base/tex/pgfutil-latex.def
index a21f3b4d63..07a7fb1a4b 100644
--- a/graphics/pgf/base/tex/pgfutil-latex.def
+++ b/graphics/pgf/base/tex/pgfutil-latex.def
@@ -208,10 +208,7 @@
% e-TeX primitives
-\pgfutil@IfUndefined{protected}{%
- \def\pgfutil@protected{}%
-}{%
- \let\pgfutil@protected\protected
-}
+\let\pgfutil@protected\protected
+\let\pgfutil@unexpanded\unexpanded
\endinput
diff --git a/graphics/pgf/base/tex/pgfutil-plain.def b/graphics/pgf/base/tex/pgfutil-plain.def
index 58fa3eac5f..2d08c5303f 100644
--- a/graphics/pgf/base/tex/pgfutil-plain.def
+++ b/graphics/pgf/base/tex/pgfutil-plain.def
@@ -337,10 +337,7 @@
% e-TeX primitives
-\pgfutil@IfUndefined{protected}{
- \def\pgfutil@protected{}%
-}{%
- \let\pgfutil@protected\protected
-}
+\let\pgfutil@protected\protected
+\let\pgfutil@unexpanded\unexpanded
\endinput
diff --git a/graphics/pgf/base/tex/tikz.code.tex b/graphics/pgf/base/tex/tikz.code.tex
index f848487e70..d5244e9e85 100644
--- a/graphics/pgf/base/tex/tikz.code.tex
+++ b/graphics/pgf/base/tex/tikz.code.tex
@@ -2105,7 +2105,7 @@
\tikz@snakedfalse%
\tikz@decoratepathfalse%
\tikz@node@is@a@labelfalse%
- \tikz@expandcount=100\relax%
+ \tikz@resetexpandcount
\pgf@path@lastx=0pt%
\pgf@path@lasty=0pt%
\tikz@lastx=0pt%
@@ -2123,125 +2123,42 @@
\afterassignment\tikz@handle\let\pgf@let@token=%
}%
\newcount\tikz@expandcount
+\def\tikz@resetexpandcount{\tikz@expandcount=100\relax}
\let\tikz@collected@onpath=\pgfutil@empty%
+\edef\tikz@frozen@relax@token{\ifnum0=0\fi}
+
% Central dispatcher for commands
\def\tikz@handle{%
- \let\pgfutil@next=\tikz@expand%
- \ifx\pgf@let@token(%)
- \let\pgfutil@next=\tikz@movetoabs%
- \else%
- \ifx\pgf@let@token+%
- \let\pgfutil@next=\tikz@movetorel%
- \else%
- \ifx\pgf@let@token-%
- \let\pgfutil@next=\tikz@lineto%
- \else%
- \ifx\pgf@let@token.%
- \let\pgfutil@next=\tikz@dot%
- \else%
- \ifx\pgf@let@token r%
- \let\pgfutil@next=\tikz@rect%
- \else%
- \ifx\pgf@let@token n%
- \let\pgfutil@next=\tikz@fig%
- \else%
- \ifx\pgf@let@token[%]
- \let\pgfutil@next=\tikz@parse@options%
- \else%
- \ifx\pgf@let@token c%
- \let\pgfutil@next=\tikz@cchar%
- \else%
- \ifx\pgf@let@token\bgroup%
- \let\pgfutil@next=\tikz@beginscope%
- \else%
- \ifx\pgf@let@token\egroup%
- \let\pgfutil@next=\tikz@endscope%
- \else%
- \ifx\pgf@let@token;%
- \let\pgfutil@next=\tikz@finish%
- \else%
- \let\pgfutil@next=\tikz@handle@more%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfutil@next%
-}%
-
-% Continued...
-\def\tikz@handle@more{%
- \ifx\pgf@let@token a%
- \let\pgfutil@next=\tikz@a@char%
- \else%
- \ifx\pgf@let@token e%
- \let\pgfutil@next=\tikz@e@char%
- \else%
- \ifx\pgf@let@token g%
- \let\pgfutil@next=\tikz@g@char%
- \else%
- \ifx\pgf@let@token s%
- \let\pgfutil@next=\tikz@schar%
- \else%
- \ifx\pgf@let@token |%
- \let\pgfutil@next=\tikz@vh@lineto%
- \else%
- \ifx\pgf@let@token p%
- \let\pgfutil@next=\tikz@pchar%
- \pgfsetmovetofirstplotpoint%
- \else%
- \ifx\pgf@let@token t%
- \let\pgfutil@next=\tikz@to%
- \else%
- \ifx\pgf@let@token\pgfextra%
- \let\pgfutil@next=\tikz@extra%
- \else%
- \ifx\pgf@let@token\foreach%
- \let\pgfutil@next=\tikz@foreach%
- \else%
- \ifx\pgf@let@token f%
- \let\pgfutil@next=\tikz@fchar%
- \else%
- \ifx\pgf@let@token\pgf@stop%
- \let\pgfutil@next=\relax%
- \else%
- \ifx\pgf@let@token\par%
- \let\pgfutil@next=\tikz@scan@next@command%
- \else%
- \ifx\pgf@let@token d%
- \let\pgfutil@next=\tikz@decoration%
- \else%
- \ifx\pgf@let@token l%
- \let\pgfutil@next=\tikz@l@char%
- \else%
- \ifx\pgf@let@token:%
- \let\pgfutil@next=\tikz@colon@char%
- \else%
- \let\pgfutil@next=\tikz@expand%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \ifx\pgfutil@next\tikz@expand\else\tikz@expandcount=100\relax\fi%
- \pgfutil@next%
+ \pgfutil@switch\pgfutil@ifx\pgf@let@token{%
+ {(}{\let\pgfutil@next\tikz@movetoabs}%)
+ {+}{\let\pgfutil@next\tikz@movetorel}%
+ {-}{\let\pgfutil@next\tikz@lineto}%
+ {.}{\let\pgfutil@next\tikz@dot}%
+ {r}{\let\pgfutil@next\tikz@rect}%
+ {n}{\let\pgfutil@next\tikz@fig}%
+ {[}{\let\pgfutil@next\tikz@parse@options}%]
+ {c}{\let\pgfutil@next\tikz@cchar}%
+ {\bgroup}{\let\pgfutil@next\tikz@beginscope}%
+ {\egroup}{\let\pgfutil@next\tikz@endscope}%
+ {;}{\let\pgfutil@next\tikz@finish}%
+ {a}{\let\pgfutil@next\tikz@a@char}%
+ {e}{\let\pgfutil@next\tikz@e@char}%
+ {g}{\let\pgfutil@next\tikz@g@char}%
+ {s}{\let\pgfutil@next\tikz@schar}%
+ {|}{\let\pgfutil@next\tikz@vh@lineto}%
+ {p}{\pgfsetmovetofirstplotpoint\let\pgfutil@next\tikz@pchar}%
+ {t}{\let\pgfutil@next\tikz@to}%
+ {\pgfextra}{\let\pgfutil@next\tikz@extra}%
+ {\foreach}{\let\pgfutil@next\tikz@foreach}%
+ {f}{\let\pgfutil@next\tikz@fchar}%
+ {\pgf@stop}{\let\pgfutil@next\relax}%
+ {\par}{\let\pgfutil@next\tikz@scan@next@command}%
+ {d}{\let\pgfutil@next\tikz@decoration}%
+ {l}{\let\pgfutil@next\tikz@l@char}%
+ {:}{\let\pgfutil@next\tikz@colon@char}%
+ {\relax}{\relax\let\pgfutil@next\tikz@scan@next@command}%
+ }{\tikz@resetexpandcount\pgfutil@next}{\tikz@expand}%
}%
\def\tikz@l@char{%
@@ -4093,7 +4010,7 @@
\pgfutil@for\pgf@temp:=\tikz@common@matrix@code@styleorder\do{%
\toks0=\expandafter{\romannumeral-`0\expandafter\pgfutil@trimspaces\expandafter{\pgf@temp}}%
\def\pgf@marshal{}%
- \pgfutil@ifempty\pgf@temp{}{%
+ \pgfutil@ifxempty\pgf@temp{}{%
\edef\pgf@marshal{\noexpand\tikzset{matrix/inner style/.cd,\the\toks0}}%
}%
\pgf@marshal
@@ -4754,8 +4671,8 @@
\expandafter\expandafter\expandafter\tikz@parse@child@node%
\fi%
}%
-\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@expandcount=100\relax\def\tikz@child@node@rest{#1}}%
-\def\tikz@parse@child@node@c c{\tikz@expandcount=100\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}%
+\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@resetexpandcount\def\tikz@child@node@rest{#1}}%
+\def\tikz@parse@child@node@c c{\tikz@resetexpandcount\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}%
\def\tikz@parse@child@node@co o{\pgfutil@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}}%
\def\tikz@parse@child@node@coordinate ordinate{%
\pgfutil@ifnextchar ({\tikz@@parse@child@node@coordinate}{%
@@ -4777,7 +4694,7 @@
\expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text@pre\tikz@marshal}%
\tikz@parse@child@node@rest%
}%
-\def\tikz@parse@child@node@n node{\tikz@expandcount=100%
+\def\tikz@parse@child@node@n node{\tikz@resetexpandcount%
\let\tikz@child@node@text=\pgfutil@empty%
\tikz@p@c@s}%
\def\tikz@p@c@s{%
diff --git a/graphics/pgf/base/tex/tikzlibrarycalendar.code.tex b/graphics/pgf/base/tex/tikzlibrarycalendar.code.tex
index 73a47f6574..98cdffe154 100644
--- a/graphics/pgf/base/tex/tikzlibrarycalendar.code.tex
+++ b/graphics/pgf/base/tex/tikzlibrarycalendar.code.tex
@@ -358,7 +358,7 @@ execute before day scope={\ifdate{day of month=1}{%
\def\tikz@lib@cal@calendar{%
\begingroup%
\let\tikz@lib@cal@ifs=\pgfutil@empty%
- \tikz@expandcount=1000\relax%
+ \tikz@resetexpandcount
\tikzset{name=,at={(0,0)}}%
\let\%=\pgfcalendarshorthand%
\tikzset{every calendar/.try}%
@@ -370,27 +370,13 @@ execute before day scope={\ifdate{day of month=1}{%
}
\def\tikz@lib@cal@handle{%
- \let\pgfutil@next=\tikz@lib@cal@expand%
- \ifx\pgf@let@token;%
- \let\pgfutil@next=\tikz@lib@cal@stop%
- \else%
- \ifx\pgf@let@token(%)
- \let\pgfutil@next=\tikz@lib@cal@name%
- \else%
- \ifx\pgf@let@token a%
- \let\pgfutil@next=\tikz@lib@cal@at%
- \else%
- \ifx\pgf@let@token[%
- \let\pgfutil@next=\tikz@lib@cal@option%
- \else%
- \ifx\pgf@let@token i%
- \let\pgfutil@next=\tikz@lib@cal@if%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfutil@next%
+ \pgfutil@switch\pgfutil@ifx\pgf@let@token{%
+ {;}{\let\pgfutil@next\tikz@lib@cal@stop}%
+ {(}{\let\pgfutil@next\tikz@lib@cal@name}%)
+ {a}{\let\pgfutil@next\tikz@lib@cal@at}%
+ {[}{\let\pgfutil@next\tikz@lib@cal@option}%]
+ {i}{\let\pgfutil@next\tikz@lib@cal@if}%
+ }{\tikz@resetexpandcount\pgfutil@next}{\tikz@lib@cal@expand}%
}
\def\tikz@lib@cal@expand{%
\advance\tikz@expandcount by -1
diff --git a/graphics/pgf/base/tex/tikzlibrarymath.code.tex b/graphics/pgf/base/tex/tikzlibrarymath.code.tex
index 3e703fad98..4683c71cd3 100644
--- a/graphics/pgf/base/tex/tikzlibrarymath.code.tex
+++ b/graphics/pgf/base/tex/tikzlibrarymath.code.tex
@@ -532,7 +532,8 @@
\long\def\tikz@math@for@parselist#1{%
\edef\tikz@math@for@list{#1}%
- \tikz@math@collecttosemicolon{\tikz@math@for@parseaction}}%
+ \tikz@math@gobblespaces{%
+ \tikz@math@collecttosemicolon{\tikz@math@for@parseaction}}}%
\def\tikz@math@for@parseaction{%
\tikz@math@for@namedef{prevvalue}{}%
diff --git a/graphics/pgf/base/tex/tikzlibraryspy.code.tex b/graphics/pgf/base/tex/tikzlibraryspy.code.tex
index 1a5e47b446..7f3a63b045 100644
--- a/graphics/pgf/base/tex/tikzlibraryspy.code.tex
+++ b/graphics/pgf/base/tex/tikzlibraryspy.code.tex
@@ -97,7 +97,7 @@
\pgftransformcm{\pgf@lib@svg@a}{\pgf@lib@svg@b}{\pgf@lib@svg@c}{\pgf@lib@svg@d}{\pgfpointorigin}%
}
}]{};
- \expandafter\pgfutil@switch\expandafter{\tikz@anchor}{%
+ \expandafter\pgfutil@switch\expandafter\pgfutil@ifstrequal\expandafter{\tikz@anchor}{%
{north} {\def\tikz@spy@anchor{south}}%
{north east}{\def\tikz@spy@anchor{south west}}%
{east} {\def\tikz@spy@anchor{west}}%
@@ -106,9 +106,7 @@
{south west}{\def\tikz@spy@anchor{north east}}%
{west} {\def\tikz@spy@anchor{east}}%
{north west}{\def\tikz@spy@anchor{south east}}%
- % default to center
- {default} {\def\tikz@spy@anchor{center}}%
- }
+ }{}{\def\tikz@spy@anchor{center}}%
\node [alias=tikzspyinnode,inner sep=0pt,outer sep=0pt,at={#2},every spy in node/.try,
path picture={\node[anchor=\tikz@spy@anchor,tikz@lib@reset@gs]{\nullfont%
\pgfpicture\relax\pgfsetbaseline{default}\pgfsettrimleft{default}\pgfsettrimright{default}%