summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tikz-dependency
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-07 22:15:00 +0000
committerKarl Berry <karl@freefriends.org>2016-11-07 22:15:00 +0000
commit04c0ffa1bcffa7a3b017387a190029feaf04a340 (patch)
tree0d9afaf6de0a0d0bfbe6f85892a1011d55ce6385 /Master/texmf-dist/doc/latex/tikz-dependency
parent293604ad265c7c828f4f9183844ed5e6647c2b84 (diff)
tikz-dependency (7nov16)
git-svn-id: svn://tug.org/texlive/trunk@42454 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/tikz-dependency')
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/README6
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/VERSION2
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.code.tex65
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.pdflinks.code.tex414
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.prettyprinter.code.tex1095
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.pdfbin723117 -> 732387 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.tex67
7 files changed, 58 insertions, 1591 deletions
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/README b/Master/texmf-dist/doc/latex/tikz-dependency/README
index 20272804669..12e1bb07fcf 100644
--- a/Master/texmf-dist/doc/latex/tikz-dependency/README
+++ b/Master/texmf-dist/doc/latex/tikz-dependency/README
@@ -26,6 +26,12 @@ feature requests. Thanks for using tikz-dependency!
Changelog
---------
+* **Version 1.2** (Jul 5, 2012)
+
+ - Added "edge height" to override the behavior of the edge-drawing algorithm and explicitly set
+ the height of an edge
+ - Incorporated patch by Tetsuo Kiso that fixes error in the handling of "edge end offset x"
+
* **Version 1.1** (Jan 17, 2012)
- Added the possibility to use simple arcs as edges (keys: "arc edge"/"segmented edge")
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/VERSION b/Master/texmf-dist/doc/latex/tikz-dependency/VERSION
index 9459d4ba2a0..5625e59da88 100644
--- a/Master/texmf-dist/doc/latex/tikz-dependency/VERSION
+++ b/Master/texmf-dist/doc/latex/tikz-dependency/VERSION
@@ -1 +1 @@
-1.1
+1.2
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.code.tex b/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.code.tex
deleted file mode 100644
index 0160878cb99..00000000000
--- a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.code.tex
+++ /dev/null
@@ -1,65 +0,0 @@
-% Copyright 2009 by Till Tantau and Christian Feuersänger
-%
-% This file may be distributed and/or modified
-%
-% 1. under the LaTeX Project Public License and/or
-% 2. under the GNU Public License.
-%
-% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
-\input pgfmanual.prettyprinter.code.tex
-\input pgfmanual.pdflinks.code.tex
-
-% TODO for auto xrefs:
-% 1. check the already identified labels, preferrably using
-% /pdflinks/show labels=true
-% and the image externalization debug mode (see pgfmanual-en-main.tex)
-% (to strip almost all images away)
-%
-% 2. Insert '\declareandlabel' in the document whenever something has been
-% defined in the text, so it should get a pdf anchor (see
-% pgfmanual.pdflinks.code.tex )
-%
-% 2.1 perhaps insert \pgfmanualpdflabel{<label>}{} where needed.
-%
-% 3. Verify that the |...| commands occuring in situations where catcodes can't
-% be changed (footnotes or macro arguments) work as expected.
-%
-% 4. Consider telling the pretty printer that several control sequences
-% have arguments which are options (see below for the predefined list).
-% This may apply to \pgfpageslogicalpageoptions or so.
-%
-% 5. @Christian: consider extensions of the parser such that it identifies path commands (at least partially)
-%
-%
-
-\def\pgfmanual@warning#1{\immediate\write16{! Package pgfmanual Warning: #1}}%
-
-
-\pgfkeys{
- % set this to 'false' to disable auto reference generation.
- % However, a little bit runtime overhead will still remain
- % (and the \pgfmanualpdflabel commands will still be used)
- /pdflinks/codeexample links=true,
- %
- /codeexample/prettyprint/cs arguments/tikzset/.initial=1,
- /codeexample/prettyprint/cs/tikzset/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/usetikzlibrary/.initial=1,
- /codeexample/prettyprint/cs/usetikzlibrary/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualpdfref{#2}{#2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/usepgflibrary/.initial=1,
- /codeexample/prettyprint/cs/usepgflibrary/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualpdfref{#2}{#2}\pgfmanualclosebrace},
- %
- %
- %
- % whenever an unqualified key is found, the following key prefix
- % list is tried to find a match.
- /pdflinks/search key prefixes in={/tikz/,/pgf/,/depgraph/},
- %
- % the link prefix written to the pdf file:
- /pdflinks/internal link prefix=pgf,
- %
- /pdflinks/warnings=false,
- % for debugging:
- /pdflinks/show labels=false,
-}%
-
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.pdflinks.code.tex b/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.pdflinks.code.tex
deleted file mode 100644
index e507d30e85c..00000000000
--- a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.pdflinks.code.tex
+++ /dev/null
@@ -1,414 +0,0 @@
-%--------------------------------------------
-%
-% Package pgfplots
-%
-% Provides a user-friendly interface to create function plots (normal
-% plots, semi-logplots and double-logplots).
-%
-% It is based on Till Tantau's PGF package.
-%
-% Copyright 2007/2008/2009 by Christian Feuersänger.
-%
-% This program is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% This program is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with this program. If not, see <http://www.gnu.org/licenses/>.
-%
-%--------------------------------------------
-
-% This file provides an interface to the
-% pgfmanual.prettyprint.code.tex thing -- it allows to
-% *generate pdf crossrefs inside of codeexamples automatically*
-% without any user input.
-%
-% Thus, you write
-% \begin{codeexample}[]
-% \begin{tikzpicture}[options]
-% \end{tikzpicture}
-% \end{codeexample}
-% and pdf cross references to the definitions of 'tikzpicture'
-% and any options will be generated automatically.
-%
-% Furthermore, pdf cross references will be generated for everything
-% within vertical bars, |....|.
-%
-%
-%
-%
-%
-% The only necessary thing is that \pgfmanualpdflabel has been called
-% for every (fully qualified) key, control sequence, environment or
-% whatever.
-
-\newif\ifpgfmanualpdfwarnings
-\pgfmanualpdfwarningstrue
-
-\newif\ifpgfmanualshowlabels
-
-\pgfkeys{%
- /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
- /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace},
- %
- /codeexample/prettyprint/autolinks/.style={%
- /codeexample/prettyprint/key name/.code={\pgfmanualpdfref{##1}{##1}},
- /codeexample/prettyprint/key name with handler/.code 2 args={\pgfmanualpdfref{##1}{##1}/\pgfmanualpdfref{/handlers/##2}{##2}},
- /codeexample/prettyprint/key value display only/.code={\pgfmanualprettyprintcode{##1}},
- /codeexample/prettyprint/cs/.code={\pgfmanualpdfref{##1}{##1}},
- /codeexample/prettyprint/cs with args/.code 2 args={\pgfmanualpdfref{##1}{##1}\{\pgfmanualprettyprintcode{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
- /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\pgfmanualpdfref{##1}{##1}\{\pgfmanualprettyprintpgfkeys{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/begin/.initial=1,
- /codeexample/prettyprint/cs/begin/.code 2 args={##1\{\pgfmanualpdfref{##2}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/end/.initial=1,
- /codeexample/prettyprint/cs/end/.code 2 args={##1\{\pgfmanualpdfref{##2}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/word/.code={\begingroup\pgfkeyssetvalue{/pdflinks/search key prefixes in}{}\pgfmanualpdfref{##1}{##1}\endgroup},
- /codeexample/prettyprint/point/.code={##1},%
- /codeexample/prettyprint/point with cs/.code 2 args={(\pgfmanualpdfref{##1}{##1}:##2},%
- },%
- /codeexample/prettyprint/autolinks,
-}%
-
-\pgfkeys{
- %
- % Enables or disables the parsing of codeexamples.
- /pdflinks/codeexample links/.is if=pgfmanualprettyenabled,
- /pdflinks/codeexample links/.default=true,
- %
- % whenever an unqualified key is found, the following key prefix
- % list is tried to find a match.
- /pdflinks/search key prefixes in/.initial={/tikz/,/pgf/},
- %
- % Enables or disables warnings for failed auto links:
- /pdflinks/warnings/.is if=pgfmanualpdfwarnings,
- /pdflinks/warnings/.default=true,
- %
- % Shows the autogenerated labels. This is useful to check if the
- % 'search key prefixes in' worked as it ought to.
- /pdflinks/show labels/.is if=pgfmanualshowlabels,
- /pdflinks/show labels/.default=true,
- /pdflinks/show labels=false,
- % will be invoked with '#1' set to the generated label.
- /pdflinks/show labels code/.code={
- \hbox to 0pt{%
- \vbox to 0pt{\hsize=0pt
- \vskip-\baselineskip
- \hbox to \hsize{%
- \hss
- {\footnotesize\ttfamily\textcolor{red}{#1}}%
- \hss
- }%
- \vss
- }%
- \vbox to 0pt{\hsize=0pt
- \vss
- \hbox to \hsize{%
- \hss
- {\footnotesize\ttfamily\textcolor{red}{$\vert$}}%
- \hss
- }%
- }%
- \vsize=0pt
- }%
- },
- %
- % the link prefix written to the pdf file:
- /pdflinks/internal link prefix/.initial=pgf,
-}
-
-\gdef\pgfmanualpdf@installreplacements{%
- \def\marg##1{{##1}}%
- \def\oarg##1{[##1]}%
- \def\meta##1{<##1>}%
- \def\x{x}%
- \def\textbackslash{<CS>}%
- \def\\{\textbackslash}%
- \def\space{:}%
- \edef\ {\space}%
- \edef\#{}%
- \def\printanat{@}%
- \def\protect{}%
- \def\textasciicircum{o}%
- \expandafter\edef\pgfmanual@verb@activebar{\pgfmanual@verb@bar}%
-}%
-
-% Defines a new pdf cross ref label for use with \pgfmanualpdfref.
-%
-% Usage:
-% \pgfmanualpdflabel{<label>}{<text>}
-% #1: the label.
-% The text #2 will be shown in the resulting pdf (if it is not empty).
-%
-% There is also support for catcode changes if <label> contains
-% something which shouldn't be written as-is into .aux files:
-% \pgfmanualpdflabel[\catcode`\|=12 ]{|-}{}
-% -> this will write
-% \begingroup \catcode `\|=12
-% <code to deal with the label |- >
-% \endgroup
-% into the .aux file.
-%
-\def\pgfmanualpdflabel{\pgfutil@ifnextchar[{\pgfmanualpdflabel@opt}{\pgfmanualpdflabel@opt[]}}%
-\def\pgfmanualpdflabel@opt[#1]#2#3{%
- \begingroup
- %
- \def\pgfmanualpdf@catcode{#1}%
- \pgfmanualpdf@catcode
- %
- \pgfmanualpdflabel@generate{#2}{#3}%
- %
- % this is pgfplots-specific: pgfplots supports generic styles which
- % contain '\x' where '\x' iterates through 'x,y,z'.
- \pgfutil@in@\x{#2}%
- \ifpgfutil@in@
- \def\x{y}%
- \pgfmanualpdflabel@generate{#2}{#3}%
- \def\x{z}%
- \pgfmanualpdflabel@generate{#2}{#3}%
- \fi
- \endgroup
-}%
-\def\pgfmanualpdflabel@generate#1#2{%
- \pgfmanual@handlespeciallabeltokens@in{#1}%
- %
- \def\pgfmanualpdflabel@generateone{0}%
- \pgfutil@ifundefined{pgfd@lbl@\pgfmanualpdflabel@@}{%
- % ok, no such label is known.
- \def\pgfmanualpdflabel@generateone{1}%
- }{%
- \if\csname pgfd@lbl@\pgfmanualpdflabel@@\endcsname a% "a"ux
- % ah, it is "just" known from a previous run, but there is
- % no code in the pdf! Write it!
- \def\pgfmanualpdflabel@generateone{1}%
- \else
- % ok, we already wrote one before. Skip.
- \fi
- }%
- \if\pgfmanualpdflabel@generateone1%
- \ifpgfmanualshowlabels
- \pgfkeysvalueof{/pdflinks/show labels code/.@cmd}{\pgfmanualpdflabel@@}\pgfeov
- \fi
- %
- \if@filesw
- \ifx\pgfmanualpdf@catcode\pgfutil@empty
- \else
- \toks0=\expandafter{\pgfmanualpdf@catcode}%
- \immediate\write\@auxout{%
- \noexpand\begingroup
- \the\toks0
- }%
- \fi
- \immediate\write\@auxout{%
- \noexpand\expandafter\noexpand\gdef
- \noexpand\csname pgfd@lbl@\pgfmanualpdflabel@@\noexpand\endcsname{a}% a = known in "a"ux file
- }%
- \ifx\pgfmanualpdf@catcode\pgfutil@empty
- \else
- \immediate\write\@auxout{\noexpand\endgroup}%
- \fi
- \fi
- \expandafter\gdef\csname pgfd@lbl@\pgfmanualpdflabel@@\endcsname{w}% 1. remember the label AND remember that we "w"rote it into the pdf.
- \edef\pgfmanualpdflabel@@{\pgfkeysvalueof{/pdflinks/internal link prefix}.\pgfmanualpdflabel@@}%
- \expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{#2}%
- \else
- #2%
- \fi
-}%
-
-% A pdf reference to label `#1' with (TeX) text `#2'.
-% @see also \verbpdfref.
-\def\pgfmanualpdfref#1#2{%
- \begingroup
- \pgfmanual@handlespeciallabeltokens@in{#1}%
- %
- \ifcsname pgfd@lbl@\pgfmanualpdflabel@@\endcsname
- \else
- \global\let\pgfmanual@glob=\pgfmanualpdflabel@@
- \def\pgfmanual@tempa{\foreach \prefix in }%
- \pgfkeysgetvalue{/pdflinks/search key prefixes in}\pgfmanual@tempb
- \expandafter\pgfmanual@tempa\expandafter{\pgfmanual@tempb}{%
- \edef\pgfmanualpdflabel@@{\prefix\pgfmanualpdflabel@@}%
- \expandafter\pgfmanual@handlespeciallabeltokens@in\expandafter{\pgfmanualpdflabel@@}%
- \ifcsname pgfd@lbl@\pgfmanualpdflabel@@\endcsname
- \xdef\pgfmanual@glob{\pgfmanualpdflabel@@}%
- \breakforeach
- \fi
- }%
- \let\pgfmanualpdflabel@@=\pgfmanual@glob
- \ifcsname pgfd@lbl@\pgfmanualpdflabel@@\endcsname
- \else
- \ifpgfmanualpdfwarnings
- \begingroup
- \toks0={#1}%
- \pgfmanual@warning{pgfmanualpdfref{\the\toks0 }: target label does not exist.}%
- \endgroup
- \fi
- #2%
- \let\pgfmanualpdflabel@@=\pgfutil@empty
- \fi
- \fi
- \ifx\pgfmanualpdflabel@@\pgfutil@empty
- \else
- \expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{#2}%
- \fi
- \endgroup
-}%
-\def\pgfmanualpdfref@#1#2{%
- \pgfkeysgetvalue{/pdflinks/internal link prefix}\pgfmanual@temp
- \expandafter\hyperlink\expandafter{\pgfmanual@temp.#1}{#2}%
- \ifpgfmanualshowlabels
- \pgfkeysvalueof{/pdflinks/show labels code/.@cmd}{#1}\pgfeov
- \fi
-}%
-
-% Handles special tokens in a pdf label which should be treated with
-% care.
-%
-% For example, backslashes might produce problems.
-% This occurs quite frequently with automatically generated hyperrefs
-% inside of codeexamples where \pgfmanualpdfref will be invoked -
-% there, we get the catcode 12 backslashes.
-% Check for them!
-%
-% #1: a token list which shall be used either as cross ref or as
-% label.
-%
-% On output, the macro \pgfmanualpdflabel@@ will be '\edef'ed to the
-% new, possibly modified value.
-\def\pgfmanual@handlespeciallabeltokens@in#1{%
- \begingroup
- \pgfmanualpdf@installreplacements
- \expandafter\pgfutil@in@\pgfmanual@pretty@backslash{#1}%
- \ifpgfutil@in@
- % assume the backslash is the first char and substitute it:
- \pgfmanualpdfref@substitute@backslash#1\relax
- \else
- \edef\pgfmanualpdflabel@@{#1}%
- \fi
- \def\pgfmanual@tmp{\pgfutilstrreplace{ }{\space}}%
- \expandafter\pgfmanual@tmp\expandafter{\pgfmanualpdflabel@@}%
- \edef\pgfmanualpdflabel@@{\pgfretval}%
- \pgfmath@smuggleone\pgfmanualpdflabel@@
- \endgroup
-}%
-
-\expandafter\def\expandafter\pgfmanualpdfref@substitute@backslash\expandafter#\expandafter1\pgfmanual@pretty@backslash#2\relax{%
- \edef\pgfmanualpdflabel@@{#1\textbackslash #2}%
-}%
-
-% Typesets '#1' in red,\texttt like every declaration. It will also
-% generate a pdf cross ref anchor for #1.
-%
-% WARNING: this changes catcodes! In case this is not acceptable in
-% your context, you will need to generate a \pgfmanualpdflabel
-% manually.
-%
-% \declareandlabel{\controlsequence} can be used as |\controlsequence|
-\def\declareandlabel{%
- \begingroup
- \pgfmanual@verb@preparecatcodes@
- \def\pgfmanualprettyprinterhandlecollectedargs##1{%
- \pgfmanualpdflabel##1{\texttt{\declare##1}}% mark: '##1' contains already braces.
- \endgroup
- }%
- \pgfmanualprettyprintercollectargcount1{\relax}%
-}
-
-%
-% \verbpdfref{\controlsequence more stuff}
-% is the same as writing |\controlsequence more stuff|, but the
-% *complete* argument is supposed to be one label.
-%
-% The difference to \pgfmanualpdfref{...}{} is that the argument is
-% supposed to be verbatim text.
-\def\verbpdfref{%
- \begingroup
- \pgfmanual@verb@preparecatcodes@
- \def\pgfmanualprettyprinterhandlecollectedargs##1{%
- \pgfmanualpdfref##1{\texttt{##1}}% mark: '##1' contains already braces.
- \endgroup
- }%
- \pgfmanualprettyprintercollectargcount1{\relax}%
-}
-
-% Prepare active vertical bars, |....| for auto-pretty cross
-% referencing.
-%
-% Example:
-% |\pgfkeys| -> will generate a hyperref!
-{
- \catcode`\|=12
- \gdef\pgfmanual@verb@bar{|}%
-% \gdef\pgfmanual@verb@collect#1|{%
-% % this command will also handle control sequences.
-% \texttt{\pgfmanualprettyprintpgfkeys{#1}}%
-% \endgroup
-% }%
- \catcode`\|=13
- \gdef\pgfmanual@verb@activebar{|}%
-}
-\def\pgfmanual@verb{%
- \begingroup
- \pgfmanual@verb@preparecatcodes@
- \toksdef\t@pgfmanual@verb=0
- \t@pgfmanual@verb={}%
- \pgfmanual@verb@collect
-}
-% this version of \pgfmanual@verb@collect is less efficient than the
-% one uncommented above. BUT: it can auto-detect the case when
-% |...| has been provided somewhere where I can't change catcodes!
-% The other one would simply fail to compile.
-\def\pgfmanual@verb@collect#1{%
- \def\pgfmanual@temp{#1}%
- \ifx\pgfmanual@temp\pgfmanual@verb@bar
- % ok, finish:
- \edef\pgfmanual@verb@collect@next{%
- % this command will also handle control sequences.
- \noexpand\endgroup
- \noexpand\texttt{\noexpand\pgfmanualprettyprintpgfkeys{\the\t@pgfmanual@verb}}%
- }%
- \else
- \ifx\pgfmanual@temp\pgfmanual@verb@activebar
- % ohoh... that should not happen! It means someone invoked
- % |...| within an argument; I couln't change catcodes.
- % Ok, resort to a simple fallback solution.
- % FIXME : I have just realized that THIS DOESN'T PRESERVE SPACES
- \edef\pgfmanual@verb@collect@next{%
- \noexpand\endgroup
- \noexpand\texttt{\the\t@pgfmanual@verb}%
- }%
- \else
- \t@pgfmanual@verb=\expandafter{\the\t@pgfmanual@verb #1}%
- \let\pgfmanual@verb@collect@next=\pgfmanual@verb@collect
- \fi
- \fi
- \pgfmanual@verb@collect@next
-}%
-
-\AtBeginDocument{%
- \ifpgfmanualprettyenabled
- \catcode`\|=13
- \expandafter\let\pgfmanual@verb@activebar=\pgfmanual@verb
- \fi
-}%
-
-\def\pgfmanual@verb@preparecatcodes@{%
- \let\do\@makeother%
- \dospecials%
- \catcode`\%=12 % THATS IMPORTANT! Do *not* handle comments!
- % these catcodes are expected by the pretty printer...
- %\catcode`\^^M=13
- \catcode`\ =13
- \catcode`\^^I=13
- \expandafter\def\pgfmanual@pretty@activespace{\space}%
- \expandafter\def\pgfmanual@pretty@activetab{\space\space\space\space}%
-}%
-\endinput
-% vi: ts=4 sw=4
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.prettyprinter.code.tex
deleted file mode 100644
index 85482fedaaf..00000000000
--- a/Master/texmf-dist/doc/latex/tikz-dependency/pgfmanual.prettyprinter.code.tex
+++ /dev/null
@@ -1,1095 +0,0 @@
-%--------------------------------------------
-%
-% Package pgfplots
-%
-% Provides a user-friendly interface to create function plots (normal
-% plots, semi-logplots and double-logplots).
-%
-% It is based on Till Tantau's PGF package.
-%
-% Copyright 2007/2008/2009 by Christian Feuersänger.
-%
-% This program is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% This program is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with this program. If not, see <http://www.gnu.org/licenses/>.
-%
-%--------------------------------------------
-
-% this is some kind of "plug-in" for pgfmanual-en-macros.tex which
-% provides pretty printing of the code lines in 'codeexample'.
-%
-% It requires to be invoked with \pgfmanualprettyprintcode{#1} at the
-% right place.
-%
-% ATTENTION:
-% this is NOT a sophisticated syntax highlighter like lstlistings!
-% It has rather strict assumptions about how to use it (the input must
-% have been read verbatim, for example).
-
-% Special code for syntax highlighting:
-%
-%
-% USER INTERFACE
-\pgfkeys{%
- % this is the public hook into
- % \begin{codeexample}...\end{codeexample} which triggers pretty
- % printing:
- /codeexample/typeset listing/.code= {\pgfmanualprettyprintcode{#1}},
- %
- % this key will be invoked whenever a key in key-value context has been identified.
- %
- % It won't be invoked for handled keys like |my style/.style=....|, see below.
- %
- % #1 will be the keys name.
- /codeexample/prettyprint/key name/.code={#1},
- %
- % A variant which will be used instead of |key name| if the key
- % has a key handler. For example, when the pretty printer finds
- % |my style/.style|, it will call
- % |key name with handler={my style}{.style}.
- /codeexample/prettyprint/key name with handler/.code 2 args={#1/#2},
- %
- % Will be invoked whenever the value of a key has been found.
- % It will be invoked AFTER 'key name' and not at all if there was
- % no value.
- %
- % #1: the key's name
- % #2: the key's value.
- %
- % The default implementation checks if there is a special handler
- % for the key name '#1', in
- % /codeexample/prettyprint/key value/#1.
- % For example:
- % /codeexample/prettyprint/key value/my key/.code 2 args={name=#1, value =#2}
- % If such a key exists, it will be invoked with {#1}{#2} as
- % arguments. Otherwise, the generic method
- % /codeexample/prettyprint/key value with style detection={#1}{#2}
- % will be invoked.
- /codeexample/prettyprint/key value/.code 2 args={%
- \pgfkeysifdefined{/codeexample/prettyprint/key value/#1}{%
- \pgfkeysalso{/codeexample/prettyprint/key value/#1={#1}{#2}}%
- }{%
- \pgfkeysalso{/codeexample/prettyprint/key value with style detection={#1}{#2}}%
- }%
- },
- % A helper macro for the default 'key value' implementation.
- /codeexample/prettyprint/key value with style detection/.code 2 args={%
- \pgfutil@in@{style}{#1}%
- \ifpgfutil@in@
- \pgfmanualprettyprintpgfkeys{#2}%
- \else
- \pgfkeysalso{/codeexample/prettyprint/key value display only={#2}}%
- \fi
- },%
- %
- % Will be invoked by the default 'key value' implementation to
- % typeset the value as such.
- /codeexample/prettyprint/key value display only/.code={#1},
- %
- % Used to typeset a single word. A word is something which has not
- % been identified in any other context; a maximal sequence of
- % non-white-space tokens.
- /codeexample/prettyprint/word/.code={#1},
- %
- % A two-argument code key which invokes '#1' if spaces shall
- % delimit words and '#2' if not.
- % This may be useless. Handle with care!
- /codeexample/prettyprint/if space is word delim/.code 2 args={%
- #1%
- },%
- %
- % A three-argument code key which should invoke '#2' if the single
- % token '#1' is a word delimiter and '#3' if that is not the case.
- % Note that '#1' doesn't have the usual catcodes (see the
- % \pgfmanual@pretty@** macros)!
- % Furthermore, white spaces are treated separately.
- /codeexample/prettyprint/if is word delim/.code args={#1#2#3}{%
- \edef\pgfmanual@check{,;().;\pgfmanual@pretty@lbrace\pgfmanual@pretty@rbrace}%
- \def\pgfmanual@check@{\pgfutil@in@{#1}}%
- \expandafter\pgfmanual@check@\expandafter{\pgfmanual@check}%
- \ifpgfutil@in@ #2\else #3\fi
- },%
- %
- % Used to typeset a single control sequence.
- % #1 is the control sequence's name as a sequence of catcode 12
- % tokens.
- /codeexample/prettyprint/cs/.code={#1},
- %
- % Used to typeset a single control sequence together with one or
- % more arguments.
- %
- % #1 is the control sequence's name (including the backslash as
- % literal string) and
- % #2,#3,...,#9 are the arguments. The number of arguments depends
- % on the 'cs arguments/<CS NAME>' key; it contains the integer
- % number.
- %
- % For example, if
- % |cs arguments/pgfkeys/.initial=1|,
- % the pretty printer invokes
- % |cs with args={\pgfkeys}{<argument>}.
- %
- % If
- % |cs arguments/mycommand/.initial=2|,
- % the pretty printer invokes
- % |cs with args={\pgfkeys}{<argument1>}{<argument2>}.
- % In this case, 'cs with args' needs to be defined in a way which
- % allows to deal with 3 arguments.
- %
- % Please note that the value do not contain braces! The braces
- % need to be inserted manually.
- %
- % Special cases:
- % 1. If end-of-input is encountered BEFORE the expected number of
- % arguments has been found, the following happens:
- % - if not even one (partial) argument has been found, the
- % /codeexample/prettyprint/cs/.@cmd key will be used instead.
- % - the \ifpgfmanualprettyprinterarghasunmatchedbraces boolean
- % indicates if the trailing brace is missing.
- /codeexample/prettyprint/cs with args/.code 2 args={#1\{#2\pgfmanualclosebrace},
- %
- % For every identified control sequence, the key
- % /codeexample/prettyprint/cs arguments/<CSNAME>
- % will be checked. If it exists, it contains an integer with the
- % number of arguments it takes.
- % The <CSNAME> must not contain the '\'.
- /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
- %
- % For every identified control sequence, the key
- % /codeexample/prettyprint/cs/<CSNAME>/.@cmd
- % will be checked. If it exists, it will be used instead of
- % 'cs with args' (with the same special case restrictions for
- % early end-of-input).
- %
- % The <CSNAME> must not contain the '\'.
- %
- % This allows special treatment for special
- % commands like \pgfkeys:
- /codeexample/prettyprint/cs/pgfkeys/.code 2 args={#1\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace},
- %
- % recognise environments:
- /codeexample/prettyprint/cs arguments/begin/.initial=1,
- /codeexample/prettyprint/cs/begin/.code 2 args={#1\{#2\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/end/.initial=1,
- /codeexample/prettyprint/cs/end/.code 2 args={#1\{#2\pgfmanualclosebrace},
- %
- % a point coordinate (#1)
- % Note that '#1' will contain the braces (if there was one),
- /codeexample/prettyprint/point/.code={#1},%
- %
- % a point coordinate with explicit coordinate system: (#1:#2)
- % Note that '#2' will contain the terminating brace (if there was one)
- % #1: the coordinate system name (*without* the leading brace).
- % The leading brace must be re-inserted by this style.
- /codeexample/prettyprint/point with cs/.code 2 args={(#1:#2},%
- % the same with specialised code:
- %/codeexample/prettyprint/point with cs/<CS NAME>/.code 2 args={(#1:#2},%
- %
- %
- % A predefined style which colors every identified token. It's
- % purpose is only debugging.
- /codeexample/prettyprint/colored/.style={%
- /codeexample/prettyprint/key name/.code={\textcolor{red!75!black}{##1}},
- /codeexample/prettyprint/key name with handler/.code 2 args={\textcolor{red!75!black}{##1}/\textcolor{red!90!black}{##2}},
- /codeexample/prettyprint/key value display only/.code={\textcolor{yellow}{##1}},
- /codeexample/prettyprint/cs/.code={\textcolor{green}{##1}},
- /codeexample/prettyprint/cs with args/.code 2 args={\textcolor{green}{##1}\{\textcolor{orange}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
- /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\textcolor{green}{##1}\{\pgfmanualprettyprintpgfkeys{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/begin/.initial=1,
- /codeexample/prettyprint/cs/begin/.code 2 args={\textcolor{green}{##1}\{\textcolor{orange}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/cs arguments/end/.initial=1,
- /codeexample/prettyprint/cs/end/.code 2 args={\textcolor{green}{##1}\{\textcolor{orange}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/word/.code={\textcolor{brown}{##1}},
- /codeexample/prettyprint/point/.code={\textcolor{red}{##1}},%
- /codeexample/prettyprint/point with cs/.code 2 args={(\textcolor{green}{##1}:\textcolor{red}{##2}},%
- },%
- % A further debuggin helper.
- /codeexample/prettyprint/colored and verbose/.style={%
- /codeexample/prettyprint/colored,
- /codeexample/prettyprint/key name/.code={\message{[key name=##1]}\textcolor{red!75!black}{##1}},
- /codeexample/prettyprint/key name with handler/.code 2 args={\message{[key name with handler=##1/##2]}\textcolor{red!75!black}{##1}/\textcolor{red!90!black}{##2}},
- /codeexample/prettyprint/key value display only/.code={\def\temp{##1}\message{[key value=\meaning\temp]}\textcolor{yellow}{##1}},
- /codeexample/prettyprint/cs/.code={\message{[cs=##1]}\textcolor{green}{##1}},
- /codeexample/prettyprint/cs with args/.code 2 args={\def\temp{##2}\message{[cs with args={##1}{\meaning\temp}]}\textcolor{green}{##1}\{\textcolor{orange}{##2}\pgfmanualclosebrace},
- /codeexample/prettyprint/word/.code={\message{[word=##1]}\textcolor{brown}{##1}},
- /codeexample/prettyprint/point/.code={\message{[point=##1]}\textcolor{red}{##1}},%
- /codeexample/prettyprint/point with cs/.code 2 args={\message{[point with cs={##1}{##2}]}(\textcolor{green}{##1}:\textcolor{red}{##2}},%
- },%
- %/codeexample/prettyprint/colored,
- %/codeexample/prettyprint/colored and verbose,
-}%
-
-\newif\ifpgfmanualprettyenabled
-\pgfmanualprettyenabledtrue
-
-% User interface command to handle unmatched braces:
-%
-% It expands to '\}' unless the preceding argument had unmatched braces.
-\def\pgfmanualclosebrace{%
- \ifpgfmanualprettyprinterarghasunmatchedbraces
- \else
- \}%
- \fi
-}%
-
-
-% Typesets '#1', possibly using some sort of pretty printer.
-%
-% The argument '#1' is expected to be a long token list in which
-% 1. all characters have catcode 11 or 12 (normal letters),
-% 2. white spaces, tabs and newlines have catcode 13 (are active).
-%
-% @see \pgfmanualprettyprintpgfkeys
-\long\def\pgfmanualprettyprintcode#1{%
-%\def\temp{#1}\message{STARTING PRETTY PRINTING for \meaning\temp}%
- \ifpgfmanualprettyenabled
- \begingroup
- \pgfmanualprettyprintstyles
- \pgfmanual@pretty@mainloop#1\pgfmanual@EOI
- \endgroup
- \else
- #1%
- \fi
-}%
-% DISABLE:
-%\long\def\pgfmanualprettyprintcode#1{#1}%
-
-\def\pgfmanualprettyprintstyles{%
-%\tracingmacros=2 \tracingcommands=2 \message{PRETTYPRINT INIT}%
- \def\{{\pgfmanual@pretty@lbrace}%
- \def\}{\pgfmanual@pretty@rbrace}%
- \pgfmanual@pretty@installcommenthandler
- \let\pgfmanualprettyprintstyles=\relax
-}%
-
-
-\newif\ifpgfmanualprettycommentactive
-
-% we can't use the \@typeset@till@return method for comments because
-% the pretty printer needs full control over the token list.
-%
-% We try a replacement here.
-%
-% FIXME
-% THIS INTRODUCES A NEW GROUP! Does that hurt the pretty printer??
-%
-\def\pgfmanual@pretty@installcommenthandler{%
- \expandafter\def\pgfmanual@pretty@activepercent{%
- \begingroup
- \pgfmanualprettycommentactivetrue
- \expandafter\let\pgfmanual@pretty@activenl=\pgfmanual@pretty@recoveraftercomment
- \expandafter\def\pgfmanual@pretty@activepercent{\%}%
- %\tt
- \% %
- }%
-}%
-\def\pgfmanual@pretty@recoveraftercomment{%
- \endgroup
- \pgfmanual@pretty@activenl
-}%
-
-\def\pgfmanual@EOI{\pgfmanual@EOI}%
-
-{
- \catcode`\[=0
- \catcode`\\=12
- [gdef[pgfmanual@pretty@backslash{\}%
-}
-\begingroup
- \catcode`\:=12
- \catcode`\(=12
- \catcode`\)=12
- \gdef\pgfmanual@pretty@colon{:}%
- \gdef\pgfmanual@pretty@lroundbrace{(}%
- \gdef\pgfmanual@pretty@rroundbrace{)}%
- \catcode`\[=1
- \catcode`\]=2
- \catcode`\{=12
- \catcode`\}=12
- \gdef\pgfmanual@pretty@lbrace[{]%
- \gdef\pgfmanual@pretty@rbrace[}]%
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\[=12
- \catcode`\]=12
- \catcode`\,=12
- \catcode`\ =10\relax\gdef\pgfmanual@pretty@space{ }%
- \gdef\pgfmanual@pretty@lbracket{[}%
- \gdef\pgfmanual@pretty@rbracket{]}%
- \gdef\pgfmanual@pretty@comma{,}%
- \catcode`\==12
- \gdef\pgfmanual@pretty@eq{=}%
-\endgroup
-\begingroup
- \catcode`\%=12
- \gdef\pgfmanual@pretty@percent{%}
- \catcode`\%=13
- \gdef\pgfmanual@pretty@activepercent{%}
- \catcode`\^^M=13
- \gdef\pgfmanual@pretty@activenl{^^M}\endgroup
-\begingroup
-\catcode`\^^I=13\relax\gdef\pgfmanual@pretty@activetab{^^I}%
-\catcode`\ =13\relax\gdef\pgfmanual@pretty@activespace{ }\endgroup
-
-% loops through all tokens.
-% #1 is a single token.
-\def\pgfmanual@pretty@mainloop{%
- \def\pgfmanual@pretty@mainloop@currentword{}%
- \pgfmanual@pretty@mainloop@
-}%
-\long\def\pgfmanual@pretty@mainloop@#1{%
- \def\pgfmanual@loc@TMPa{#1}%
- \let\pgfmanual@pretty@mainloop@NEXT=\pgfmanual@pretty@mainloop@
- \ifx\pgfmanual@loc@TMPa\pgfmanual@EOI
- % stop iteration.
- \pgfmanual@pretty@mainloop@finishword
- \let\pgfmanual@pretty@mainloop@NEXT=\relax
- \else
- \ifpgfmanualprettycommentactive
- #1%
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@lbracket%
- % we found the start of OPTIONS '[ ... ]'.
- \pgfmanual@pretty@mainloop@finishword
- % Attempt syntax highlighting for pgfkeys:
- \let\pgfmanual@pretty@mainloop@NEXT=\pgfmanual@pretty@pgfkeys
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@backslash
- % we found the start of a control sequence '\command'
- \pgfmanual@pretty@mainloop@finishword
- %
- % collect the control sequence name into
- % \pgfmanual@loc@TMPa, but without the backslash:
- \let\pgfmanual@loc@TMPa=\pgfutil@empty
- \let\pgfmanual@pretty@mainloop@NEXT=\pgfmanual@pretty@collectcs@loop
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@lroundbrace%
- \pgfmanual@pretty@mainloop@finishword
- \let\pgfmanual@pretty@mainloop@NEXT=\pgfmanual@pretty@collectpoint
- \else
- \def\pgfmanual@isspace{0}%
- \ifnum13=\catcode`#1
- % we found a white space (space, TAB or NL) or comment
- \def\pgfmanual@isspace{1}%
- \else
- \ifnum10=\catcode`#1
- \def\pgfmanual@isspace{1}%
- \fi
- \fi
- \if\pgfmanual@isspace1%
- \pgfkeysvalueof{/codeexample/prettyprint/if space is word delim/.@cmd}{%
- \pgfmanual@pretty@mainloop@finishword
- #1% ok, show it.
- }{%
- % collect the word.
- \expandafter\def\expandafter\pgfmanual@pretty@mainloop@currentword\expandafter{\pgfmanual@pretty@mainloop@currentword #1}%
- }%
- \else
- \pgfkeysvalueof{/codeexample/prettyprint/if is word delim/.@cmd}{#1}{%
- \pgfmanual@pretty@mainloop@finishword
- #1% ok, show the delimiter.
- }{%
- % collect the word.
- \expandafter\def\expandafter\pgfmanual@pretty@mainloop@currentword\expandafter{\pgfmanual@pretty@mainloop@currentword #1}%
- }\pgfeov%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \pgfmanual@pretty@mainloop@NEXT
-}%
-
-\def\pgfmanual@pretty@mainloop@finishword{%
- \ifx\pgfmanual@pretty@mainloop@currentword\pgfutil@empty
- \else
- \def\pgfmanual@loc@TMPa{\pgfkeysvalueof{/codeexample/prettyprint/word/.@cmd}}%
- \expandafter\pgfmanual@loc@TMPa\pgfmanual@pretty@mainloop@currentword\pgfeov
- \let\pgfmanual@pretty@mainloop@currentword=\pgfutil@empty
- \fi
-}%
-
-\def\pgfmanual@pretty@collectpoint{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectpoint
- \expandafter\pgfmanualprettyprintercollectupto\pgfmanual@pretty@rroundbrace
- {\afterpgfmanual@pretty@collectpoint}%
-}
-
-{
-\catcode`\:=12
-\gdef\pgfmanual@pretty@collectargs@finish@collectpoint#1{%
- \expandafter\pgfutil@in@\pgfmanual@pretty@colon{#1}%
- \ifpgfutil@in@
- \def\pgfmanual@pretty@collectpoint@getcoordsystem##1:##2\relax{%
- \begingroup
- \pgfmanual@pretty@restorespaces
- % remove active spaces from ##1:
- \xdef\pgfmanual@pretty@glob@TMPa{##1}%
- \endgroup
- \pgfkeysifdefined{/codeexample/prettyprint/point with cs/\pgfmanual@pretty@glob@TMPa/.@cmd}{%
- \def\pgfmanual@loc@TMPb{\pgfkeysvalueof{/codeexample/prettyprint/point with cs/\pgfmanual@pretty@glob@TMPa/.@cmd}}%
- }{%
- \def\pgfmanual@loc@TMPb{\pgfkeysvalueof{/codeexample/prettyprint/point with cs/.@cmd}}%
- }%
- \expandafter\def\expandafter\pgfmanual@loc@TMPa\expandafter{\expandafter{\pgfmanual@pretty@glob@TMPa}{##2}}%
- \expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa\pgfeov
- }%
- \ifpgfmanualprettyprinterfoundterminator
- \pgfmanual@pretty@collectpoint@getcoordsystem#1)\relax
- \else
- \pgfmanual@pretty@collectpoint@getcoordsystem#1\relax
- \fi
- \else
- \def\pgfmanual@loc@TMPb{\pgfkeysvalueof{/codeexample/prettyprint/point/.@cmd}}%
- \ifpgfmanualprettyprinterfoundterminator
- \pgfmanual@loc@TMPb(#1)\pgfeov
- \else
- \pgfmanual@loc@TMPb(#1\pgfeov
- \fi
- \fi
-}%
-}
-\def\afterpgfmanual@pretty@collectpoint{\pgfmanual@pretty@mainloop}%
-
-% loops through all tokens, assembling the cs name as it goes.
-% #1 is a single token.
-\def\pgfmanual@pretty@collectcs@loop#1{%
- \let\pgfmanual@pretty@collectcs@loop@NEXT=\pgfmanual@pretty@collectcs@loop
- \def\pgfmanual@loc@TMPb{#1}%
- \ifx\pgfmanual@loc@TMPb\pgfmanual@EOI
- \def\pgfmanual@pretty@collectcs@loop@NEXT{\pgfmanual@pretty@collectcs@loop@END #1}%
- \else
- % a csname may only use letters. And: only letters have a
- % positive lcccode!
- \ifnum\lccode`#1=0
- \ifx\pgfmanual@loc@TMPb @%
- % ok, we may also accept an `@':
- \edef\pgfmanual@loc@TMPa{\pgfmanual@loc@TMPa #1}%
- \else
- % This here is the first non-letter.
- \def\pgfmanual@pretty@collectcs@loop@NEXT{\pgfmanual@pretty@collectcs@loop@END #1}%
- \fi
- \else
- % continue iterating and assemble the csname...
- \edef\pgfmanual@loc@TMPa{\pgfmanual@loc@TMPa #1}%
- \fi
- \fi
- \pgfmanual@pretty@collectcs@loop@NEXT
-}%
-\def\afterpgfmanual@pretty@cs{\pgfmanual@pretty@mainloop}%
-
-\def\pgfmanual@pretty@collectcs@loop@END{%
- \pgfkeysifdefined{/codeexample/prettyprint/cs arguments/\pgfmanual@loc@TMPa}{%
- % oh. The collected control sequence expects arguments. That
- % means a lot of work since there are no nestable braces in
- % the token list! All of them have catcode 12... we need to do
- % that manually.
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@cs
- \def\pgfmanual@pretty@collectcs@loop@END@next{%
- \pgfmanualprettyprintercollectargcount
- {\pgfkeysvalueof{/codeexample/prettyprint/cs arguments/\pgfmanual@loc@TMPa}}%
- {\afterpgfmanual@pretty@cs}%
- }%
- }{%
- % re-insert the backslash:
- \edef\pgfmanual@loc@TMPa{\pgfmanual@pretty@backslash \pgfmanual@loc@TMPa}%
- % ok, report the macro and continue with the main loop.
- \def\pgfmanual@loc@TMPb{\pgfkeysvalueof{/codeexample/prettyprint/cs/.@cmd}}%
- \expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa\pgfeov
- \let\pgfmanual@pretty@collectcs@loop@END@next=\afterpgfmanual@pretty@cs
- }%
- \pgfmanual@pretty@collectcs@loop@END@next
-}%
-
-\newif\ifpgfmanualprettyprinterarghasunmatchedbraces
-
-% Collects arguments inside of a token list, dealing with nested
-% catcode-12-braces.
-%
-% #1: is the NUMBER of arguments to collect.
-% #2: is TeX code which shall be invoked after
-% \pgfmanualprettyprinterhandlecollectedargs has been invoked (see
-% below).
-%
-% PRECONDITION:
-% there is a large token list following
-% \pgfmanualprettyprintercollectargcount with balanced braces. The braces
-% have \catcode 12.
-% POSTCONDITION:
-% 1. the arguments will be collected as
-% '<result> := {<first arg>}{<second arg>}',
-% 2.1 the macro \pgfmanualprettyprinternumcollectedargs will contain
-% the *actual* number of *completely* collected arguments,
-% 2.2 the if \ifpgfmanualprettyprinterarghasunmatchedbraces will be
-% set to \c true if the last found argument had an unmatched brace,
-% 3. then, \pgfmanualprettyprinterhandlecollectedargs{<result>} will be
-% invoked. Just define \pgfmanualprettyprinterhandlecollectedargs
-% properly.
-% Afterwards, #2 will be invoked to recover from the argument
-% collection.
-%
-%
-% Example:
-% \pgfmanualprettyprintercollectargcount{2}{\donnextstep}
-% {_12 first argument }_12 {_12 second argument }_12 next tokens%
-%
-% will result in the expansion
-% \pgfmanualprettyprinterhandlecollectedargs{{_1 first argument }_2 {_1 second argument }_2 }
-% \donnextstep
-% next tokens
-%
-%
-%
-% ATTENTION:
-% \pgfmanualprettyprinterhandlecollectedargs will be invoked with a SINGLE
-% argument. The argument as such will contain extra braces, one pair
-% of braces for each of the #1 arguments. These braces will have
-% catcode 1 and 2, i.e. they can *really* be used in TeX. Thus, the
-% finish routine will be invoked with
-% \pgfmanualprettyprinterhandlecollectedargs{{<arg>}}
-% for one argument and with
-% \pgfmanualprettyprinterhandlecollectedargs{{<first arg>}{<second arg>}}
-% for two and more arguments. Note the extra set of braces for one
-% arg.
-% It might happen that not all arguments have been found if
-% end-of-input occured before. The
-% \pgfmanualprettyprinterhandlecollectedargs routine has to check
-% this using the macro \pgfmanualprettyprinternumcollectedargs which
-% contains the actual number of collected args.
-%
-% @remark This macro checks for the end-of-input indicator, \pgfmanual@EOI. In case it encounters
-% \pgfmanual@EOI, it
-% 1. stops collecting, leaving the \pgfmanual@EOI as next token to be read,
-% 2. sets \ifpgfmanualprettyprinterarghasunmatchedbraces to \iftrue if necessary,
-% 3. assigns \pgfmanualprettyprinternumcollectedargs
-% 4. invokes the finish routine.
-% The \pgfmanual@EOI needs to be collected by following routines in
-% this case. You can also use \pgfutil@ifnextchar\pgfmanual@EOI{}{} in
-% following routines to check for \pgfmanual@EOI.
-\def\pgfmanualprettyprintercollectargcount#1#2{%
- \pgfmanualprettyprinterarghasunmatchedbracesfalse
- \begingroup
- \edef\pgfmanual@loc@csargcount{#1}%
- \toksdef\t@afterpgfmanualprettyprinterhandlecollected=10
- \t@afterpgfmanualprettyprinterhandlecollected={#2}%
- \let\c@pgfmanual@pretty@openbracecount=\c@pgf@counta
- \let\c@pgfmanual@pretty@curargcount=\c@pgf@countb
- % I will track open braces and the number of completely
- % collected arguments here:
- \c@pgfmanual@pretty@openbracecount=0
- \c@pgfmanual@pretty@curargcount=0
- %
- % and I will accumulate the argument token lists as such here:
- \toksdef\t@pgfmanual@currentarg=0
- \toksdef\t@pgfmanual@allargs=1
- \t@pgfmanual@currentarg={}%
- \t@pgfmanual@allargs={}%
- %
- \pgfmanual@pretty@collectargs@loop
-}%
-
-% loops through all tokens, collecting the required number of
-% arguments. This involves to track nested braces manually.
-% #1 is a single token.
-\def\pgfmanual@pretty@collectargs@loop#1{%
- \let\pgfmanual@pretty@collectargs@loop@NEXT=\pgfmanual@pretty@collectargs@loop
- \def\pgfmanual@loc@TMPc{#1}%
- \ifx\pgfmanual@loc@TMPc\pgfmanual@EOI
- \ifnum\c@pgfmanual@pretty@openbracecount>0
- \ifpgfmanualpdfwarnings
- \pgfplots@warning{The pretty printer did not found the closing curly brace!? This will potentially lead to display errors}%
- \fi
- \fi
- \edef\pgfmanual@pretty@collectargs@loop@NEXT{%
- \noexpand\endgroup
- \ifnum\c@pgfmanual@pretty@openbracecount>0
- \noexpand\pgfmanualprettyprinterarghasunmatchedbracestrue
- \fi
- \noexpand\def\noexpand\pgfmanualprettyprinternumcollectedargs{\the\c@pgfmanual@pretty@curargcount}%
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@allargs\the\t@pgfmanual@currentarg}%
- \the\t@afterpgfmanualprettyprinterhandlecollected
- \noexpand\pgfmanual@EOI% <- put this token back into token list!
- }%
- \else
- \ifpgfmanualprettycommentactive
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@activenl
- \pgfmanualprettycommentactivefalse
- \fi
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@activepercent
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \pgfmanualprettycommentactivetrue
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@lbrace
- \advance\c@pgfmanual@pretty@openbracecount by1
- \ifnum\c@pgfmanual@pretty@openbracecount>1
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@rbrace
- \advance\c@pgfmanual@pretty@openbracecount by-1
- \ifnum\c@pgfmanual@pretty@openbracecount=0
- % we have one complete argument ready!
- % append it -- with REAL braces if needed:
- \edef\pgfmanual@loc@TMPc{\the\t@pgfmanual@allargs{\the\t@pgfmanual@currentarg}}%
- \t@pgfmanual@allargs=\expandafter{\pgfmanual@loc@TMPc}%
- \t@pgfmanual@currentarg={}%
- %
- % check it we need more arguments:
- \advance\c@pgfmanual@pretty@curargcount by1
- \ifnum\c@pgfmanual@pretty@curargcount=\pgfmanual@loc@csargcount\relax
- \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
- }%
- \fi
- \else
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
- \else
- \ifnum13=\catcode`#1
- % we found a white space (space, TAB or NL) or comment
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \else
- \ifnum10=\catcode`#1
- % we found a white space (space, TAB
- % or NL) with unexpected catcode
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \else
- \ifnum\c@pgfmanual@pretty@openbracecount=0
- \ifpgfmanualpdfwarnings
- \begingroup
- \toks4{#1}%
- \pgfplots@warning{The pretty printer did not find the expected \pgfmanual@loc@csargcount\space arguments (only token \the\toks4 )}%
- \endgroup
- \fi
- \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@pgfmanual@currentarg}%
- \the\t@afterpgfmanualprettyprinterhandlecollected
- \noexpand#1% <- put this token back into token list!
- }%
- \else
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \pgfmanual@pretty@collectargs@loop@NEXT
-}%
-
-\newif\ifpgfmanualprettyprinterfoundterminator
-
-% Collects tokens inside of a token list up to a single delimiting token, dealing with nested
-% catcode-12-braces.
-%
-% #1: is the end token, the delimiter. It won't be collected.
-% #2: is code to invoke after
-% \pgfmanualprettyprinterhandlecollectedargs has been invoked.
-%
-% PRECONDITION:
-% there is a large token list following
-% \pgfmanualprettyprintercollectargcount with balanced braces. The braces
-% have \catcode 12.
-% POSTCONDITION:
-% - the arguments will be collected as
-% '<result> := <token list>'
-% and then, \pgfmanualprettyprinterhandlecollectedargs{<result>} will be
-% invoked. Just define \pgfmanualprettyprinterhandlecollectedargs
-% properly.
-% Then, #2 will be invoked.
-% - The boolean \ifpgfmanualprettyprinterfoundterminator will be set to true if and only if '#1' has been found.
-%
-% @see \pgfmanualprettyprintercollectargcount for more details.
-%
-\def\pgfmanualprettyprintercollectupto#1#2{%
- \pgfmanualprettyprinterarghasunmatchedbracesfalse
- \pgfmanualprettyprinterfoundterminatortrue
- \begingroup
- \def\pgfmanual@loc@delimittoken{#1}%
- \toksdef\t@afterpgfmanualprettyprinterhandlecollected=10
- \t@afterpgfmanualprettyprinterhandlecollected={#2}%
- %
- \let\c@pgfmanual@pretty@openbracecount=\c@pgf@counta
- % I will track open braces here:
- \c@pgfmanual@pretty@openbracecount=0
- %
- % and I will accumulate the argument token lists as such here:
- \toksdef\t@pgfmanual@currentarg=0
- \t@pgfmanual@currentarg={}%
- %
- \pgfmanual@pretty@collectupto@loop
-}%
-
-% loops through all tokens, collecting the required number of
-% arguments. This involves to track nested braces manually.
-% #1 is a single token.
-\def\pgfmanual@pretty@collectupto@loop#1{%
- \let\pgfmanual@pretty@collectupto@loop@NEXT=\pgfmanual@pretty@collectupto@loop
- \def\pgfmanual@loc@TMPc{#1}%
- \ifx\pgfmanual@loc@TMPc\pgfmanual@EOI
- \edef\pgfmanual@pretty@collectupto@loop@NEXT{%
- \noexpand\endgroup
- \ifnum\c@pgfmanual@pretty@openbracecount>0
- \noexpand\pgfmanualprettyprinterarghasunmatchedbracestrue
- \fi
- \noexpand\pgfmanualprettyprinterfoundterminatorfalse
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
- \the\t@afterpgfmanualprettyprinterhandlecollected
- \noexpand\pgfmanual@EOI% <- put this token back into token list!
- }%
- \else
- \ifpgfmanualprettycommentactive
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@activenl
- \pgfmanualprettycommentactivefalse
- \fi
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@activepercent
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \pgfmanualprettycommentactivetrue
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@lbrace
- \advance\c@pgfmanual@pretty@openbracecount by1
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@pretty@rbrace
- \advance\c@pgfmanual@pretty@openbracecount by-1
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \else
- \ifx\pgfmanual@loc@TMPc\pgfmanual@loc@delimittoken
- \ifnum\c@pgfmanual@pretty@openbracecount=0
- % do NOT include the delimit token.
- \edef\pgfmanual@pretty@collectupto@loop@NEXT{%
- \noexpand\endgroup
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
- \the\t@afterpgfmanualprettyprinterhandlecollected
- }%
- \else
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
- \else
- \t@pgfmanual@currentarg=\expandafter{\the\t@pgfmanual@currentarg#1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \pgfmanual@pretty@collectupto@loop@NEXT
-}%
-
-\def\pgfmanual@pretty@collectargs@finish@cs#1{%
- \def\pgfmanual@pretty@collectargs@finish@cs@hasargs{1}%
- \ifnum\pgfmanualprettyprinternumcollectedargs=0
- \ifpgfmanualprettyprinterarghasunmatchedbraces
- \else
- \def\pgfmanual@pretty@collectargs@finish@cs@hasargs{0}%
- \fi
- \fi
- \if\pgfmanual@pretty@collectargs@finish@cs@hasargs1%
- % report the macro and its arguments:
- \pgfkeysifdefined{/codeexample/prettyprint/cs/\pgfmanual@loc@TMPa/.@cmd}{%
- % oh, we have a separate routine for this macro! Ok, use it:
- \edef\pgfmanual@loc@TMPb{\noexpand\pgfkeysvalueof{/codeexample/prettyprint/cs/\pgfmanual@loc@TMPa/.@cmd}}%
- }{%
- % use the generic routine:
- \edef\pgfmanual@loc@TMPb{\noexpand\pgfkeysvalueof{/codeexample/prettyprint/cs with args/.@cmd}}%
- }%
- % re-insert the backslash:
- \edef\pgfmanual@loc@TMPa{{\pgfmanual@pretty@backslash\pgfmanual@loc@TMPa}}%
- \expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa #1\pgfeov
- \else
- % Oh. We probably got |\pgfkeys| instead of |\pgfkeys{arg}|
- % re-insert the backslash:
- \edef\pgfmanual@loc@TMPa{{\pgfmanual@pretty@backslash\pgfmanual@loc@TMPa}}%
- \edef\pgfmanual@loc@TMPb{\noexpand\pgfkeysvalueof{/codeexample/prettyprint/cs/.@cmd}}%
- \expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa\pgfeov
- #1\relax% simply typeset any encountered tokens after the control sequence.
- \fi
-}%
-
-% A user macro which pretty prints a set of keys.
-%
-% If '#1' is NOT an argument for \pgfkeys,
-% \pgfmanualprettyprintpgfkeys will try to recognise at least control
-% sequences (in the same way as usual). Thus, you can even use this
-% method if there *could* be pgfkeys arguments in an automated pretty
-% printing environment.
-%
-% However, '#1' should only have catcode 12 characters with the
-% exception of catcode 13 for newlines, spaces and comments.
-\long\def\pgfmanualprettyprintpgfkeys#1{%
- \ifpgfmanualprettyenabled
- \begingroup
- \pgfmanualprettyprintstyles
- \pgfmanual@pretty@pgfkeys@loop#1\pgfmanual@EOI
- \endgroup
- \else
- #1%
- \fi
-}
-
-\def\pgfmanual@pretty@pgfkeys{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@pgfkeys@start
- \pgfmanualprettyprintercollectupto]{\pgfmanual@pretty@mainloop}%%
-}%
-\long\def\pgfmanual@pretty@pgfkeys@start#1{%
- [%
- \pgfmanual@pretty@pgfkeys@loop#1\pgfmanual@EOI
- ]%
-}%
-% iterates through single tokens, detecting key names and values while
-% it goes.
-\long\def\pgfmanual@pretty@pgfkeys@loop#1{%
- \def\pgfmanual@loc@TMPa{#1}%
- \ifx\pgfmanual@loc@TMPa\pgfmanual@EOI
- \def\pgfmanual@pretty@pgfkeys@loop@NEXT{\relax}%
- \else
- \def\pgfmanual@pretty@pgfkeys@loop@NEXT{\pgfmanual@pretty@pgfkeys@loop}%
- \ifpgfmanualprettycommentactive
- #1%
- \else
- \ifnum13=\catcode`#1
- % we found a white space (space, TAB or NL) or comment
- #1%
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@comma%
- %\let\pgfmanual@pretty@pgfkeys@loop@NEXT=\pgfmanual@pretty@pgfkeys@checkforEOI
- ,%
- \else
- \ifnum10=\catcode`#1
- % another white space... I thought they'd have
- % catcode 13. doesn't matter.
- #1%
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@lbrace
- % braces may not occur in the first place -
- % but there are circumstances where it is
- % convenient to deal with them here (when
- % processing arguments of styles)
- % Do it.
- #1%
- \else
- \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@rbrace
- #1%
- \else
- % found the beginning of a key!
- % We will collect the key name into
- % \toks0.
- \toks0={}%
- %
- % Handle it:
- % FIXME what if we found an opening brace!?
- \def\pgfmanual@pretty@pgfkeys@loop@NEXT{\pgfmanual@pretty@pgfkeys@collectkey #1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \pgfmanual@pretty@pgfkeys@loop@NEXT
-}%
-\def\pgfmanual@pretty@pgfkeys@collectkey#1{%
- \def\pgfmanual@loc@TMPb{#1}%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@collectkey}%
- \ifx\pgfmanual@loc@TMPb\pgfmanual@EOI
- % finish key name.
- \edef\pgfmanual@loc@TMPb{\the\toks0 }%
- \ifx\pgfmanual@loc@TMPb\pgfutil@empty
- \else
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- \fi
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\relax}%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@eq
- % finish key name.
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- #1%
- % now, we do the same with the value - we collect it into
- % \toks0.
- \toks0={}%
- \def\pgfmanual@pretty@pgfkeys@collectvalue@hasconsumedspaces{0}%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@collectvalue}%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@comma
- % finish key name.
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- #1%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@loop}%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@activenl
- % finish key name before newline. This is not
- % necessarily as in TeX, but its simpler here
- % because we don't need special cases for comments
- % and we don't need to gobble following white
- % spaces.
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- #1%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@loop}%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@backslash
- % This is confusing. I simply try to invoke
- % the control sequence code and recover as
- % good as possible. Let's see if that's
- % useful.
- \edef\pgfmanual@loc@TMPb{\the\toks0 }%
- \ifx\pgfmanual@loc@TMPb\pgfutil@empty
- \else
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- \fi
- %
- % we found the start of a control sequence '\command':
- %
- % collect the control sequence name into
- % \pgfmanual@loc@TMPa, but without the backslash:
- \begingroup
- \let\pgfmanual@loc@TMPa=\pgfutil@empty
- \def\afterpgfmanual@pretty@cs{%
- \endgroup
- \pgfmanual@pretty@pgfkeys@loop
- }%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@collectcs@loop}%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@lbrace
- % Braces in key names are allowed (if they
- % are not the first character of a key
- % name)
- \def\pgfmanualprettyprinterhandlecollectedargs##1{%
- \toks1={##1}%
- \edef\pgfmanual@loc@TMPc{%
- \the\toks0 \pgfmanual@pretty@lbrace \the\toks1
- \ifpgfmanualprettyprinterarghasunmatchedbraces
- \else
- \pgfmanual@pretty@rbrace
- \fi
- }%
- \toks0=\expandafter{\pgfmanual@loc@TMPc}%
- }%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{%
- \pgfmanualprettyprintercollectargcount{1}{\pgfmanual@pretty@pgfkeys@collectkey}%
- #1%
- }%
- \else
- \ifx\pgfmanual@loc@TMPb\pgfmanual@pretty@rbrace
- \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
- #1%
- \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@loop}%
- \else
- \toks0=\expandafter{\the\toks0 #1}%
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \pgfmanual@pretty@pgfkeys@collectkey@next
-}%
-\def\pgfmanual@pretty@pgfkeys@collectvalue#1{%
- \def\pgfmanual@loc@TMPb{#1}%
- \let\pgfmanual@pretty@pgfkeys@collectvalue@next=\pgfmanual@pretty@pgfkeys@collectvalue
- \ifx\pgfmanual@loc@TMPb\pgfmanual@EOI
- % the key value is empty.
- %\expandafter\pgfmanual@pretty@pgfkeys@processvalue\expandafter{\the\toks0 }%
- \let\pgfmanual@pretty@pgfkeys@collectvalue@next=\relax
- \else
- \def\pgfmanual@pretty@isconsumed{0}%
- \if\pgfmanual@pretty@pgfkeys@collectvalue@hasconsumedspaces0%
- \ifnum13=\catcode`#1
- % we found a white space (space, TAB or NL)
- #1%
- \def\pgfmanual@pretty@isconsumed{1}%
- \else
- \ifnum10=\catcode`#1
- % another white space... I thought they'd have
- % catcode 13. doesn't matter.
- \def\pgfmanual@pretty@isconsumed{1}%
- #1%
- \fi
- \fi
- \fi
- \if\pgfmanual@pretty@isconsumed0%
- \def\pgfmanualprettyprinterhandlecollectedargs##1{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately.
- \def\pgfmanual@pretty@pgfkeys@collectvalue@next{%
- \pgfmanualprettyprintercollectupto,{\afterpgfmanual@pretty@collectargs@finish@value}#1%
- }%
- \fi
- \fi
- \pgfmanual@pretty@pgfkeys@collectvalue@next
-}%
-\def\afterpgfmanual@pretty@collectargs@finish@value{%
- \pgfutil@ifnextchar\pgfmanual@EOI{%
- \pgfmanual@pretty@pgfkeys@loop
- }{%
- \pgfmanual@pretty@pgfkeys@loop,% re-insert the gobbled comma here!
- }%
-}%
-
-{\catcode`\^^M=13 \catcode`\ =13\relax\catcode`\%=13\relax\gdef\pgfmanual@pretty@restorespaces{\def%{\pgfmanual@pretty@percent}\def^^M{\pgfmanual@pretty@space}\def {\pgfmanual@pretty@space}}}
-
-% #1: the key's name
-\def\pgfmanual@pretty@pgfkeys@processkey#1{%
- \begingroup
- \pgfmanual@pretty@restorespaces
- % remember this key name! It is used when we are dealing with
- % its value later... (if it has a value)
- \xdef\pgfmanual@pretty@pgfkeys@collectkey@keyname{#1}%
- \endgroup
- %
- % check if it is a handled key. FIXME: this could be done in a
- % rigorous way! This here assumes that all key handlers start with
- % '.' and the '.' occurs never right after a '/' otherwise:
- \def\pgfmanual@loc@TMPa{\pgfutil@in@{/.}}%
- \expandafter\pgfmanual@loc@TMPa\expandafter{\pgfmanual@pretty@pgfkeys@collectkey@keyname}%
- \ifpgfutil@in@
- % split into key name and handler name...
- \def\pgfmanual@pretty@splitit##1/.##2\relax{%
- \def\pgfmanual@loc@TMPb{{##1}{.##2}}%
- }%
- \expandafter\pgfmanual@pretty@splitit\pgfmanual@pretty@pgfkeys@collectkey@keyname\relax
- %
- % report key name AND handler:
- \def\pgfmanual@loc@TMPa{\pgfkeysvalueof{/codeexample/prettyprint/key name with handler/.@cmd}}%
- \expandafter\pgfmanual@loc@TMPa\pgfmanual@loc@TMPb\pgfeov
- \else
- % report key name ...
- \def\pgfmanual@loc@TMPa{\pgfkeysvalueof{/codeexample/prettyprint/key name/.@cmd}}%
- \expandafter\pgfmanual@loc@TMPa\pgfmanual@pretty@pgfkeys@collectkey@keyname\pgfeov
- \fi
-}
-\def\pgfmanual@pretty@pgfkeys@processvalue#1{%
- % report or process the value, depending on the keyname.
- % After all, it *may* be a style which needs to be pretty printed
- % as well.
- \pgfkeysifdefined{/codeexample/prettyprint/key value/\pgfmanual@pretty@pgfkeys@collectkey@keyname/.@cmd}{%
- % oh, we have a separate routine for this macro! Ok, use it:
- \edef\pgfmanual@loc@TMPb{\noexpand\pgfkeysvalueof{/codeexample/prettyprint/key value/\pgfmanual@pretty@pgfkeys@collectkey@keyname/.@cmd}}%
- }{%
- % use the generic routine:
- \edef\pgfmanual@loc@TMPb{\noexpand\pgfkeysvalueof{/codeexample/prettyprint/key value/.@cmd}}%
- }%
- \edef\pgfmanual@loc@TMPa{{\pgfmanual@pretty@pgfkeys@collectkey@keyname}}%
- \expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa{#1}\pgfeov
-}
-
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.pdf b/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.pdf
index c1da36bf12f..df006468028 100644
--- a/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.pdf
+++ b/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.tex b/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.tex
index 7db54a967a3..bbda74f0135 100644
--- a/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.tex
+++ b/Master/texmf-dist/doc/latex/tikz-dependency/tikz-dependency-doc.tex
@@ -588,6 +588,46 @@ To decide how high a dependency should be drawn, \pkgname{} uses the formula $s\
\end{key}
+\begin{key}{/depgraph/edge height=\meta{length} (default 0pt)}
+
+ \textit{[New in version 1.2]}
+ As an alternative, |edge height| allows you to set explicitly the height of an edge.
+
+\begin{codeexample}[]
+\begin{dependency}
+ \begin{deptext}[column sep=0.2cm]
+ My \&[.5cm] dog \& also \&[.7cm] likes \&[.4cm] eating \& sausage \& and \& more \& words \\
+ \end{deptext}
+ \depedge{2}{1}{poss}
+ \depedge{4}{2}{nsubj}
+ \depedge{4}{3}{advmod}
+ \depedge{4}{5}{xcomp}
+ \depedge{5}{6}{dobj}
+ \deproot{4}{root}
+ \depedge[edge height=12ex]{9}{1}{rather-long}
+\end{dependency}
+\end{codeexample}
+
+Setting |edge height| overrides the automatic calculation of the edge height. If you set |edge height| at the |dependency| level, all edges will be drawn at the same height, e.g.:
+
+\begin{codeexample}[]
+\begin{dependency}[edge height=2cm]
+ \begin{deptext}[column sep=0.2cm]
+ My \&[.5cm] dog \& also \&[.7cm] likes \&[.4cm] eating \& sausage \& and \& more \& words \\
+ \end{deptext}
+ \depedge{2}{1}{poss}
+ \depedge{4}{2}{nsubj}
+ \depedge{4}{3}{advmod}
+ \depedge{4}{5}{xcomp}
+ \depedge{5}{6}{dobj}
+ \deproot{4}{root}
+\end{dependency}
+\end{codeexample}
+
+\noindent so maybe this is something that you will want to do only in very special cases.
+
+\end{key}
+
At this point, you may be wondering: why are we always drawing dependencies above the text? Indeed, turning links around is not only possible, but also quite easy, and the next key-value pairs allow you to control this behaviour.
\begin{keylist}{/depgraph/edge above=\meta{boolean} (default true),/depgraph/edge below=\meta{boolean} (default false)}
@@ -1497,7 +1537,7 @@ When using |fill| or |shade| with |\wordgroup|, as in the example, be aware of t
\section{\tikzname{} crash course} \label{sec:tikz}
-\textbf{Disclaimer.} \textit{I am making a lot of rough simplifications here to make it possible to explain everything in as little space as possible. Really invite to read the full version of the manual, if you haven't already. It is the only way to really appreciate the elegance and beauty of this \tikzname{} and its incredible potential.}
+\textbf{Disclaimer.} \textit{I am making a lot of rough simplifications here to make it possible to explain everything in as little space as possible. I really invite you to read the full version of the manual, if you haven't already. It is the only way to really appreciate the elegance and the full potential of \tikzname{}.}
\vspace{1cm}
@@ -1506,15 +1546,15 @@ PGF/\tikzname{} is a set of lower/higher level macros that allow you to draw ext
\subsection{\texttt{\textbackslash pgfkeys} and \texttt{\textbackslash tikzset}}
\index{key!key-value pairs}
-\tikzname{} is basically built on top of |pgfkeys|, which is a very flexible and sophisticated system to store key-value pairs. \tikzname{} (and derived packages), such as \pkgname{}, use this system for setting local or global variables, and to pass optional arguments to commands (macros) that can take a large number of configuration option.
+\tikzname{} is basically built on top of |pgfkeys|, which is a very flexible and sophisticated system to store key-value pairs. \tikzname{} (and derived packages such as \pkgname{}) use this system for setting local or global variables, and to pass optional arguments to commands (macros) that can take a large number of configuration option.
The definition of virtually all \tikzname{} macros follows the template:
\cmdname\somecommand\options\marg{first}\dots\marg{last}
-The first argument, optional, is a set of key-value pairs that can be used to set a bunch of options. It is thus possible to reduce to a minimum the number of mandatory arguments \marg{first}\dots\marg{last}, and keep macro's interface lighter and simpler to use. All commands, first parse the key-value pairs, then do what they have to do based on the updated state of the variables.
+The first argument, optional, is a set of key-value pairs that can be used to set a bunch of options. It is thus possible to reduce to a minimum the number of mandatory arguments \marg{first}\dots\marg{last}, and keep a macro's interface lighter and simpler to use. A command first parses the key-value pairs, then do what it has to do based on the updated state of these variables.
-Key names and values can contain spaces, values can be assigned via the |=| sign and commas can be used to separate assignments. Braces can be used for grouping values. So, for example, the assignment |variable one = \{a, b\}, vartwo = c| would result in |a, b| being assigned to |variable one| and |c| to |vartwo|.
+Key names and values can contain spaces, values can be assigned via the |=| sign and commas can be used to separate assignments. Curly braces can be used for grouping values. So, for example, the assignment |variable one = {a, b}, vartwo = c| would result in the set |{a, b}| being assigned to |variable one| and |c| to |vartwo|.
The function which is responsible for parsing key-value pairs is |\pgfkeys|:
@@ -1540,7 +1580,7 @@ As a convenience function, \tikzname{} also defines the following macro:
Some keys only have a name\index{key!without a value} and no value. Without going into details, it won't hurt to know that such keys are either \emph{binary}\index{key!binary} flags or one of a set of alternative options (\emph{choice} keys)\index{key!choice}, so that activating one automatically deactivates the other alternatives in the set.
-Conveniently, |\pgfkeys| also define an inheritance mechanism that allows sub-packages to consume the keys that they can understand, and then pass on to \tikzname{} all the keys that haven't been handled. This fact also makes it possible for a user to specify a key without using its fully qualified name. When introducing a key for the first time, I will always use its fully qualified name, just to make it clear where it belongs. In the examples, though, I will generally prefer to use a more compact notation and only use the ``base name'' of the keys.
+Conveniently, |\pgfkeys| also define an inheritance mechanism that allows sub-packages to consume the keys that they can understand, and then pass on to \tikzname{} all the keys that haven't been handled. This fact also makes it possible for a user to specify a key without using its fully qualified name. When introducing a key for the first time, I generally use its fully qualified name, just to make it clear where it belongs. In the examples, though, I generally prefer to use a more compact notation and only use the ``base name'' of the keys.
\subsection{Basic styling notions}
@@ -1580,8 +1620,9 @@ Let's briefly dive through the most relevant key-value pairs that can be used to
\subsubsection{Outline properties}
These describe the properties of lines. They apply to edges and to the contour of nodes (such as labels and words in the sentence)
-\begin{key}{/tikz/draw}
- This key tells tikz to actually draw the outline of a shape. If draw is not set, then the outline is not drawn. By default, outlines are not drawn.
+\begin{key}{/tikz/draw=\meta{color-spec}}
+ This key tells tikz to actually draw the outline of a shape with the given color. If draw is not set, then the outline is not drawn. By default, outlines are not drawn. \meta{color-spec} can be a color name, such as |red|, |green| or |blue|, or a more complicated expression, such as |red!60!black|, which means ``make a new color made of red for 60\% of red, of black for the rest''. Colors can be specified in many other ways, which we won't cover here.
+
\end{key}
\begin{keylist}[/tikz]{circle,ellipse,rectangle}
Selecting one of this properties allows you to use a different shape to draw a node. When |draw| is selected, by default the node will be drawn as a |rectangle|.
@@ -1592,26 +1633,20 @@ These describe the properties of lines. They apply to edges and to the contour o
\begin{keylist}[/tikz]{very thin,thin,thick,very thick}
Can be used to set the width of a line. |thin| is the default value (corresponding to |0.4pt|).
\end{keylist}
-\begin{key}{/tikz/color=\meta{color-spec}}
- Sets the color used to draw the line. \meta{color-spec} can be a color name, such as |red|, |green| or |blue|, or a more complicated expression, such as |red!60!black|, which means ``make a new color made of red for 60\% of red, of black for the rest''. Colors can be specified in many other ways, which we won't cover here.
-\end{key}
\begin{keylist}[/tikz]{solid,dotted,loosely dotted,densely dotted,dashed,loosely dashed,densely dashed}
Set the kind of line to be used to draw the outline. |solid| is the default (i.e. a continuous line).
\end{keylist}
\subsubsection{Area properties}
These describe the properties of areas. They apply to the background of nodes (such as labels, words in the sentence and word groups).
-\begin{key}{/tikz/fill=\meta{color}}
+\begin{key}{/tikz/fill=\meta{color-spec}}
This key tells tikz to fill the inside of a shape (or a node) with a solid color. Color specification is the same as for |/tikz/draw|.
\end{key}
\begin{key}{/tikz/shade}
Instead of filling the area with a solid color, fill it with a gradient.
\end{key}
-\begin{keylist}[/tikz]{top color=\meta{color},bottom color=\meta{color}}
- If |shade| is set, you can use these two keys to set up a vertical gradient.
-\end{keylist}
-\begin{keylist}[/tikz]{left color=\meta{color},right color=\meta{color}}
- If |shade| is set, you can use these two keys to set up a horizontal gradient.
+\begin{keylist}[/tikz]{top color=\meta{color-spec},bottom color=\meta{color-spec},left color=\meta{color-spec},right color=\meta{color-spec}}
+ Use these two keys to set up either a vertical or an horizontal gradient. Setting any of these properties automatically activates |shade|.
\end{keylist}
\begin{key}{/tikz/inner sep=\meta{length}}
This parameter controls the distance between the outline of a node and its contents (e.g., the text inside the node).