summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-10-29 00:31:31 +0000
committerKarl Berry <karl@freefriends.org>2010-10-29 00:31:31 +0000
commit6bc1f5497cfb2f56d65c80a4c36ea3bad6dc046c (patch)
treef7751da75030fb1e06653eeb44e579fcee09c65f
parented0c7c756e441b2d2ba3633da233fc24361ac0d3 (diff)
pgf 2.10 (28oct10)
git-svn-id: svn://tug.org/texlive/trunk@20236 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/pgf/AUTHORS3
-rw-r--r--Master/texmf-dist/doc/generic/pgf/ChangeLog1466
-rw-r--r--Master/texmf-dist/doc/generic/pgf/FILES763
-rw-r--r--Master/texmf-dist/doc/generic/pgf/INSTALL2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps546
-rw-r--r--Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps618
-rw-r--r--Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex549
-rw-r--r--Master/texmf-dist/doc/generic/pgf/pgfmanual.pdfbin3783193 -> 5346838 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex86
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex162
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex242
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex57
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex20
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex92
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex48
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex291
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex221
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex105
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex35
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex146
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex15
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex56
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex145
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex9
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex44
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex133
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex800
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex22
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex94
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex536
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex159
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex721
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex22
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex79
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex35
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex52
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex53
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex30
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex6
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex96
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex46
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex2166
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex1053
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex37
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex22
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex720
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex43
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex151
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex477
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex411
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex60
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex32
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex266
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex53
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex151
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex225
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex1948
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex451
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex58
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex24
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex118
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex90
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex307
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex250
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex199
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex17
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex528
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex1154
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex96
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex653
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex28
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex58
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex130
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex525
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex405
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex234
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex12
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex473
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex533
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex44
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex26
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex152
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex353
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex164
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex70
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex634
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex34
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex80
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex75
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex128
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex34
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex1301
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex237
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig1108
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex191
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf83
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile15
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile33
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg18
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile15
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile31
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist1464
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile26
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table204
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table24
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table104
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile33
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg16
-rw-r--r--Master/texmf-dist/doc/latex/pgf/README12
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdfbin0 -> 42237 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty147
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex131
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.pdfbin0 -> 24674 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.tex125
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.pdfbin0 -> 17022 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.tex61
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdfbin0 -> 20615 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex25
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/macros.sty46
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex31
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex469
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex60
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex259
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.pdfbin0 -> 11255 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.tex28
-rw-r--r--Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty138
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/external/Makefile18
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex41
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex20
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.tex12
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex12
-rw-r--r--Master/texmf-dist/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex1073
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgf.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgf.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbim.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbim.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbla.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbla.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbma.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbma.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpl.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpl.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpt.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpt.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsh.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsh.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsn.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsn.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfcor.tex (renamed from Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfcor.tex)3
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/frontendlayer/t-tikz.tex (renamed from Master/texmf-dist/tex/context/pgf/frontendlayer/t-tikz.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/math/t-pgfmat.tex (renamed from Master/texmf-dist/tex/context/pgf/math/t-pgfmat.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/systemlayer/t-pgfsys.tex (renamed from Master/texmf-dist/tex/context/pgf/systemlayer/t-pgfsys.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfcal.tex (renamed from Master/texmf-dist/tex/context/pgf/utilities/t-pgfcal.tex)2
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/utilities/t-pgffor.tex (renamed from Master/texmf-dist/tex/context/pgf/utilities/t-pgffor.tex)1
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfkey.tex (renamed from Master/texmf-dist/tex/context/pgf/utilities/t-pgfkey.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfmod.tex (renamed from Master/texmf-dist/tex/context/pgf/utilities/t-pgfmod.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfrcs.tex (renamed from Master/texmf-dist/tex/context/pgf/utilities/t-pgfrcs.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex5
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex88
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex501
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex41
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex197
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex20
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex699
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex158
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex42
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex165
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex20
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex32
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt48
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.cfg3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.tex15
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.xml30
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex265
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex376
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex158
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex29
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex76
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex65
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex46
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex80
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex43
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex2278
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex62
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex38
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex29
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex877
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex1394
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex23
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex9
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex56
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex156
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex81
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex18
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex139
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex22
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex122
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex31
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex84
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex935
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex135
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex197
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex192
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.footprints.code.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.fractals.code.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex187
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathmorphing.code.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex)52
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.shapes.code.tex)0
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex347
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex91
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex114
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.text.code.tex233
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex637
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex1965
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex767
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex223
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex512
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex243
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex515
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex409
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex1097
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex681
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex680
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex176
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.IEC.code.tex)83
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.US.code.tex)664
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex98
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex)2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.callouts.code.tex)2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex)2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex)6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.misc.code.tex)804
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex1354
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex)312
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex9
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex343
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex2376
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/math/pgfmathbase.code.tex)155
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex713
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex240
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex179
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex320
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/math/pgfmathrnd.code.tex)45
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex112
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex (renamed from Master/texmf-dist/tex/generic/pgf/math/pgfmathtrig.code.tex)131
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathoperations.code.tex1488
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex1532
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex35
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex3035
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex334
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex451
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex111
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex85
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex236
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex69
-rw-r--r--Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex138
-rw-r--r--Master/texmf-dist/tex/generic/pgf/rendering/pgfrendertransform.code.tex117
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def152
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def13
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def396
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def104
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def309
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex31
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex43
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex583
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex405
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex1016
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex339
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def131
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def37
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def72
-rw-r--r--Master/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex65
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex414
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex1095
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.sty12
-rw-r--r--Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex68
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/pgffor.sty1
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty6
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty144
-rw-r--r--Master/texmf-dist/tex/plain/pgf/utilities/pgffor.tex1
318 files changed, 61200 insertions, 11489 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/AUTHORS b/Master/texmf-dist/doc/generic/pgf/AUTHORS
index 6ff615fb975..8bd3d5bde95 100644
--- a/Master/texmf-dist/doc/generic/pgf/AUTHORS
+++ b/Master/texmf-dist/doc/generic/pgf/AUTHORS
@@ -1,2 +1,3 @@
Till Tantau <tantau@users.sourceforge.net>
-Mark Wibrow \ No newline at end of file
+Mark Wibrow
+Christian Feuersaenger <ludewich@users.sourceforge.net>
diff --git a/Master/texmf-dist/doc/generic/pgf/ChangeLog b/Master/texmf-dist/doc/generic/pgf/ChangeLog
index 59e78c56e82..6b0704d18ca 100644
--- a/Master/texmf-dist/doc/generic/pgf/ChangeLog
+++ b/Master/texmf-dist/doc/generic/pgf/ChangeLog
@@ -1,3 +1,1469 @@
+2010-10-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ Released version 2.10
+
+2010-10-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - closed a lot of bugs on sourceforge, especially documentation bugs
+ - fixed bug 2429749: gnuplot invocation in tabularx did not work.
+
+2010-10-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed bug: there was an incompatibility between pgf and beamer due to a
+ missing \interlineskip in the shipout handling for latex.
+
+2010-10-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - renamed 'halfcircle' marker to 'halfcircle*' and added 'halfcircle'.
+ - provided special case 'mark color=none' for the half-filled markers.
+
+2010-10-13 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed incorrect fill/stroke coloring of new marker contributions (see
+ ChangeLog 2010-09-27)
+ - added more predefined dashed and dotted line patterns for black/white plots
+ to fulfill a related feature request of Tomek
+ - fixed bug: the 'name path global' feature did not work in every case...
+ the actual implementation might need to be revised eventually.
+
+2010-10-12 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Imported spell checking results of Stefan Pinnow (thanks!)
+ - Dealed with typo in 'sci generic' number formatting style: it now
+ accepts 'mantissa' *and* 'mantisse'
+
+2010-10-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - External lib: Fixed bug. The 'failed ref warnings for' was not properly \protect'ed.
+
+2010-09-27 Till Tantau <tantua@users.sourceforge.net>
+
+ - Started on graph lib. Not yet finished and not documented.
+
+
+2010-09-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added plot markers of Magnus Tewes and Tomek: halfcircle, halfsquare*,
+ halfsquare left*, halfsquare right*, heart
+
+2010-09-08 Till Tantau <tantua@users.sourceforge.net>
+
+ - Added \pgfpositionnodelater and \pgfpositionnodenow
+ commands.
+
+
+2010-08-31 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - externalization+\ref: fixed a bug
+
+2010-08-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: documented how to generate .png graphics and added support
+ switches.
+
+2010-08-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added 'baseline=default', 'trim left=default' and 'trim right=default' choices to reset these keys.
+
+2010-08-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added support to provide paragraphs in "pin" arguments
+
+2010-08-24 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked on data visualization and its documentation.
+
+
+2010-08-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - basic level externalization: added \hoffset=0pt and \voffset=0pt to improve
+ compatibility with special document classes
+ - added docs for \deferredanchor feature contributed by Christophe Jorssen <cjorssen@users.sourceforge.net>
+ - ConTeXt support: fixed loading problem of calendar lib
+
+
+2010-08-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - pgfsys-tex4ht.def: fixed problem with \par in a non-long macro argument,
+ thereby eliminating a compilation problem
+ - pgfsys-tex4ht.def: renamed offending macro invocation \Par to \par
+
+
+2010-08-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - basic level image externalization: added '/pgf/images/trim external={<left>}{<bottom>}{<right>}{<top>}'
+ to allow modifications to the hardcoded '1truein' shifts.
+ - added '/.style n args' key.
+ - \usetikzlibrary / \usepgflibrary: added support for white-space trimming
+ and empty arguments in the lists. Now, lines do not need to be terminated
+ by '%' and ',,' is valid.
+
+2010-08-13 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: documented how to solve compatibility problems with
+ \tikzifexternalizing
+
+2010-08-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \deferredanchor feature contributed by Christophe Jorssen <cjorssen@users.sourceforge.net>
+
+2010-08-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added optimized and numerically stable arc path command
+ \pgfpatharctoprecomputed which interpolates start- and end points
+
+2010-07-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: fixed incompatibility with 2010/06/08 v2.0b eso-pic package
+
+2010-07-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: added sanity checking for failed \ref,\pageref,\cite commands in external images.
+
+2010-07-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - math parser: improved error messages by providing the complete math expression.
+
+2010-06-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added 'trim left' and 'trim right' features to simplify bounding box
+ modifications and allow support for restricted bounding boxes and image
+ externalization.
+
+2010-06-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - pgfutil-latex.def: changed \usepackage to \RequirePackage (thanks to Christophe Jorssen)
+ - external lib: added \tikzappendtofigurename{} shortcut for '\tikzset{external/figure name/.add={}{suffix}}'
+
+2010-06-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: added warning at end of document if not all graphics have
+ been found.
+
+2010-06-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - updated file 'tikzexternal.sty' for \label and \ref support inside of
+ externalized graphics
+ - documented how \label and \ref support in external graphics works.
+ - activated \label support for mode=convert with system call and
+ documented limitations.
+
+2010-06-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \tikzifinpicture{<true code>}{<false code>} macro
+
+2010-05-31 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked on data visualization.
+
+2010-05-30 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added .list key handler.
+
+2010-05-26 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked on data visualization.
+
+2010-05-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved sanity checking in number printer: now, the zero flag is
+ checked even if its exponent > 0
+
+2010-04-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - floatparsenumber: number format errors after exponents now contain the offending
+ character instead of '\relax'
+
+2010-04-12 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - number printer: added 'frac denom' and 'frac whole' for fine tuning of
+ fractional number printing.
+
+2010-04-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - number printer: made \protect portable across TeX variants (doesn't
+ produce bugs with context anymore)
+ - fpu: optimized \pgfmathfloatgetflagstomacro
+
+2010-04-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfresetboundingbox
+ - added \pgfgetlastxy coordinate macro
+ - added '/pgf/images/include external/<image name>' code key.
+
+2010-04-08 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fpu: added convenience method \pgfmathfloattoint
+
+2010-03-31 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - number printer: added 'frac' style to automatically create fractionals.
+
+2010-03-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - splitted basic level file pgfcoreimage.code.tex: there is now a
+ pgfcoreexternal.code.tex file.
+
+2010-03-24 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - \pgfmathprintnumber is no longer a "fragile" command (it is \protect'ed
+ automatically in LaTeX).
+
+2010-03-23 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed baseline alignment with "text width" option in LaTeX.
+
+2010-03-23 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - New divide function
+ - Rewrote code foreach extensions. Now no longer an impenetrable mess.
+ pgffor.code.tex is much larger, but contains some (as yet) undocumented
+ features which may get optimised out.
+
+2010-03-19 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Image externalization: added '/pgf/images/aux in dpth' feature.
+ It allows to store \label and other .aux file related stuff in the image's
+ .dpth file which is processed when when the main document includes the
+ image.
+ The new switch is on for the semi-automatic modes of the external lib, otherwise it is
+ off.
+
+2010-03-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - pgfkeys: added '.code n args' handler. The difference to '.code
+ args={#1#2#3}' is that keys defined with 'code n args' gobble spaces
+ between the arguments.
+ Note: 'code 2 args' remains as-is (it has the special feature that the
+ second argument is optional).
+ - fixed bug in '/.add code' key handler: it didn't work properly for
+ complicated keys
+ - pgfkeys manual section: updated xrefs and docs
+
+2010-03-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: \tikzexternalize no longer needs (but still accepts) the
+ main job's name. Changes are now documented and the replacement |.sty|
+ file has been updated.
+ - intersection lib: added 'name path global' feature.
+
+2010-03-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: partially fixed incompatibility with glossary package and
+ documented work-around
+
+2010-03-05 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - FPU: added \pgfmathfloatifapproxequalrel
+ - number printing: added style to configure |sci precision|
+ - number printing: added style to configure |std=<lower e>:<upper e>|
+
+2010-03-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: the <real job's name> argument from \tikzexternalize is
+ now optional. It can be deduced automatically if it is missing.
+
+2010-02-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - number printing: added 'sci generic' style to customize the appearance
+ of scientific format and a 'verbatim' style which doesn't use TeX macros
+ for the formatted numbers.
+
+2010-02-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: now, a |\jobname.auxlock| file will be generated in order
+ to detect whether the \jobname.aux file is in its final state. This allows
+ to export any images containing |\ref{}| manually; the automatic procedure
+ will not use the .aux file.
+
+2010-02-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added \ifpgfexternalreadmainaux switch. Will be used to avoid buffering
+ problems during externalization mode 'convert with system call'.
+
+2010-02-16 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bug "papersize not supported by pgfsys-xetex.def - ID: 2934982"
+
+
+2010-02-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Improved automatic cross referencing: auto key path prefixing failed for
+ spaces in key paths.
+
+2010-02-08 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added "on background layer" key to backgrounds lib.
+
+2010-02-02 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfmathifisint
+ - supported \nofiles in auto xref generation
+
+2010-02-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - externalization: both, basic layer and external lib now support \ref{}s
+ inside of externalized pictures. Furthermore, they won't generate any aux
+ files on their own (which wouldn't be thread safe and is not useful
+ anyway)
+
+2010-01-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: fixed bug with figure list/makefile handling and file
+ deps: calling file dependency handlings outside of a picture could result
+ in compilation failures
+
+2010-01-27 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: mode=list and make now supports the force remake keys.
+ - external lib: the -shell-escape switch for nested system calls is
+ activated only if it was active for the main document. This should allow a
+ reasonable security measure for mode=list and make (which will also work
+ without system calls from within TeX).
+
+2010-01-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: added support for file dependencies.
+ For mode=list and make, any file dependencies configured with
+ \tikzpicturedependsonfile{<name>} will be checked by the generated
+ makefile.
+
+
+2010-01-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - profiler library now uses an output file which contains the current date
+ and time. Furthermore, it counts every invocation and allows to show every
+ command invocation (optionally with arguments expanded).
+
+2010-01-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - profiler library can now profile macros with arbitrary argument pattern
+ and is more rebust with respect to save stack usage
+
+2010-01-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - worked on profiler library and added docs for it.
+
+2010-01-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added first draft of the pgf 'profiler' library
+
+2010-01-07 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fix for rounded corners affecting custom fills in rectangle
+ split shape.
+
+2009-12-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - updated the 'make dist' documentation target such that it compresses
+ every pdf object. The resulting manual is half as large than without
+ compression, but it requires pdf 1.5 (at least acrobat 6.0).
+
+2009-12-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: some output messages did not respect the 'verbose
+ IO=false' flag; fixed that
+ - fixed buggy treatment of some automatic cross references in manual
+
+2009-12-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: improved the tikzexternal.sty package which can be used
+ without pgf installed.
+
+2009-12-04 Till Tantau <tantau@users.sourceforge.net>
+
+ - added spy library.
+
+2009-12-02 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - imported a patch of Andy Schlaikjer which extends the 'plot gnuplot'
+ feature to read the ``unbounded point'' information provided by gnuplot.
+
+2009-11-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \r@pgf@reada temporary \openin register for compatibility with
+ other packages
+
+2009-11-19 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed an auto xref bug which wrote '\pgfkeys{}' although the manual
+ contained |\pgfkeys|.
+
+2009-11-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: the 'optimize command away' things where not activated
+ accidentally. I fixed it.
+ - added support for new paragraphs in pgfkeys values
+ - fixed bug in |const plot| handler (and all its variants): the first
+ coordinate was transformed twice
+
+2009-11-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - auto xrefs now support point coordinate systems.
+ - auto xrefs now provide an interface to deal with tricky active
+ characters (for |-)
+ - external lib: improved compatibility with |fadings| libary.
+ - replaced 'set terminal table; set output "<file>"' by 'set table "<file>"'
+ to maintain compatibility with the new gnuplot version.
+
+2009-11-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - pgfmanual.pdf: provided a 'make dist' target in version_for_pdftex/en
+ which activates automatic hyper references from codeexamples to key
+ declarations.
+ This utilizes larger memory limits, configured in
+ doc/generic/pgf/text-en/texmf.cnf
+
+2009-11-12 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added the 'small mindmap' style.
+
+2009-11-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - FPU: improved sanity checks and exception handling for the decompose
+ routines (pgfmathfloatgetexponent etc) and the number parser.
+ Added exception 'wrong lowlevel format'.
+
+2009-10-20 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - renamed 'text mark/style' to 'text mark style' and 'text mark/as node'
+ to 'text mark as node' (there are backw. compatibility hooks).
+ This should avoid confusion with '.unknown' handlers.
+
+2009-10-19 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved error recovery of external lib.
+
+2009-10-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - temporarily disabled the auto cross references -- it seems they compile
+ only with increased memory.
+
+2009-10-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Installed preliminary version of automatic cross referencing tool.
+ Now, every codeexample is parsed for options and control sequences which
+ have been defined somewhere else in the document; pdf cross references are
+ built automatically as well.
+ - configured links to be blue throughout the document.
+ - external lib: added \tikzexternaldisable such that partial externalization is possible
+ although the document contains unsupported constructs (where environments
+ can't be identified without macro expansion).
+ The pgfmanual compiles with image externalization now.
+
+2009-10-13 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfutilsolvetwotwoleq to solve 2x2 linear equation systems using
+ column pivotisation and gauss elim. Should result in improved quality
+ compared with \pgftransforminvert as internal equation solver
+
+2009-10-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Defined \pgfdeclaregenericanchor to allow anchors which get the shape
+ name as argument. Only useful internally.
+
+2009-09-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Fixed buggy treatment of white spaces in \jobname and 'plot function'
+ using \pgfutilpreparefilename.
+
+2009-09-04 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bug item #2834141 [wrong reversed double arrows]
+ - Fixed bug item #2834233 [shapes libraries]
+ - Fixed bug item #2822265 [tangent coordinates not working in CVS]
+ - Changed \rm to \tf in Context.
+
+2009-07-31 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: added 'mode=list and make'. Now, image externalisation
+ time can be reduced with 'make -j 2 -f mainfile.makefile'.
+
+2009-07-08 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external lib: fixed treatment of long arguments in \tikz ... ; shortcut
+ command.
+
+2009-06-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed white space bug in \pgfkeysdeactivatefamily
+ - added \pgfmathfloatvalueof
+
+2009-06-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added a '*' feature to '\pgfmathdeclarefunction' which overwrites
+ existing functions.
+
+2009-06-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added '/tikz/no marks' key.
+ - fixed typo in external lib documentation: the key is called 'figure name',
+ not 'file name'
+
+2009-06-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfgettransformentries and \pgfsettransformentries.
+ - updated the external library such that it deals with active characters
+ in the same way as without external library.
+ - fixed bug in fpu cosh, sinh and tanh
+
+2009-06-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - provided two new aliases for key filters, added \pgfkeyssetfamily.
+
+2009-05-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - allowed numbers like '.9' in fpu.
+
+2009-02-29 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fix for signal shape.
+
+
+2009-05-22 Jin-Hwan Cho <jinhwancho@users.sourceforge.net>
+
+ - Applied the patches for dvipdfmx driver,
+ pgf-doc-diff.version2cvs (2009-04-18) and
+ pgf-generic-diff.version2cvs (2009-04-19).
+
+2009-05-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Restored processing of unknown keys in the predefined key filters 'and',
+ 'not', 'or' and 'false': it was not improvement...
+
+2009-05-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed the sequence of arguments of
+ \pgfqkeysactivatefamiliesandfilteroptions and
+ \pgfqkeysactivatesinglefamilyandfilteroptions
+ in the reference manual.
+
+2009-05-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - key filtering: the composed key filter handlers 'not', 'and', 'false' and 'or' now
+ ignore unknown options and call the .unknown handlers.
+ - pgfkeys: removed the experimental \pgfkeyssetdefaultpathforhandled method.
+ It doesn't fit into the clean interface for pgfkeys - and the problem of
+ default paths for handled keys can be solved better with the '/handler
+ config' method.
+
+2009-04-24 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - provided API function \pgfmathfloatifflags to simplify special cases in
+ FPU.
+
+2009-04-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added (primitive) veclen implementation for FPU.
+ - added cosh, sinh, tanh to FPU
+
+2009-04-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed bug in external lib: empty lines in tikzpicture environments were not accepted
+ for some operating modes.
+
+2009-04-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfqpointscale
+
+2009-04-08 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added an optional argument count to 'optimize command away' in external
+ library.
+
+2009-04-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added the |figure name| key to the externalization library
+ - improved docs for externalization library
+
+2009-03-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved sanity checking of floating point comparison: does now also
+ yield results for infty/nan
+ - added fix for precedence bug for unary minus (fix has been suggested by
+ Mark Wibrow, by mail conversation)
+
+2009-03-22 Till Tantau <tantau@users.sourceforge.net>
+
+ - Replaced \z@ by 0pt for context.
+
+2009-03-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - external library: fixed the 'optimize' feature: pictures which won't be
+ exported could not be optimized away (although they should)
+
+2009-03-20 Till Tantau <tantau@users.sourceforge.net>
+
+ - Replaced \toks@ and \voidb@x by \pgfutil@toks@ and
+ \pgfutil@voidb@x.
+
+2009-03-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved docs for .search also.
+ - fixed initial value for 'domain' such that it really uses the default
+ samples=25.
+
+
+2009-03-09 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added patch for context color support in luatex.
+
+2009-02-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved the optimization facilities of the external library:
+ |optimize=false| will now properly restore any optimized material
+ when used in \tikzset
+
+2009-02-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added |/handler config=all,only existing,full or existing|
+ configuration.
+ - added |.search also| key handler as a simple implementation of key
+ search paths.
+ - fixed default value for /tikz/samples at- there are no really 25
+ samples, not 26. I forgot to fix this last time when I fixed 'samples'
+
+2009-02-20 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added |\pgfkeyssetdefaultpathforhandled| feature as improvement for
+ multiple key paths to pgfkeys. Reference documentation and an
+ application example is in the manual.
+
+2009-02-13 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added 'mark=text' which draws arbitrary TeX content as plot marks to
+ plot mark library.
+
+2009-02-06 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added key 'define function' to define simple local functions.
+
+2009-02-04 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked on dv stuff.
+
+2009-02-01 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Index argument to array is automatically truncated to an
+ integer.
+ - Text decoration can now be aligned along or fitted to a path.
+ - Added key '/pgf/decoration/reverse path' to decorate a path
+ backwards.
+
+2009-01-24 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - the FPU deactivation command is now assembled once and for all during
+ its first usage.
+
+2009-01-23 Till Tantau <tantau@users.sourceforge.net>
+
+ - Changed the "ellipse", "circle" and "arc" commands, so that
+ they take options. This gives a much clearer and more
+ flexible syntax. Naturally, the old syntax continues to work
+ as expected.
+ - Documented svg stuff and added tikz interface. Most useful
+ for quickly converting svg pictures to tikz pictures...
+
+2009-01-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed fpu 'round' method - it rounded mantissas instead of the complete
+ number before.
+
+2009-01-22 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed some math stuff
+ - Renamed \pgfpathcurvebetweentime* to
+ \pgfpathcurvebetweentimecontinue.
+ - Added svg.path lib. It allows one to directly use
+ the svg syntax for paths (like "M10 10 L 20 20"). Not yet
+ documented.
+
+2009-01-06 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added tutorial for mind/lecture maps.
+
+2009-01-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - implemented fpu factorial
+ - if the fixed point library is activated, the fpu will be deactivated
+ automatically.
+ - added draft for FPU documentation
+
+2009-01-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed bug in fpu sqrt.
+ - added logical commands to fpu.
+ - fixed bug in fpu related to multi-argument-commands
+ - provided feature to disable fpu manually.
+
+2008-12-31 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added support for pgf 2.00 and the fpu (works only with additional
+ and technical work - the fpu file is not all which is needed)
+ - added pow and greaterthan to FPU
+ - fixed some FPU issues
+ - fixed processing of '/tikz/domain' key - it produced N+1 samples instead
+ of N.
+
+2008-12-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added further functions to fpu; improved sanity checking; fixed smaller
+ bugs related to fpu
+
+2008-12-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - improved internal floating point code: it is possible to change the
+ low-level representation with minimal number of code lines.
+ - modified low-level floating point representation. All high level code
+ should be completely unaffected; the changes are backwards compatible.
+ - Wrote first draft of a floating point unit library (fpu) similar in
+ spirit to the fixed point library of Mark Wibrow.
+ - Moved all floating point math operations (functions) into the fpu
+ library. It is now necessary to include the library in order to use
+ floating point math operations. The number formatting methods are still
+ available as before.
+
+2008-12-28 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added trigonometric functions to floating point unit.
+
+2008-12-17 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added \colorlet to ConTeXt stuff.
+
+2008-12-14 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked some more on data visualization stuff. Still in
+ pre-alpha.
+
+2008-12-11 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfmathfloatexp.
+
+2008-12-07 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - floating point macros now always use the basic pgf math methods for
+ mantisse computations, even if the fixed point library is active.
+
+2008-12-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - 'mark=none' is now equivalent with 'mark=' (disables plot marks).
+ The previous behavior was to issue \pgfuseplotmark{none} which is
+ equivalent to \relax (and wastes time).
+
+2008-12-03 Till Tantau <tantau@users.sourceforge.net>
+
+ - Changed exp function code in
+ pgfmathfunctions.basic.code.tex. It is now *much* more
+ precise for negative values and also more precise for
+ positive values.
+
+2008-11-28 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - optimized \pgfmathfloattofixed for speed (although it introduces
+ redundand zeros)
+ - Added '/pgf/image/include external' command key as public interface
+ to modify the '\includegraphics' command in image externalization routines.
+
+2008-11-24 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed bug with |overlay| option and matrizes: now, cell pictures won't
+ collapse any more if the matrix has |overlay| enabled. However, the
+ matrix' bounding box won't contribute to the image as desired.
+
+2008-11-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added support for active '!' characters (for example in blue!30!black
+ and french babel setting)
+ - modified processing of 'domain' option: the argument is '\edef'ed such
+ that any potentially active ':' characters will be expanded to non-active
+ ones (avoiding errors in the following processing).
+
+2008-11-13 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed \pgfnodealias bug that caused chains to fail in matrices.
+
+2008-10-30 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added shading library, mainly containing the new color wheel
+ shading donated by Ken Starks.
+
+2008-10-27 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - More fixes for insertion of spaces.
+
+2008-10-27 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added square arrow send by
+ gvtjongahung@users.sourceforge.net.
+ - Changed pgfutil-context.def so that driver detection should
+ work once more.
+
+2008-10-27 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed insertion of space when parsing exponents.
+
+2008-10-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added int truncation to floating point unit.
+
+2008-10-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added abs, abserror and relerror to floating point unit.
+
+2008-10-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added sqrt for floating point unit, built on top of pgfmathsqrt.
+
+2008-10-09 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed the wrong lengths of support vectors for circles. Used to
+ be 0.555 (found by trial and error), while the correct value
+ is 4/3*(sqrt(2)-1) = 0.5522847, which gives much better
+ circles.
+ Thanks to Ken Starks for point this out.
+
+2008-10-07 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed rounded rectangle right arc bug.
+
+2008-10-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Fixed missing treatment of 'assume math mode' in \pgfmathprintnumber'
+
+2008-10-05 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed missing switching off of auto anchors in positioning
+ library.
+
+2008-10-01 Till Tantau <tantau@tcs.uni-luebeck.de>
+
+ - Fixed matrix/pdfsync incompatibility.
+
+2008-09-30 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed some parsing bugs with arrays.
+ - Fix for parsing of arrays in TikZ coordinates.
+
+2008-09-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added number formatting option 'min exponent for 1000 sep'.
+
+2008-09-21 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed bug in math parser which inserted spaces into text
+ or picture.
+
+2008-09-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added number formatting style 'sci superscript'
+ Example: formats the number 42 as 4.2^1 instead of 4.2 \cdot 10^1
+
+2008-09-15 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bug "TikZ, the shadow library and ConTeXt MKIV
+ (LuaTeX)".
+
+2008-09-14 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed bug #2105132 for rounded rectangle.
+ - Fixed bug #2044129 for chamfered rectangle.
+
+2008-09-12 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added \pgfpathcurvebetweentime.
+
+2008-09-10 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed problem with nodes on a line inside a picture that is
+ inside a node of another picture. Pictures will now always
+ start with "pos=.5" set.
+
+2008-09-07 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Slight hack of decorations so that the input path can consist of a
+ single move to. This enables stuff like
+ \path [decoration={some decoration}, decorate] (4,5);
+
+2008-09-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed small bug related to '@dec sep mark' and not-a-number in number
+ formatting routines.
+
+2008-09-03 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Solutions for path intersections can now be sorted along either path.
+ - \pgfintersectionsolutions is now a macro, not a count register.
+
+2008-08-31 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - fix for ``Missing character...' warnings in logfile when using
+ foreach.
+ - removed `trim integers' option from foreach as int function
+ can now be used.
+
+2008-08-31 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Rewrote math parser. Anyone who relies on, or has hacked internal
+ parser or function macros, or has defined their own functions for
+ the parser will need to reconsult the code and/or documentation.
+ - Files for functions definitions split (possibly permanantly) into
+ different files.
+ - Scaling of results at the end of the parse is no longer the default
+ action. This doesn't break PGF or TikZ, but it may break user code
+ that depended on this scaling. To turn it back on use
+ \let\pgfmathpostparse=\pgfmathscaleresult.
+ - Modifying existing functions or creating new functions must now be
+ done using \pgfmathdeclarefunction and \pgfmathredeclarefunction.
+ - Single argument functions do not need parentheses, provided the
+ funtion is followed by a space, so sin 60 is the same as sin(60).
+ But! Functions have the highest precedence, so sin 60*\x is the
+ same as sin(60)*\x.
+ - Added {} operators for array specification and [] operators for
+ array access - see docs for details.
+ - added postfix ! factorial operator.
+ - added c++/java style conditional e.g., \x > 10 ? 13 : 20.
+ - added >=, <=, !=, prefix !, &&, || operators.
+ - added atan2, log10, log2, e, int and frac functions.
+ - adapted cosh, sinh and tanh from Martin Heller.
+ - added lua-style random function for generating random integers.
+ - added Mod function (note capital letter). Uses floored division
+ and is never negative.
+ - min, max, veclen and pow can now be nested in any argument
+ position.
+ - min and max can now take a variable number of arguments.
+ - For compatability \pgfmathmax and \pgfmathmin still take two
+ arguments (although these can contain comma separated expressions).
+ However \pgfmathmin@ and \pgfmathmax@ now only take
+ one argument in the form \pgfmathmin@{{1}{2}{3}{4}{5}} (for 5
+ arguments).
+ - added hex, Hex, bin, and oct functions. These functions will not
+ work properly if the post-parse scaling is turned back on.
+ - 0 prefix for integers now specifies an octal number which is
+ automatically converted to base 10.
+ - 0x or 0X prefix for integers now specifies a hexadecimal number,
+ which is automatically converted to base 10.
+ - 0b or 0B prefix for integers now specifies a binary number,
+ which is automatically converted to base 10.
+ - "" characters turn off parsing (!) for part of an expression.
+ - added width, height, and depth functions for text e.g.,
+ width("Some text"), but as an expression is \edef'ed before
+ parsing other commands will have to be `protected' e.g.,
+ width("\noexpand\Huge Some text").
+ - bugfix for tan and cot.
+
+2008-08-27 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added '/tikz/external/export={true,false}' key for externalization
+ library.
+
+2008-08-05 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added documentation for basic layer externalization and baseline option.
+
+2008-07-28 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added 'showpos' key to number printing (and alias 'print sign').
+
+2008-07-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - fixed typo in pgfmathfloat.code.tex
+ - added 'optimize command away=\macro' key to externalization library. It
+ allows to discard unnecessary and possibly expensive user macros during
+ export (unnecessary = not in selected picture).
+
+2008-07-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Fixed bug in system layer path collecting. Very long paths
+ are now processed more efficiently (the bug disabled an optimization).
+
+2008-07-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added "marker" positions into the output of number formatting routines
+ to find period positions (even if no period is typeset) and exponent
+ positions. Allows alignment within auxiliary routines.
+
+2008-07-14 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed dash phase bug.
+ - Fixed missing library include in automata lib.
+ - Added "align" option. "text ragged" and friends are now
+ deprecated. Text width need no longer not, but can, be
+ specified. The following now has the expected effect: \node
+ [draw,align=center] {Hello\\world.};
+
+2008-07-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfqpointxy and \pgfqpointxyz to complement the "quick" point
+ commands in basic layer.
+
+2008-07-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added 'every mark' style.
+ - 'mark options' simply overwrites 'every mark' (consistent with its old
+ definition)
+
+2008-07-07 Till Tantau <tantau@users.sourceforge.net>
+
+ - Finished circuit library and documentation (well, some
+ shapes still missing, but that's something users should
+ contribute).
+
+2008-07-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - the external library now handles active double quotes ",
+ single quotes ', and active semicolons ';' in its system call
+ correctly. Furthermore, \\ will expand to a normal
+ backslash. The initial system call now uses double quotes
+ for indows compatibility, it also contains the shell-escape
+ feature for gnuplot invocations.
+
+2008-06-30 Till Tantau <tantau@users.sourceforge.net>
+
+ - Did some documentation of circuit lib.
+ - Removed the separated documentation of the intersection
+ library and made this documentation part of the main
+ documentation.
+ - The intersection cs is now deprecated, the documentation
+ is now only based on the intersection lib.
+ - Added a "by" option so that "name intersections={of=A and
+ B,by={c,d,e}}" will create an alias c for intersection-1, d
+ for intersection-2 and e for intersection-3.
+ - Renamed "path name" to "name path" in the intersection
+ lib. This is more consistent with "name intersections".
+
+2008-06-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Minor changes on float stuff, wrote pgfmathfloatmultiply and
+ pgfmathfloatdivide on top of pgfmathmultiply and pgfmathdivide
+
+2008-06-29 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added `Fixed Point Arithmetic' library, which provides
+ a parsing interface to the fp package. Dealing with plotting
+ files still a bit crude.
+ - This library means the manual now requires the fp pacakge
+ to compile.
+ - Fixed floor function for negative numbers.
+ - Fixed \pgfmathsetseed.
+ - Font and group fix for external documentation.
+
+2008-06-27 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Complete change of TikZ intersections (PGF unchanged).
+ - Slight hack of the TikZ scopes library to permit local
+ path naming. Should work...
+
+2008-06-26 Till Tantau <tantau@users.sourceforge.net>
+
+ - Continued with circuit library.
+ - Introduced subdirectories inside the pgf library
+ directory and moved libs into them.
+ You may need to update your checkout.
+
+2008-06-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - The external library now typesets as horizontal material by issueing
+ \leavevmode. This fixes an inconsistency with the normal tikzpictures.
+
+2008-06-25 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added intersection library + documentation for
+ intersecting ``named'' paths.
+
+2008-06-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Fixed bug in external library. Now, strings like '#1' occuring
+ somewhere in an image is collected correctly.
+
+2008-06-24 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Removed new intersection stuff. Need to restart from scratch...
+
+2008-06-23 Till Tantau <tantau@users.sourceforge.net>
+
+ - Started working on circuit library documentation.
+
+2008-06-23 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added PGF code and docs for intersections of two curves and
+ intersections of a line and a curve.
+ - Fixed bug in foreach code when registers are used with dots
+ statement.
+
+2008-06-22 Till Tantau <tantau@users.sourceforge.net>
+
+ - Created first version of circuit libraries for electrical
+ engineering (circuits.ee.*).
+ - Added libraries so that ee circuits and logical circuits can
+ be accessed using the same interface. (circuits.logic.*)
+ - The tikz lib shapes.gates.logic.* will no
+ longer be needed, the circuits.logic.* will replace them. (The
+ pgf libs shapes.gates.* are still used as before, however.)
+ - Minor patch in shapes.gates.logic.US so that the .0 and .180
+ anchors of a not gate or a buffer gate are the same as the
+ input or output anchors.
+ - All this is not documented, yet.
+ - Worked some more on dv stuff, but nothing to "show", yet.
+
+2008-06-21 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed parsing bug in foreach code.
+ - Added "rotate fit" key to fit library, so (e.g.) a rotated
+ rectangle can be fitted around nodes/coordinates.
+
+2008-06-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added documentation for tikz 'external' library.
+ - created pgfexternalwithdepth.tex file to use the 'baseline' information.
+ - improved some issues of the external library.
+ - Added '/pgf/images/draft' option
+ - Modified implementation of draft images to show the image file name
+ instead of the internal image name
+
+2008-06-19 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added tikz library 'external' which allows automatic or semiautomatic
+ export of each tikzpicture to pdf. Documentation is not yet ready.
+ - Added self-contained latex package tikzexternal.sty to read those images
+ without tikz/pgf installed.
+ - Added support for the 'baseline' option in \beginpgfgraphicnamed ... \endpgfgraphicnamed
+ by storing the box depth into a separate file.
+
+2008-06-19 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added first ideas for a circuit library.
+ - Bugfixes in scoping behaviour.
+ - Changed scoping rules for to path operation: Options are now
+ local. This may break existing code, but is much more
+ consistent with everything else and removes other problems.
+ - Patched mindmap lib to account for these changed rules.
+ - Added insert path option.
+ - Deprecated "after node path". Use "append after command" and
+ "prefix after command" instead.
+ - Moved datavisualization libraries to separate subdirectory.
+
+2008-06-18 Till Tantau <tantau@users.sourceforge.net>
+
+ - Changed label and pin options once again, to allow more
+ flexibility. In particular, the angle can now be
+ omitted. Also, for rotated main nodes the anchors are now
+ chosen in more sensible ways.
+
+2008-06-16 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added tiny little turtle graphics library for fun.
+ - Changed scoping rules for \foreach statement on a path: the
+ last coordinate is now persistent not only after the foreach
+ statement, but also between different iterations.
+ - Changed positioning of "label" when you attach a label to a
+ transformed shape. The position is now absolute with respect
+ to the page, unless the "transform shape" option is used.
+
+2008-06-11 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed the bug fix for character checking in foreach.
+ - Updates and fixes for new foreach code.
+
+2008-06-13 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bug in new \foreach stuff that causes an error on
+ things like \foreach \i in {1,...,\foo}. If a list element
+ is a macro, no is-it-a-character check is done.
+
+2008-06-11 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Checked in proposed \foreach extensions. Possibly the
+ extensions would be better contained in a pgflibrary...
+ - list items can now be evaluated.
+ - dots replacement is context sensitive.
+ - sequences indicated by dots can be character sequences.
+ - a list item can be ``remembered'' in the next iteration.
+ - access to the number of the current item in the list is
+ provided.
+
+2008-06-09 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked a bit on data visualization stuff.
+
+2008-06-07 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added '/pgf/number format/1000 sep' and 'dec sep' shortcut
+ styles which simply call 'set thousands separator' and 'set
+ decimal separator'. Those option are somewhat long...
+
+2008-06-06 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed the "local bounding box" option so that it honors the
+ "relevant for picture size"-if.
+
+2008-06-04 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed buggy "mid left" and "mid right" options.
+ - Added "between positions" option to the "mark" option. This
+ makes it possible to create paths with "repeated arrows along
+ the path". This did not work before.
+
+2008-06-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added '/pgf/number format/assume math mode' to disable math checks.
+ This allows to assemble tabulars, apply \pgfmathprintnumber to each cell
+ and use the dcolumn package to align at decimal separators (no
+ documentation for that feature yet)
+
+2008-06-02 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed pgfpages in conjunction with everyshi.
+
+2008-05-31 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Semantics of |/pgf/number format/fixed zerofill| changed: it now simply
+ sets a boolean which affects all numbers in fixed format; it does not
+ SET fixed format. The same holds for sci zerofill.
+
+2008-05-30 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Provided \pgfmathprintnumberto macro in addition to
+ \pgfmathprintnumber.
+
+2008-05-22 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Revised Lindenmayer system stuff. Documentation should
+ now be up to date.
+
+2008-05-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added 'xbar interval' and 'ybar interval' plot handlers.
+ - Moved plot handler options to /pgf key tree.
+ - added 'bar shift' option.
+ - bar width option is now evaluated when needed.
+ - Added documentation for plot handler library changes and for tikz-plot
+ interfaces.
+ - Modified pgf manual macros: codeexamples section now employs pgfkeys,
+ xkeyval no longer required. Introduced style 'every codeexample' to
+ maintain compatibility and allow customization for users.
+
+2008-05-21 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added missing documentation of moveto-decoration.
+
+2008-05-20 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Changed the processing of \pgflsystemstep. Now a TeX
+ dimension, it permits a symbol to shorten the step.
+
+2008-05-19 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added Lindemayer system drawing library.
+ - Renamed the ranomization keys for the step and angle.
+ - Updated the L-system docs.
+
+2008-05-19 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added documentation of oo-subsystem.
+ - Started documentation of data visualization-subsystem.
+ - Fixed hyperlink problem in dvipdfm(x)/xetex.
+ - Fixed typos in Lindemayer system doc.
+
+2008-05-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added \pgfmathfloatadd, \pgfmathfloatsubtract and
+ \pgfmathfloatmultiplyfixed based on pgf's normal math parser
+ - Added tests for float arithmetics
+ - Added \pgfmathfloattoextentedprecision for 8-digit mantisse precision
+ - Added documentation for these methods
+ - Added basic layer input stream methods to set zero levels for [xy]comb/[xy]bar;
+ allows to start bars at different offsets than x=0 / y=0.
+ - Added documentation for zero level streams.
+
+2008-05-15 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added "path picture" option, mostly for the implementation
+ of the corrected mindmap connecting bars.
+ - Fixed buggy code of mindmap connect bars: Shading angles
+ where sometimes wrong and shading was sometimes at the wrong
+ position.
+
+2008-05-14 Till Tantau <tantau@users.sourceforge.net>
+
+ - Completely rewrote management of pdf resources. This affects
+ pdftex, dvipdfm, dvipdfmx and xetex backends and all front
+ ends. They should now all work together in harmony, as far
+ as this is supported by them.
+ - Completely rewrote driver detection in plain and context
+ mode.
+ - dvipdfmx and xetex now use \special{pdf:literal direct},
+ which can *considerably* reduce file sizes (up to a factor
+ of 2).
+
+2008-05-14 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed compatability issue with old calc code.
+
+2008-05-13 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - documented '.lasttry' key handler
+ - introduced documentation for key filtering routines (as \input section
+ in pgfmanual-en-pgfkeys.tex). Main section of pgfkeys not really updated
+ yet; I only removed the 'family limitation' item in the introduction.
+
+2008-05-11 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Multiple fixes for signal shape.
+
+2008-05-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - added \pgfplotbarwidth and docs
+ - used \pgfmathparse to assign \pgfsetplotbarwidth
+ - added 'const plot mark right' to plot handler library to complete the
+ different variants of left/right connected/jump handlers.
+
+2008-05-01 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fixed parser for expressions that begin and end with braces.
+
+2008-04-27 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added \pgfmathapproxequalto operation and documentation below
+ \pgfmathequalto
+ - Added some user-interface methods to floating point arithmetics
+ - Added options
+ /pgf/number format/set decimal separator
+ /pgf/number format/set thousands separator
+ /pgf/number format/skip 0.
+ - Added documentation for floating point arithmetics
+ - Added documentation for number printing
+
+2008-04-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added PGF plot handlers to plot handler library:
+ - \pgfplothandlerxbar
+ - \pgfplothandlerybar
+ with parameter \pgfsetplotbarwidth{} and
+ - \pgfplothandlerconstantlineto
+ - \pgfplothandlerjumpmarkleft
+ - \pgfplothandlerjumpmarkright
+ - Added Tikz-Plot handlers
+ - /tikz/xbar
+ - /tikz/ybar
+ with option '/tikz/bar width' and
+ - /tikz/const plot
+ - /tikz/jump mark left
+ - /tikz/jump mark right
+ - Added documentation for new plot handlers to Tikz- and plot handler
+ section in manual
+
+2008-04-23 Till Tantau <tantau@users.sourceforge.net>
+
+ - Documented changed double line handling.
+ - Made some arrow tips work with double lines.
+
+2008-04-22 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added (not yet documented) "inner lines", which move the
+ double line mechanism from tikz to the basic layer. This
+ allows the definition of special arrow tips for double lines.
+ - Added (not yet documented) new arrow tip "implies" using
+ this mechanism.
+
+2008-04-21 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - New version of rectangle split shape. Now supports horizontal
+ as well as vertical spliting. Also supports up to 20 parts.
+
+2008-04-17 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added pgfkeysfiltered.code.tex which provides key filtering
+ and provides key-selection utilities like xkeyvals families
+ - changed pgfkeys.code.tex to '\input' pgfkeysfiltered.code.tex
+
+2008-04-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added \tikzaddtikzonlycommandshortcutlet and
+ \tikzaddtikzonlycommandshortcutdef to install shortcut commands at the
+ beginning of tikzpicture.
+ - pgfkeys.code.tex: fixed incompatibility .try with .is choice
+
+2008-04-10 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed patterns in dvips mode (were broken).
+
+2008-04-03 Till Tantau <tantau@users.sourceforge.net>
+
+ - Switched to everyshi in latex mode to hack into
+ \shipout. Wrote direct code to hack into \shipout in plain
+ mode. Hacking into \shipout in Context is still unclear.
+ - Added space arrow.
+
+2008-4-02 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Reimplemented parsing of operands.
+
+2008-04-01 Till Tantau <tantau@users.sourceforge.net>
+
+ - Added cirlce solidus shape by Manuel Lacruz.
+
+2008-03-19 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - `curve control points' decoration no longer exists. It is
+ replaced by the `show path construction' decoration.
+ - added code + docs for defining changable patterns.
+ - Parser altered to access \pgfmathfloatparsenumber when
+ \ifpgfmathfloat is true (old interface to \pgfmathfloat deleted).
+
+2008-03-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+
+ - Added generic/pgf/math/pgfmathfloat.code.tex
+ - Modified pgfmath.code.tex to include pgfmathfloat.code.tex
+ - Added generic/pgf/testsuite/mathtest/pgfmathtestsuite.tex [dvipdfm/pdflatex]
+ which provides testing for pgfmathfloat.code.tex
+
+2008-03-17 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed minimum width handling in rounded rectangle shape.
+
+2008-03-12 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added key for rectangle split to ignore empty parts.
+ - Extended \pgfshadecolortorgb to define macros for the
+ individual color components.
+
+2008-03-08 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Added `curve control points' decoration for drawing
+ curve controls. NB: names/keys may change.
+
+2008-03-07 Mark Wibrow <vibrovski@users.sourceforge.net>
+
+ - Fix for (some) `hidden' bugs: ``Missing character:
+ There is no <char> in font nullfont!''. This is usually
+ only seen in log file. Fixed for star, circular sector
+ and math macros.
+
+2008-03-03 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed documentation "placment" replaced by "positioning"
+ - Fixed ConTeXt page resource problem. (ConTeXt support is
+ still not as smooth as support of other formats)
+ - Checked in some data visualization stuff, without any
+ documentation. Everything still likely to change
+ completely.
+ - Moved module management to pgfutil.
+ - Added support for simple oo-programming, not documented.
+
+2008-02-26 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bug in pgfkeysaddvalue.
+ - Fixed bug of stack leak in function shadings in postscript.
+ - Fixed missing image inclusion documentation.
+ - Fixed atan bug in documentation example.
+ - Fixed missing dependency of chains--positioning library
+ - Fixed missing dependency of mindmap--decorations library
+
+2008-02-20 Till Tantau <tantau@users.sourceforge.net>
+
+ Released version 2.00
+
2008-02-14 Till Tantau <tantau@users.sourceforge.net>
- Fixed "initial"/"accepting" distance bug.
diff --git a/Master/texmf-dist/doc/generic/pgf/FILES b/Master/texmf-dist/doc/generic/pgf/FILES
index a9549e8488f..941e8a18ab7 100644
--- a/Master/texmf-dist/doc/generic/pgf/FILES
+++ b/Master/texmf-dist/doc/generic/pgf/FILES
@@ -1,329 +1,434 @@
-pgf-2.00/context/pgf/basiclayer/t-pgf.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbim.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbla.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbma.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbpl.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbpt.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbsh.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfbsn.tex
-pgf-2.00/context/pgf/basiclayer/t-pgfcor.tex
-pgf-2.00/context/pgf/frontendlayer/t-tikz.tex
-pgf-2.00/context/pgf/math/t-pgfmat.tex
-pgf-2.00/context/pgf/systemlayer/t-pgfsys.tex
-pgf-2.00/context/pgf/utilities/t-pgfcal.tex
-pgf-2.00/context/pgf/utilities/t-pgffor.tex
-pgf-2.00/context/pgf/utilities/t-pgfkey.tex
-pgf-2.00/context/pgf/utilities/t-pgfmod.tex
-pgf-2.00/context/pgf/utilities/t-pgfrcs.tex
-pgf-2.00/doc/generic/pgf/AUTHORS
-pgf-2.00/doc/generic/pgf/ChangeLog
-pgf-2.00/doc/generic/pgf/FILES
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo-mask.bb
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo-mask.jpg
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.bb
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.eps
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.25.jpg
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.bb
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.eps
-pgf-2.00/doc/generic/pgf/images/brave-gnu-world-logo.jpg
-pgf-2.00/doc/generic/pgf/images/pgfmanual-mindmap-1.pdf
-pgf-2.00/doc/generic/pgf/images/pgfmanual-mindmap-2.pdf
-pgf-2.00/doc/generic/pgf/INSTALL
-pgf-2.00/doc/generic/pgf/licenses/gnu-free-documentation-license-1.2.txt
-pgf-2.00/doc/generic/pgf/licenses/gnu-public-license-2.txt
-pgf-2.00/doc/generic/pgf/licenses/latex-project-public-license-1.3c.txt
-pgf-2.00/doc/generic/pgf/licenses/LICENSE
-pgf-2.00/doc/generic/pgf/licenses/manifest-code.txt
-pgf-2.00/doc/generic/pgf/licenses/manifest-documentation.txt
-pgf-2.00/doc/generic/pgf/macros/pgfmanual-en-macros.tex
-pgf-2.00/doc/generic/pgf/pgfmanual.pdf
-pgf-2.00/doc/generic/pgf/README
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-license.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-main.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
-pgf-2.00/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-exp.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-exp.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-parametric-example.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-parametric-example.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-sin.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-sin.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-x.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgf-x.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgfmanual-sine.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgfmanual-sine.table
-pgf-2.00/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.gnuplot
-pgf-2.00/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.table
-pgf-2.00/doc/generic/pgf/TODO
-pgf-2.00/doc/generic/pgf/version-for-dvipdfm/en/Makefile
-pgf-2.00/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
-pgf-2.00/doc/generic/pgf/version-for-dvipdfm/pgfmanual-dvipdfm.cfg
-pgf-2.00/doc/generic/pgf/version-for-dvips/en/Makefile
-pgf-2.00/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
-pgf-2.00/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.cfg
-pgf-2.00/doc/generic/pgf/version-for-pdftex/en/Makefile
-pgf-2.00/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
-pgf-2.00/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
-pgf-2.00/doc/generic/pgf/version-for-tex4ht/en/Makefile
-pgf-2.00/doc/generic/pgf/version-for-tex4ht/en/pgfmanual.tex
-pgf-2.00/doc/generic/pgf/version-for-tex4ht/pgfmanual-tex4ht.cfg
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/Makefile
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/pgfmanual.tex
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot
-pgf-2.00/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table
-pgf-2.00/doc/generic/pgf/version-for-vtex/pgfmanual-vtex.cfg
-pgf-2.00/generic/pgf/basiclayer/pgfcore.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorearrows.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoreimage.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorelayers.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoreobjects.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorepathusage.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorepatterns.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorepoints.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorequick.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcorescopes.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoreshade.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoretransformations.code.tex
-pgf-2.00/generic/pgf/basiclayer/pgfcoretransparency.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
-pgf-2.00/generic/pgf/frontendlayer/tikz/tikz.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryarrows.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.footprints.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.fractals.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.pathmorphing.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.shapes.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarydecorations.text.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryfadings.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarypatterns.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryplothandlers.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryplotmarks.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.callouts.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.gates.logic.IEC.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.gates.logic.US.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.misc.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex
-pgf-2.00/generic/pgf/libraries/pgflibrarysnakes.code.tex
-pgf-2.00/generic/pgf/math/pgfmath.code.tex
-pgf-2.00/generic/pgf/math/pgfmathbase.code.tex
-pgf-2.00/generic/pgf/math/pgfmathcalc.code.tex
-pgf-2.00/generic/pgf/math/pgfmathoperations.code.tex
-pgf-2.00/generic/pgf/math/pgfmathparser.code.tex
-pgf-2.00/generic/pgf/math/pgfmathrnd.code.tex
-pgf-2.00/generic/pgf/math/pgfmathtrig.code.tex
-pgf-2.00/generic/pgf/math/pgfmathutil.code.tex
-pgf-2.00/generic/pgf/modules/pgfmoduledecorations.code.tex
-pgf-2.00/generic/pgf/modules/pgfmodulematrix.code.tex
-pgf-2.00/generic/pgf/modules/pgfmoduleplot.code.tex
-pgf-2.00/generic/pgf/modules/pgfmoduleshapes.code.tex
-pgf-2.00/generic/pgf/modules/pgfmodulesnakes.code.tex
-pgf-2.00/generic/pgf/systemlayer/pgf.cfg
-pgf-2.00/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-common-pdf.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-common-postscript.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-common-svg.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-dvi.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-dvipdfm.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-dvips.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-pdftex.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-tex4ht.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-textures.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-vtex.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys-xetex.def
-pgf-2.00/generic/pgf/systemlayer/pgfsys.code.tex
-pgf-2.00/generic/pgf/systemlayer/pgfsysprotocol.code.tex
-pgf-2.00/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
-pgf-2.00/generic/pgf/utilities/pgfcalendar.code.tex
-pgf-2.00/generic/pgf/utilities/pgfexternal.tex
-pgf-2.00/generic/pgf/utilities/pgffor.code.tex
-pgf-2.00/generic/pgf/utilities/pgfkeys.code.tex
-pgf-2.00/generic/pgf/utilities/pgfrcs.code.tex
-pgf-2.00/generic/pgf/utilities/pgfutil-common.tex
-pgf-2.00/generic/pgf/utilities/pgfutil-context.def
-pgf-2.00/generic/pgf/utilities/pgfutil-latex.def
-pgf-2.00/generic/pgf/utilities/pgfutil-plain.def
-pgf-2.00/latex/pgf/basiclayer/pgf.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbaseimage.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbaselayers.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbasematrix.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbasepatterns.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbaseplot.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbaseshapes.sty
-pgf-2.00/latex/pgf/basiclayer/pgfbasesnakes.sty
-pgf-2.00/latex/pgf/basiclayer/pgfcore.sty
-pgf-2.00/latex/pgf/compatibility/pgfarrows.sty
-pgf-2.00/latex/pgf/compatibility/pgfautomata.sty
-pgf-2.00/latex/pgf/compatibility/pgfcomp-version-0-65.sty
-pgf-2.00/latex/pgf/compatibility/pgfcomp-version-1-18.sty
-pgf-2.00/latex/pgf/compatibility/pgfheaps.sty
-pgf-2.00/latex/pgf/compatibility/pgflibraryarrows.sty
-pgf-2.00/latex/pgf/compatibility/pgflibraryautomata.sty
-pgf-2.00/latex/pgf/compatibility/pgflibraryplothandlers.sty
-pgf-2.00/latex/pgf/compatibility/pgflibraryplotmarks.sty
-pgf-2.00/latex/pgf/compatibility/pgflibraryshapes.sty
-pgf-2.00/latex/pgf/compatibility/pgflibrarysnakes.sty
-pgf-2.00/latex/pgf/compatibility/pgflibrarytikzbackgrounds.sty
-pgf-2.00/latex/pgf/compatibility/pgflibrarytikztrees.sty
-pgf-2.00/latex/pgf/compatibility/pgfnodes.sty
-pgf-2.00/latex/pgf/compatibility/pgfshade.sty
-pgf-2.00/latex/pgf/frontendlayer/pgfpict2e.sty
-pgf-2.00/latex/pgf/frontendlayer/tikz.sty
-pgf-2.00/latex/pgf/math/pgfmath.sty
-pgf-2.00/latex/pgf/systemlayer/pgfsys.sty
-pgf-2.00/latex/pgf/utilities/pgfcalendar.sty
-pgf-2.00/latex/pgf/utilities/pgffor.sty
-pgf-2.00/latex/pgf/utilities/pgfkeys.sty
-pgf-2.00/latex/pgf/utilities/pgfpages.sty
-pgf-2.00/latex/pgf/utilities/pgfrcs.sty
-pgf-2.00/latex/pgf/utilities/xxcolor.sty
-pgf-2.00/plain/pgf/basiclayer/pgf.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbaseimage.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbaselayers.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbasematrix.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbasepatterns.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbaseplot.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbaseshapes.tex
-pgf-2.00/plain/pgf/basiclayer/pgfbasesnakes.tex
-pgf-2.00/plain/pgf/basiclayer/pgfcore.tex
-pgf-2.00/plain/pgf/frontendlayer/tikz.tex
-pgf-2.00/plain/pgf/math/pgfmath.tex
-pgf-2.00/plain/pgf/systemlayer/pgfsys.tex
-pgf-2.00/plain/pgf/utilities/pgfcalendar.tex
-pgf-2.00/plain/pgf/utilities/pgffor.tex
-pgf-2.00/plain/pgf/utilities/pgfkeys.tex
-pgf-2.00/plain/pgf/utilities/pgfrcs.tex
-pgf-2.00/README
+pgf/doc/generic/pgf/images/brave-gnu-world-logo-mask.jpg
+pgf/doc/generic/pgf/images/brave-gnu-world-logo-mask.bb
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.bb
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.eps
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.jpg
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.bb
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.eps
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.jpg
+pgf/doc/generic/pgf/images/pgfmanual-mindmap-1.pdf
+pgf/doc/generic/pgf/images/pgfmanual-mindmap-2.pdf
+pgf/doc/generic/pgf/licenses/LICENSE
+pgf/doc/generic/pgf/licenses/gnu-free-documentation-license-1.2.txt
+pgf/doc/generic/pgf/licenses/gnu-public-license-2.txt
+pgf/doc/generic/pgf/licenses/latex-project-public-license-1.3c.txt
+pgf/doc/generic/pgf/licenses/manifest-code.txt
+pgf/doc/generic/pgf/licenses/manifest-documentation.txt
+pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex
+pgf/doc/generic/pgf/text-en/plots/pgfmanual-sine.table
+pgf/doc/generic/pgf/text-en/plots/pgf-x.table
+pgf/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-asymptotic-example.table
+pgf/doc/generic/pgf/text-en/plots/pgf-exp.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-exp.table
+pgf/doc/generic/pgf/text-en/plots/pgf-parametric-example.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-parametric-example.table
+pgf/doc/generic/pgf/text-en/plots/pgf-sin.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-sin.table
+pgf/doc/generic/pgf/text-en/plots/pgf-x.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgfmanual-sine.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.table
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
+pgf/doc/generic/pgf/text-en/texmf.cnf
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-license.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-main.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-oo.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
+pgf/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvipdfm/en/Makefile
+pgf/doc/generic/pgf/version-for-dvipdfm/pgfmanual-dvipdfm.cfg
+pgf/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
+pgf/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg
+pgf/doc/generic/pgf/version-for-dvips/en/Makefile
+pgf/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.cfg
+pgf/doc/generic/pgf/version-for-pdftex/en/Makefile
+pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist
+pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
+pgf/doc/generic/pgf/version-for-tex4ht/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-tex4ht/en/Makefile
+pgf/doc/generic/pgf/version-for-tex4ht/pgfmanual-tex4ht.cfg
+pgf/doc/generic/pgf/version-for-vtex/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-vtex/en/Makefile
+pgf/doc/generic/pgf/version-for-vtex/pgfmanual-vtex.cfg
+pgf/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-xetex/en/Makefile
+pgf/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg
+pgf/doc/generic/pgf/ChangeLog
+pgf/doc/generic/pgf/AUTHORS
+pgf/doc/generic/pgf/pgfmanual.pdf
+pgf/doc/generic/pgf/FILES
+pgf/doc/generic/pgf/INSTALL
+pgf/doc/generic/pgf/README
+pgf/doc/generic/pgf/TODO
+pgf/tex/context/third/pgf/basiclayer/t-pgf.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbim.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbla.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbma.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbpl.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbpt.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbsh.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbsn.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfcor.tex
+pgf/tex/context/third/pgf/frontendlayer/t-tikz.tex
+pgf/tex/context/third/pgf/math/t-pgfmat.tex
+pgf/tex/context/third/pgf/systemlayer/t-pgfsys.tex
+pgf/tex/context/third/pgf/utilities/t-pgfcal.tex
+pgf/tex/context/third/pgf/utilities/t-pgffor.tex
+pgf/tex/context/third/pgf/utilities/t-pgfkey.tex
+pgf/tex/context/third/pgf/utilities/t-pgfmod.tex
+pgf/tex/context/third/pgf/utilities/t-pgfrcs.tex
+pgf/tex/latex/pgf/basiclayer/pgfbaseimage.sty
+pgf/tex/latex/pgf/basiclayer/pgf.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaselayers.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasematrix.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasepatterns.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaseplot.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaseshapes.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasesnakes.sty
+pgf/tex/latex/pgf/basiclayer/pgfcore.sty
+pgf/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
+pgf/tex/latex/pgf/compatibility/pgfarrows.sty
+pgf/tex/latex/pgf/compatibility/pgfautomata.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryplothandlers.sty
+pgf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
+pgf/tex/latex/pgf/compatibility/pgfheaps.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryarrows.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryautomata.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarytikzbackgrounds.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryplotmarks.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryshapes.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarysnakes.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarytikztrees.sty
+pgf/tex/latex/pgf/compatibility/pgfnodes.sty
+pgf/tex/latex/pgf/compatibility/pgfshade.sty
+pgf/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
+pgf/tex/latex/pgf/doc/pgfmanual.code.tex
+pgf/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
+pgf/tex/latex/pgf/doc/pgfmanual.sty
+pgf/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
+pgf/tex/latex/pgf/frontendlayer/pgfpict2e.sty
+pgf/tex/latex/pgf/frontendlayer/tikz.sty
+pgf/tex/latex/pgf/math/pgfmath.sty
+pgf/tex/latex/pgf/systemlayer/pgfsys.sty
+pgf/tex/latex/pgf/utilities/pgfcalendar.sty
+pgf/tex/latex/pgf/utilities/pgffor.sty
+pgf/tex/latex/pgf/utilities/pgfkeys.sty
+pgf/tex/latex/pgf/utilities/pgfpages.sty
+pgf/tex/latex/pgf/utilities/pgfrcs.sty
+pgf/tex/latex/pgf/utilities/tikzexternal.sty
+pgf/tex/latex/pgf/utilities/xxcolor.sty
+pgf/tex/plain/pgf/basiclayer/pgfbaseimage.tex
+pgf/tex/plain/pgf/basiclayer/pgf.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaselayers.tex
+pgf/tex/plain/pgf/basiclayer/pgfbasematrix.tex
+pgf/tex/plain/pgf/basiclayer/pgfbasepatterns.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaseplot.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaseshapes.tex
+pgf/tex/plain/pgf/basiclayer/pgfbasesnakes.tex
+pgf/tex/plain/pgf/basiclayer/pgfcore.tex
+pgf/tex/plain/pgf/frontendlayer/tikz.tex
+pgf/tex/plain/pgf/math/pgfmath.tex
+pgf/tex/plain/pgf/systemlayer/pgfsys.tex
+pgf/tex/plain/pgf/utilities/pgfcalendar.tex
+pgf/tex/plain/pgf/utilities/pgffor.tex
+pgf/tex/plain/pgf/utilities/pgfkeys.tex
+pgf/tex/plain/pgf/utilities/pgfrcs.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcore.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
+pgf/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg
+pgf/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt
+pgf/tex/generic/pgf/frontendlayer/svg/svgtest.cfg
+pgf/tex/generic/pgf/frontendlayer/svg/svgtest.tex
+pgf/tex/generic/pgf/frontendlayer/svg/svgtest.xml
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
+pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex
+pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex
+pgf/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryshadings.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
+pgf/tex/generic/pgf/math/pgfmathcalc.code.tex
+pgf/tex/generic/pgf/math/pgfmath.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
+pgf/tex/generic/pgf/math/pgfmathfloat.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
+pgf/tex/generic/pgf/math/pgfmathparser.code.tex
+pgf/tex/generic/pgf/math/pgfmathutil.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulematrix.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleoo.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleparser.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleplot.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulesnakes.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulesorting.code.tex
+pgf/tex/generic/pgf/rendering/pgfrendertransform.code.tex
+pgf/tex/generic/pgf/rendering/pgfrenderpoints.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsys-dvi.def
+pgf/tex/generic/pgf/systemlayer/pgf.cfg
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-dvips.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-textures.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-vtex.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-xetex.def
+pgf/tex/generic/pgf/systemlayer/pgfsys.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
+pgf/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
+pgf/tex/generic/pgf/utilities/pgfcalendar.code.tex
+pgf/tex/generic/pgf/utilities/pgfexternal.tex
+pgf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
+pgf/tex/generic/pgf/utilities/pgffor.code.tex
+pgf/tex/generic/pgf/utilities/pgfkeys.code.tex
+pgf/tex/generic/pgf/utilities/pgfutil-common.tex
+pgf/tex/generic/pgf/utilities/pgfrcs.code.tex
+pgf/tex/generic/pgf/utilities/pgfutil-context.def
+pgf/tex/generic/pgf/utilities/pgfutil-latex.def
+pgf/tex/generic/pgf/utilities/pgfutil-plain.def
+pgf/README
+pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdf
+pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty
+pgf/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdf
+pgf/source/latex/pgf/incoming/KarlheinzOchs/basics.pdf
+pgf/source/latex/pgf/incoming/KarlheinzOchs/basics.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/fir.pdf
+pgf/source/latex/pgf/incoming/KarlheinzOchs/fir.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty
+pgf/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/macros.sty
+pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex
+pgf/source/latex/pgf/incoming/KarlheinzOchs/placement.pdf
+pgf/source/latex/pgf/incoming/KarlheinzOchs/placement.tex
+pgf/source/latex/pgf/testsuite/external/Makefile
+pgf/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex
+pgf/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex
+pgf/source/latex/pgf/testsuite/external/tikzexternaltest.tex
+pgf/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex
+pgf/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex
diff --git a/Master/texmf-dist/doc/generic/pgf/INSTALL b/Master/texmf-dist/doc/generic/pgf/INSTALL
index bf3469a37bc..f3cb456dc4c 100644
--- a/Master/texmf-dist/doc/generic/pgf/INSTALL
+++ b/Master/texmf-dist/doc/generic/pgf/INSTALL
@@ -7,5 +7,5 @@ For the impatient:
Long version:
In the manual, which you find in the file
-doc/generic/pgf/version-for-pdftex/en/pgfmanual.pdf, you will find a
+doc/generic/pgf/pgfmanual.pdf, you will find a
detailed explanation on how to install pgf.
diff --git a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps
index 9c02410d1d2..7fc67685fa9 100644
--- a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps
+++ b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.25.eps
@@ -1,4 +1,469 @@
-%!PS-Adobe-3.0 EPSF-3.0 %%Title: brave-gnu-world-logo.25.eps %%CreationDate: 09.10.2006 22:09 Uhr %%BoundingBox: 0 0 342 387 %%HiResBoundingBox: 0 0 342 387 %%SuppressDotGainCompensation %%EndComments %%BeginProlog %%EndProlog %%BeginSetup %%EndSetup %ImageData: 342 387 8 3 0 1 3 "beginimage" %BeginPhotoshop: 13952 % 3842494D0425000000000010000000000000000000000000000000003842494D % 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F % 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050 % 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C % 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63 % 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C % 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65 % 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48 % 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72 % 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 % 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61 % 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579 % 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63 % 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269 % 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265 % 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D % 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A % 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D % 30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B % 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909 % 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65 % 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F % 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F % 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E % 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070 % 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A % 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74 % 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465 % 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 % 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F % 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E % 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130 % 2D30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F % 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F % 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909 % 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B % 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D % 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579 % 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61 % 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C % 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F % 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579 % 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F % 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74 % 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579 % 3E0A090909093C646174653E323030362D31302D30395432303A30333A33365A % 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74 % 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F % 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E % 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F % 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 % 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 % 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A % 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E % 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D % 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070 % 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909 % 09093C646174653E323030362D31302D30395432303A30333A33365A3C2F6461 % 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572 % 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261 % 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E % 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F % 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 % 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 % 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B % 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B % 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469 % 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E % 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E % 0A090909093C646174653E323030362D31302D30395432303A30333A33365A3C % 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E % 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465 % 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61 % 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70 % 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574 % 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E % 7072696E742E50616765466F726D61742E504D41646A75737465645061676552 % 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61 % 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A % 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E % 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909 % 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D % 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374 % 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909 % 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C % 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561 % 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C % 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E % 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E % 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E % 323030362D31302D30395432303A30333A33365A3C2F646174653E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461 % 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E % 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09 % 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E % 50616765466F726D61742E504D41646A75737465645061706572526563743C2F % 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73 % 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C % 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261 % 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C % 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170 % 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909 % 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138 % 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09 % 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272 % 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 % 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63 % 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67 % 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B % 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036 % 2D31302D30395432303A30333A33365A3C2F646174653E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C % 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765 % 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64 % 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065 % 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E % 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070 % 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A % 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69 % 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64 % 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50 % 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909 % 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C % 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269 % 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C % 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 % 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431 % 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E % 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C % 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C % 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D % 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374 % 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170 % 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E % 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C % 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E % 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F % 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E % 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A % 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265 % 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69 % 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65 % 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C % 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 % 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432 % 303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E % 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C % 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C % 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D % 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963 % 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65 % 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61 % 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67 % 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909 % 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374 % 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E % 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C % 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C % 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909 % 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63 % 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070 % 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64 % 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039 % 5432303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E % 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65 % 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909 % 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09 % 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E % 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09 % 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372 % 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65 % 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465 % 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963 % 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170 % 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909 % 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B % 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74 % 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465 % 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A % 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C % 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09 % 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64 % 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273 % 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E % 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909 % 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065 % 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 % 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963 % 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C % 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74 % 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F % 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74 % 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269 % 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64 % 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048 % 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048 % 0000000002D802280001000000640000000100030303000000017FFF00010001 % 0000000000000000000000006808001901900000000000200000000000000000 % 0000000000000000000000000000000000003842494D03ED0000000000100048 % 00000001000200480000000100023842494D042600000000000E000000000000 % 000000003F8000003842494D040D0000000000040000001E3842494D04190000 % 000000040000001E3842494D03F3000000000009000000000000000001003842 % 494D040A00000000000100003842494D271000000000000A0001000000000000 % 00023842494D03F5000000000048002F66660001006C66660006000000000001 % 002F6666000100A1999A0006000000000001003200000001005A000000060000 % 00000001003500000001002D000000060000000000013842494D03F800000000 % 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000 % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF % FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000 % 00010000024000000240000000003842494D041E000000000004000000003842 % 494D041A00000000036300000006000000000000000000000183000001560000 % 001700620072006100760065002D0067006E0075002D0077006F0072006C0064 % 002D006C006F0067006F002E0032003500000001000000000000000000000000 % 0000000000000001000000000000000000000156000001830000000000000000 % 0000000000000000010000000000000000000000000000000000000010000000 % 010000000000006E756C6C0000000200000006626F756E64734F626A63000000 % 01000000000000526374310000000400000000546F70206C6F6E670000000000 % 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300 % 000000526768746C6F6E670000015600000006736C69636573566C4C73000000 % 014F626A6300000001000000000005736C6963650000001200000007736C6963 % 6549446C6F6E67000000000000000767726F757049446C6F6E67000000000000 % 00066F726967696E656E756D0000000C45536C6963654F726967696E0000000D % 6175746F47656E6572617465640000000054797065656E756D0000000A45536C % 6963655479706500000000496D672000000006626F756E64734F626A63000000 % 01000000000000526374310000000400000000546F70206C6F6E670000000000 % 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300 % 000000526768746C6F6E67000001560000000375726C54455854000000010000 % 000000006E756C6C54455854000000010000000000004D736765544558540000 % 0001000000000006616C74546167544558540000000100000000000E63656C6C % 54657874497348544D4C626F6F6C010000000863656C6C546578745445585400 % 000001000000000009686F727A416C69676E656E756D0000000F45536C696365 % 486F727A416C69676E0000000764656661756C740000000976657274416C6967 % 6E656E756D0000000F45536C69636556657274416C69676E0000000764656661 % 756C740000000B6267436F6C6F7254797065656E756D0000001145536C696365 % 4247436F6C6F7254797065000000004E6F6E6500000009746F704F7574736574 % 6C6F6E67000000000000000A6C6566744F75747365746C6F6E67000000000000 % 000C626F74746F6D4F75747365746C6F6E67000000000000000B72696768744F % 75747365746C6F6E6700000000003842494D041100000000000101003842494D % 0414000000000004000000013842494D040C0000000011340000000100000071 % 00000080000001540000AA000000111800180001FFD8FFE000104A4649460001 % 0201004800480000FFED000C41646F62655F434D0002FFEE000E41646F626500 % 648000000001FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15 % 18131315131318110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C % 0C0C0C0C0C0C0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E % 14110C0C0C0C0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C % 0C0C0C0C0C0C0C0C0C0C0C0CFFC00011080080007103012200021101031101FF % DD00040008FFC4013F0000010501010101010100000000000000030001020405 % 060708090A0B0100010501010101010100000000000000010002030405060708 % 090A0B1000010401030204020507060805030C33010002110304211231054151 % 611322718132061491A1B14223241552C16233347282D14307259253F0E1F163 % 733516A2B283264493546445C2A3743617D255E265F2B384C3D375E3F3462794 % A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797 % A7B7C7D7E7F71100020201020404030405060707060535010002110321311204 % 4151617122130532819114A1B14223C152D1F0332462E1728292435315637334 % F1250616A2B283072635C2D2449354A317644555367465E2F2B384C3D375E3F3 % 4694A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767 % 778797A7B7C7FFDA000C03010002110311003F00F5549249252952EA5D6303A6 % B01C9B3F48E04D74B06EB1D1FBACFDCFCDF56CD94FEFD8A9F5AEB8EC4B1B8182 % CF5BA85A040896B377D17387B7D4B1DB7D94FF00D72EF4AA50E93F57C54F766F % 513F69CDB4EE739E43849FECB5AE733E87B7F435FD0A2AAAA494969FAC06FD6A % C0CA73791ED64F9E82C72B9566DF63B6FD8EE66B05CF35868F3FE777BBFB0C56 % 80F979240009294275911E09D2492535322DEA35585D5555E4526206E2C7B74F % 76ED2C6DBEEFDDF4FF00E2FF00C22A77F51EAFF46BC7C7A9C7F3ADB6C81F9DF4 % 7D0ABF35BFBEB5D2494E5E066E7DAE8BDF8CFD09D94EEDC60EDFCF73BF3BF796 % 931E1ED04692260F2151EA1D1E9CB3EAD4EFB3E50D45AD120FFC755F46DFFCF9 % FCB553A7F53BC669E9FD440A731809601F42D1AFE998FF00F09BA3D9FF00A53D % 8929DB49327494A49249253FFFD0F55599D77ABFECDA18DA5A2CCCC825B8EC3A % 8111BEE7810E732ADECF637F9DB5F553FA3F53D5669AE4F12D6F53EB36752B3D % F57A831F10088D8D163FD4DDB7E8B696DD97F43E9E4D74FF00A2494E8740E91E % 8B1F999536655F2E7BDC649DC439DBB46B7DDB7F37FF003C7A55ADBF34CC6ED6 % 86F8052494A49258791F59EB7DBF67E9349EA16FFA469DB5027DA3F4B0EF57FA % D5B7D1FF0086494EE24B370733A8D8FDB96CA5A4CC8ADD3B6086EDE5DB9FB9DF % C853EA3D6FA7F4EDADBDE4DCF12CA2B05D6113B6767E637F9566C494DF4967E2 % F59AB206EFB3DF5375F73DA3B6A67D373DCAF32C658DDCC70703DC24A64B3BAD % F4A6F52C4DAC8665D277E2DA646D7FEEB8B7FC15BFCDDBFF006E7F395D6B4524 % 94E3F42EA8FCEA032F9664D07D3B6B321DB99ED79B3E97FEAE5B0B987B8627D6 % 6CCF4CED65B48B1FB7B13E9B777F9C3D477F5D74CD208D381A7DDA24A5D24924 % 94FF00FFD1F547025A434C3A343E6B95FAAAE68C4A75DA7DF519D00B1E2835EF % 67B7E936A733DDF9F52EAD60E574BC9C0CBBB3701A6EC6CA9765E20FA41C4973 % EDA3F7F7B8EED9F4FD4FE6FE9FE8D29DB37541BBDCE01BC1713027E2A166661D % 4D2FB6FAEB6375739CF6803E24959B5E4D790C635AE9DA76D8DB25C5A63F384B % 1CFB2BDAA4DE89D2FD3F57228640F77BF489ECFF00A2D494E65D9197F59AF763 % 636EA3A55662C79106D3CFBDA47B5BFB98EFFF00D0BFFB8AB6B1FA562E352296 % B4069FCD048DC63DDB8B8EF7EEFCFF007FFE05FA34B1EE6399E874F6B1B4D6ED % 81EC1EC6E81EE867B3F7FF007D068E9F6FDAB7643DD786C1208105C3875BEEF7 % 7FC055FA5F47F9CFE752009DBF15A6755E2DD6D0DADB0D6C37521ADD00D1C36B % 581BB550B6BC1392F71654ECD11BC020DAD6E9B7D92EB7DCDFDDF52C7AD0B1AD % 9DE40DEE01AEE4CB44BB6FE6AAB8A5D91634E562D7518B1ECF7377B06E6ED63D % A3DDEA58D77AB76DFD1D7FCDFBD2063746FE8A24F4AFF0BD281D958ED690F2EA % F7E9B4CC03EDFD1EDFF02E74B37D5F4FDFFA556A9C864876E0D6C7B23BE9FB8D % FA5FF93FF068EDA61CE6C35CC70F708E67F7964BB1FD5C9B7EC47EC81AFF004D % A1DB832C786C96FA2F1ED6FF0053FEDBB13B849BAD695C7FBDE9E8EC5993454D % 9BAC6543C5CE0047C5D0B3737EB3F4BC7696D160CCC8FCCA68F749FE5DAD9AEB % FF00ABFDCAEC556DC9739FF63EA558AED322B9FE69F103D967B7F44DF67A9EE6 % 7FD6958C7C66B59EC6358ED443181A07F298FF00D35D637DDFA3F4DBFF006D26 % AE73B031B2ADCD7E56701F6ACA2CB1F5813B6B043AA6ECFCDF5ACA29AAADDF4F % 1E9CABAEFF0008BA7ADBB5B1E249FBC9720518B5B786901C4971792E738E8DDC % F73FDDEEDBB7FE2995D7FCD2B49294924924A7FFD2F55492492520BB131AD70B % 2CAC1B1BC5834788F0B1BB5EAB64E48345C08FB5381DAFC6ADA1E040DCEA4EEF % DE6BBDCFB91731D9EF70A30C32ADD05F91619869277368A5BEEB2EF6FF0085F4 % AAFD27F86F7D4876E217EFB3A85E3ECC047A0D3B6B826375EF9DF91EDF66C7FE % 87FE0AD40D9D00DFAA083DE97C66E558FAEDC9BAB68FA5563E39961046DF7DAF % DAFC86B5AEF66DAA867F215AB9C5AD0448931204F6EEA149AC173995892434B9 % A002E81B771FCD4AE739DB1F503635AE2486380D60B750EDAD7FF9E8C850D100 % 820EBDDCCBD96BAC739D7FA75D624B18DFFA565B61FF00A0C594EEB1496EFA1B % 6B9F4BA77BB6B5AE274DB66DDCEDBFC9DAB6ADE9F8F98D7D598CB5C09DE2A712 % CD3F976D2FD963777F2D3E1BF16B2DAF02B365434229D82961F377B773FF007F % 6FA8A200750C03181F30D7C3F97A9CEFB45D9353AABDE0525A1F153C8D9DB67E % 8EB2E66DFA75D9BFF46B55D9CEAF2EBA2DA5EFA5EC97646D90D33B5A5E59F98F % 9FFAC7FC56FF0042A757EA34E2B4D2D6B6DC8B012E635DED6B4FB77E44FD062A % 755DD66DC57D8D76350C8F4BD67B9CD718FCEADCF6BAB73754E8896E02E88978 % 70F8BB39189899B43314B89A5B04110E0E05AEDA196582CF7B7F9CDECFD325D2 % 31DD46132AB2CF55ED2438F8104FE8F977F37F450BA6613DB41BAFBBD7C8BD8C % 6DEE6BB4696496D34D94FA7FA3A9F659EFDBEA588F45D915BC372FD30EB6368A % C1FA41BFA5DEE27DDF454B44824EFD596EA8550D9B8924926AE524924929FFD3 % F554C74D53A8BDA1ED2D3C1E47924A44CB1FF69B1AF2D02016346A4B40D6C7FB % 7DBB9FEC6FFC5A0BB3706CCC6E31BEB75C06E65421CE691FE11DF4B67F21567E % 0DD915BDF97A5971F731A4B9AD00FE8AA6CFEEB7F9DFF4967A8957F64E9EE656 % DDAD2E92F7C06807F96EFDE530803B1B95550FE2D696522C513ADBA2DC7A8012 % DDC7C5DA93F1944F6B60683B008745ECB9BB9A6478F8A8B1EF0FF4DD5B84925D % 669B493FD53BFF00CE6A866640D166870571446FD833B68A6D20D8D0E2D9027C % 0FD26FF55CA9D580FC2A5CDC67B4971DCEB2FDC63C5DB1AE6D7F47F36BF415C6 % 58C2D1E9CB9BC0238FF3BF393DAF656C2EB012D04030D2EE4EDFA2D0EFFCC134 % 709D579DABBBCE3F0F2B3DD7065FEB536C7AD94DFD1B1DE9977A7563D156F73E % A6EFFD25B65D67A9FF0017B158FB0E261DB4D977A7EA39BB2AF6973811FE8F76 % E72D2A3AB74FBC5A59688A1CE6DA4F0DDBF9CE7FF36D67F2B77FE09BD1DD451B % 8DA58DDF1F4C8D614D0C911A01A3164C529697FF0072D2C3ADF4836DAF739D61 % 009768E33A37467B559C8B1B5D4D6BD9BD847B817098FA3A6FFA7F4BF7D1DA1A % 00DBC762B23AC6506D4D0F6C5AED6AD636C3873FBDBFD9FA2FF0B67E8D899932 % 13B685118184753C44BAB8F732FA596B0CB5C3BE864687FE9222CCFABC727F67 % 4640877A961699E5AE77A9C7E66C73FD2DBFF06B4D0F3661B6AA49249253FFD4 % F5550B63D27CC81B4EA2678EDB21FF00E6A9A6735AE696B84B5C2083C1052521 % 756DB7D37133B007026473DF669EE5917B76BDF6BEB796D7616D4C716D758FE5 % 0FCEB372D2B32DEC6D0D6D42CB6DD1E1AE68637696B6EF7D858E77A5BBF32BFC % C51FD9D5BB25F9169F56C71258481B5A3B358DFDEDBF9EA6C79044907A7460CB % 8CCA363525AACCBCD758DAEB6358D03DDB89E4FEEED5A34D8F6B0BAF78D3BC6D % 1F892A4DA76C00040F1D4A1370DDB8BAD7FAAE719F701007EEB1A94A5097411F % CD8F1C32C28EFE1D190BECB2C0DA9AD2CFCE7870D3FAAD83B9584014EC3B8B8B % 8766E908A663DC62398D1472AD299E065AF10D5AD7D599BB6D26B7D446A2E930 % 7F77D9FCE31DFCBFA1FF000BBFF461AB1B230B1B2AE786E55AE3BEBC7AC7A758 % DAD8AE9AD8E758DDCE7FB9F77E7FFDB6AF36D63EB0FACEF69E0B759F8154F32E % C8C70F758F636A26597381DACFE45CDDDF4BFD1DDFF5BFD17E8FD5611C3A81AA % FB02CD5F7F1497DD15C5A62752C64C9FE40DB0EFF5FA0B16D75965B664871391 % EB86D0D0FDD5D15967A5F687532DFD2BB75DE9FF00C27E8FFD221E5E5B9DF67B % CD576CB5F1481A3AD77954E76F6334FF00468DD3F14D4CB2ECD0319D63CD950B % 1BC47E84DB65BA535DB6BEFDB8D5DBF99FE0FF009DF4C63F9AE4C71E33648E9A % 7F55D2E867761B9ED9F49D63853BB9D8C8A013FD6755B968A0E1D031F16AA75F % 6B759E64FB9DFF0049193E5B9F3648EC1492492097FFD5F5549249252175465C % 19A171DED9D4077E77B7F95FF56B2197E4B6E353AD3894D0F1E8D75ED797B662 % E65CCDB635B56EFE6FD3F4ED62DB7B43DA5A6402224120EBE0E6C39AB2BA80B3 % 1EA631F63D9481FA7CA76E76CAC37F4AF73EBDBFA6DAC6ECBACFD1D7FCF7E93F % 997B67777F4639020831BBFC1B14F53ADD98EC176E7DD24B0B58E03601BF758E % 70D9FF0007BD8EFF0047FBEACE564371A875EFFA0C8DE7B35A486BAC77EED75B % 7F4967F2163538169F4FA8623ADB5EC8153B29C5E367D0F5D94511BDDE9BECF4 % BDCCFE73E82D5C7C877A7B0EEB6C61DAE716ECDC47EEB53C4254B84C0AE22906 % 454FAEBBEBB05955801ACD7EF0F0ED5AE6B99BB7336AA7D40D97B4B585D536A9 % 2E7176D0EFE4EC66EB1EADDEF2C754E86EA483B84BBE8B9D0CD5BFBAA961F56F % B56406331DCEC7B1FB29BC35DB5C035EFB2F2EDA6AF437B19456EF57D4B2CFF0 % 7E9FA6FB146601DB50A944CAC0F36A60D79877B8D8E73C18697CB8347FC1876D % 5A7EADE1BE98607088758490493FBAC60F77F9EC44BD8E6B41A9BE32D02499FE % DD6D6AA96E6D58A7D323ED196D689AEB074DDF47D5B0EF652D77F2FF00EB75A9 % 8C8486C3CBAB008CE32278BFB12E174F38F90FCAB6C375D635B5EE7B40735838 % ADAE6FE6EEF7BFFE11553D359665D7451FA3E9F4B8BDD8EC02BAA49F58C56D1F % A675B92EDF63FF0099F4FF0043E9FE96E49D5E5E639A2D787020C5357B6B0276 % D85EF796D96ECFE6FE87FD67F48B4B1B1ABC6ABD3AC47771F13F3DCA23103CFB % 766789BD3A2649249357292492494FFFD6F554924925290EEA59706EED0B0EE6 % 38685AE1F9CD3FF47F96CFD1BFF4688924A73FA937A836B73B1ACFA65A37113E % 9025AC7BEBAEB0DF53FD2FE9ACFF00C013E167E2DEC0DA6C6BAD76E06C6B086B % 9ECF6DBDBE96EFF07BD5F42BB1E9BD8596B0381F9107F79AF6FB98EFE53521D7 % B1457F22E4E7E46654FF00758DA5BCBDF638C081BBD9B5BB76FB7E9D8F546BEA % B936D95DD48BEE6BA41706BEBADC08D3D371FF00C8FBD6FB7A7630209DEF8FA3 % EA3DCF23FAAFB0B9FDFF0079577742C7B06CBEFC8BABEF5BAD2D0E3FBD61A7D2 % 7D9FBBB1EFF4BFE0D33835DD8C62FE56E659D4F305753ADB61ECD59435E1BBDC % DFA2EC87B9DEB3F1B77D3F47F4977FC5AD46306535DE9D64B490E36BC1ADAF71 % 078AA1B6BABAFD9FF1BFE9559C5C0C2C36918D4B6A9E481A9FEB3CFB9CAC27C6 % E3B15E23A51D50D18B5504B9A25EE0017F7DADFA15B7F72AAF77E8EB6A324924 % B94924924A524924929FFFD93842494D04210000000000790000000101000000 % 1800410064006F00620065002000500068006F0074006F00730068006F007000 % 200045006C0065006D0065006E007400730000001C00410064006F0062006500 % 2000500068006F0074006F00730068006F007000200045006C0065006D006500 % 6E0074007300200032002E003000000001003842494D042200000000012E4D4D % 002A000000080007011200030000000100010000011A00050000000100000062 % 011B0005000000010000006A012800030000000100020000013100020000001D % 0000007201320002000000140000008F8769000400000001000000A4000000D0 % 0000004800000001000000480000000141646F62652050686F746F73686F7020 % 456C656D656E747320322E3000323030363A31303A30392032323A30393A3238 % 00000003A001000300000001FFFF0000A00200040000000100000156A0030004 % 00000001000001830000000000000006010300030000000100060000011A0005 % 000000010000011E011B00050000000100000126012800030000000100020000 % 02010004000000010000012E0202000400000001000000000000000000000048 % 0000000100000048000000013842494D03FD0000000000070000000000000000 %EndPhotoshop %begin_xml_code /pdfmark where {pop true} {false} ifelse /currentdistillerparams where {pop currentdistillerparams /CoreDistVersion get 5000 ge } {false} ifelse and not {userdict /pdfmark /cleartomark load put} if [/NamespacePush pdfmark [/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark /MetadataString 5038 string def % exact length of metadata /TempString 100 string def /ConsumeMetadata { currentfile TempString readline pop pop currentfile MetadataString readstring pop pop } bind def ConsumeMetadata %begin_xml_packet: 5038 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: brave-gnu-world-logo.25.eps
+%%CreationDate: 09.10.2006 22:09 Uhr
+%%BoundingBox: 0 0 342 387
+%%HiResBoundingBox: 0 0 342 387
+%%SuppressDotGainCompensation
+%%EndComments
+%%BeginProlog
+%%EndProlog
+%%BeginSetup
+%%EndSetup
+%ImageData: 342 387 8 3 0 1 3 "beginimage"
+%BeginPhotoshop: 13952
+% 3842494D0425000000000010000000000000000000000000000000003842494D
+% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F
+% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050
+% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C
+% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63
+% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C
+% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65
+% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48
+% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72
+% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
+% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61
+% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579
+% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63
+% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269
+% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265
+% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D
+% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A
+% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D
+% 30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B
+% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909
+% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65
+% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F
+% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F
+% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E
+% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070
+% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A
+% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74
+% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465
+% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
+% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F
+% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E
+% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130
+% 2D30395432303A30333A33365A3C2F646174653E0A090909093C6B65793E636F
+% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F
+% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909
+% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B
+% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D
+% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579
+% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61
+% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C
+% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F
+% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579
+% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F
+% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74
+% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579
+% 3E0A090909093C646174653E323030362D31302D30395432303A30333A33365A
+% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74
+% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F
+% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E
+% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F
+% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
+% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
+% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A
+% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E
+% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D
+% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070
+% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909
+% 09093C646174653E323030362D31302D30395432303A30333A33365A3C2F6461
+% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572
+% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261
+% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E
+% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F
+% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
+% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
+% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B
+% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
+% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469
+% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E
+% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E
+% 0A090909093C646174653E323030362D31302D30395432303A30333A33365A3C
+% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465
+% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61
+% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70
+% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574
+% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E
+% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552
+% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61
+% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A
+% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E
+% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909
+% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374
+% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909
+% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C
+% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561
+% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C
+% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E
+% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E
+% 323030362D31302D30395432303A30333A33365A3C2F646174653E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461
+% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E
+% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09
+% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E
+% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F
+% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73
+% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C
+% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261
+% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C
+% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170
+% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909
+% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138
+% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09
+% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272
+% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
+% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63
+% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67
+% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B
+% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036
+% 2D31302D30395432303A30333A33365A3C2F646174653E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C
+% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765
+% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64
+% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065
+% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E
+% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070
+% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A
+% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69
+% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64
+% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50
+% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909
+% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C
+% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269
+% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C
+% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
+% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431
+% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
+% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C
+% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
+% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
+% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374
+% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170
+% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E
+% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C
+% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F
+% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E
+% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A
+% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265
+% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69
+% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65
+% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C
+% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
+% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432
+% 303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
+% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C
+% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
+% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
+% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963
+% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65
+% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61
+% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67
+% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909
+% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374
+% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E
+% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C
+% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C
+% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909
+% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63
+% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070
+% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64
+% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039
+% 5432303A30333A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E
+% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65
+% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909
+% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09
+% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E
+% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09
+% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372
+% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65
+% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465
+% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963
+% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170
+% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909
+% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
+% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74
+% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465
+% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A
+% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C
+% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09
+% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64
+% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273
+% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E
+% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909
+% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065
+% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
+% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963
+% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C
+% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74
+% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F
+% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74
+% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269
+% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64
+% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048
+% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048
+% 0000000002D802280001000000640000000100030303000000017FFF00010001
+% 0000000000000000000000006808001901900000000000200000000000000000
+% 0000000000000000000000000000000000003842494D03ED0000000000100048
+% 00000001000200480000000100023842494D042600000000000E000000000000
+% 000000003F8000003842494D040D0000000000040000001E3842494D04190000
+% 000000040000001E3842494D03F3000000000009000000000000000001003842
+% 494D040A00000000000100003842494D271000000000000A0001000000000000
+% 00023842494D03F5000000000048002F66660001006C66660006000000000001
+% 002F6666000100A1999A0006000000000001003200000001005A000000060000
+% 00000001003500000001002D000000060000000000013842494D03F800000000
+% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000
+% 00010000024000000240000000003842494D041E000000000004000000003842
+% 494D041A00000000036300000006000000000000000000000183000001560000
+% 001700620072006100760065002D0067006E0075002D0077006F0072006C0064
+% 002D006C006F0067006F002E0032003500000001000000000000000000000000
+% 0000000000000001000000000000000000000156000001830000000000000000
+% 0000000000000000010000000000000000000000000000000000000010000000
+% 010000000000006E756C6C0000000200000006626F756E64734F626A63000000
+% 01000000000000526374310000000400000000546F70206C6F6E670000000000
+% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300
+% 000000526768746C6F6E670000015600000006736C69636573566C4C73000000
+% 014F626A6300000001000000000005736C6963650000001200000007736C6963
+% 6549446C6F6E67000000000000000767726F757049446C6F6E67000000000000
+% 00066F726967696E656E756D0000000C45536C6963654F726967696E0000000D
+% 6175746F47656E6572617465640000000054797065656E756D0000000A45536C
+% 6963655479706500000000496D672000000006626F756E64734F626A63000000
+% 01000000000000526374310000000400000000546F70206C6F6E670000000000
+% 0000004C6566746C6F6E67000000000000000042746F6D6C6F6E670000018300
+% 000000526768746C6F6E67000001560000000375726C54455854000000010000
+% 000000006E756C6C54455854000000010000000000004D736765544558540000
+% 0001000000000006616C74546167544558540000000100000000000E63656C6C
+% 54657874497348544D4C626F6F6C010000000863656C6C546578745445585400
+% 000001000000000009686F727A416C69676E656E756D0000000F45536C696365
+% 486F727A416C69676E0000000764656661756C740000000976657274416C6967
+% 6E656E756D0000000F45536C69636556657274416C69676E0000000764656661
+% 756C740000000B6267436F6C6F7254797065656E756D0000001145536C696365
+% 4247436F6C6F7254797065000000004E6F6E6500000009746F704F7574736574
+% 6C6F6E67000000000000000A6C6566744F75747365746C6F6E67000000000000
+% 000C626F74746F6D4F75747365746C6F6E67000000000000000B72696768744F
+% 75747365746C6F6E6700000000003842494D041100000000000101003842494D
+% 0414000000000004000000013842494D040C0000000011340000000100000071
+% 00000080000001540000AA000000111800180001FFD8FFE000104A4649460001
+% 0201004800480000FFED000C41646F62655F434D0002FFEE000E41646F626500
+% 648000000001FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15
+% 18131315131318110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
+% 0C0C0C0C0C0C0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E
+% 14110C0C0C0C0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
+% 0C0C0C0C0C0C0C0C0C0C0C0CFFC00011080080007103012200021101031101FF
+% DD00040008FFC4013F0000010501010101010100000000000000030001020405
+% 060708090A0B0100010501010101010100000000000000010002030405060708
+% 090A0B1000010401030204020507060805030C33010002110304211231054151
+% 611322718132061491A1B14223241552C16233347282D14307259253F0E1F163
+% 733516A2B283264493546445C2A3743617D255E265F2B384C3D375E3F3462794
+% A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797
+% A7B7C7D7E7F71100020201020404030405060707060535010002110321311204
+% 4151617122130532819114A1B14223C152D1F0332462E1728292435315637334
+% F1250616A2B283072635C2D2449354A317644555367465E2F2B384C3D375E3F3
+% 4694A485B495C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767
+% 778797A7B7C7FFDA000C03010002110311003F00F5549249252952EA5D6303A6
+% B01C9B3F48E04D74B06EB1D1FBACFDCFCDF56CD94FEFD8A9F5AEB8EC4B1B8182
+% CF5BA85A040896B377D17387B7D4B1DB7D94FF00D72EF4AA50E93F57C54F766F
+% 513F69CDB4EE739E43849FECB5AE733E87B7F435FD0A2AAAA494969FAC06FD6A
+% C0CA73791ED64F9E82C72B9566DF63B6FD8EE66B05CF35868F3FE777BBFB0C56
+% 80F979240009294275911E09D2492535322DEA35585D5555E4526206E2C7B74F
+% 76ED2C6DBEEFDDF4FF00E2FF00C22A77F51EAFF46BC7C7A9C7F3ADB6C81F9DF4
+% 7D0ABF35BFBEB5D2494E5E066E7DAE8BDF8CFD09D94EEDC60EDFCF73BF3BF796
+% 931E1ED04692260F2151EA1D1E9CB3EAD4EFB3E50D45AD120FFC755F46DFFCF9
+% FCB553A7F53BC669E9FD440A731809601F42D1AFE998FF00F09BA3D9FF00A53D
+% 8929DB49327494A49249253FFFD0F55599D77ABFECDA18DA5A2CCCC825B8EC3A
+% 8111BEE7810E732ADECF637F9DB5F553FA3F53D5669AE4F12D6F53EB36752B3D
+% F57A831F10088D8D163FD4DDB7E8B696DD97F43E9E4D74FF00A2494E8740E91E
+% 8B1F999536655F2E7BDC649DC439DBB46B7DDB7F37FF003C7A55ADBF34CC6ED6
+% 86F8052494A49258791F59EB7DBF67E9349EA16FFA469DB5027DA3F4B0EF57FA
+% D5B7D1FF0086494EE24B370733A8D8FDB96CA5A4CC8ADD3B6086EDE5DB9FB9DF
+% C853EA3D6FA7F4EDADBDE4DCF12CA2B05D6113B6767E637F9566C494DF4967E2
+% F59AB206EFB3DF5375F73DA3B6A67D373DCAF32C658DDCC70703DC24A64B3BAD
+% F4A6F52C4DAC8665D277E2DA646D7FEEB8B7FC15BFCDDBFF006E7F395D6B4524
+% 94E3F42EA8FCEA032F9664D07D3B6B321DB99ED79B3E97FEAE5B0B987B8627D6
+% 6CCF4CED65B48B1FB7B13E9B777F9C3D477F5D74CD208D381A7DDA24A5D24924
+% 94FF00FFD1F547025A434C3A343E6B95FAAAE68C4A75DA7DF519D00B1E2835EF
+% 67B7E936A733DDF9F52EAD60E574BC9C0CBBB3701A6EC6CA9765E20FA41C4973
+% EDA3F7F7B8EED9F4FD4FE6FE9FE8D29DB37541BBDCE01BC1713027E2A166661D
+% 4D2FB6FAEB6375739CF6803E24959B5E4D790C635AE9DA76D8DB25C5A63F384B
+% 1CFB2BDAA4DE89D2FD3F57228640F77BF489ECFF00A2D494E65D9197F59AF763
+% 636EA3A55662C79106D3CFBDA47B5BFB98EFFF00D0BFFB8AB6B1FA562E352296
+% B4069FCD048DC63DDB8B8EF7EEFCFF007FFE05FA34B1EE6399E874F6B1B4D6ED
+% 81EC1EC6E81EE867B3F7FF007D068E9F6FDAB7643DD786C1208105C3875BEEF7
+% 7FC055FA5F47F9CFE752009DBF15A6755E2DD6D0DADB0D6C37521ADD00D1C36B
+% 581BB550B6BC1392F71654ECD11BC020DAD6E9B7D92EB7DCDFDDF52C7AD0B1AD
+% 9DE40DEE01AEE4CB44BB6FE6AAB8A5D91634E562D7518B1ECF7377B06E6ED63D
+% A3DDEA58D77AB76DFD1D7FCDFBD2063746FE8A24F4AFF0BD281D958ED690F2EA
+% F7E9B4CC03EDFD1EDFF02E74B37D5F4FDFFA556A9C864876E0D6C7B23BE9FB8D
+% FA5FF93FF068EDA61CE6C35CC70F708E67F7964BB1FD5C9B7EC47EC81AFF004D
+% A1DB832C786C96FA2F1ED6FF0053FEDBB13B849BAD695C7FBDE9E8EC5993454D
+% 9BAC6543C5CE0047C5D0B3737EB3F4BC7696D160CCC8FCCA68F749FE5DAD9AEB
+% FF00ABFDCAEC556DC9739FF63EA558AED322B9FE69F103D967B7F44DF67A9EE6
+% 7FD6958C7C66B59EC6358ED443181A07F298FF00D35D637DDFA3F4DBFF006D26
+% AE73B031B2ADCD7E56701F6ACA2CB1F5813B6B043AA6ECFCDF5ACA29AAADDF4F
+% 1E9CABAEFF0008BA7ADBB5B1E249FBC9720518B5B786901C4971792E738E8DDC
+% F73FDDEEDBB7FE2995D7FCD2B49294924924A7FFD2F55492492520BB131AD70B
+% 2CAC1B1BC5834788F0B1BB5EAB64E48345C08FB5381DAFC6ADA1E040DCEA4EEF
+% DE6BBDCFB91731D9EF70A30C32ADD05F91619869277368A5BEEB2EF6FF0085F4
+% AAFD27F86F7D4876E217EFB3A85E3ECC047A0D3B6B826375EF9DF91EDF66C7FE
+% 87FE0AD40D9D00DFAA083DE97C66E558FAEDC9BAB68FA5563E39961046DF7DAF
+% DAFC86B5AEF66DAA867F215AB9C5AD0448931204F6EEA149AC173995892434B9
+% A002E81B771FCD4AE739DB1F503635AE2486380D60B750EDAD7FF9E8C850D100
+% 820EBDDCCBD96BAC739D7FA75D624B18DFFA565B61FF00A0C594EEB1496EFA1B
+% 6B9F4BA77BB6B5AE274DB66DDCEDBFC9DAB6ADE9F8F98D7D598CB5C09DE2A712
+% CD3F976D2FD963777F2D3E1BF16B2DAF02B365434229D82961F377B773FF007F
+% 6FA8A200750C03181F30D7C3F97A9CEFB45D9353AABDE0525A1F153C8D9DB67E
+% 8EB2E66DFA75D9BFF46B55D9CEAF2EBA2DA5EFA5EC97646D90D33B5A5E59F98F
+% 9FFAC7FC56FF0042A757EA34E2B4D2D6B6DC8B012E635DED6B4FB77E44FD062A
+% 755DD66DC57D8D76350C8F4BD67B9CD718FCEADCF6BAB73754E8896E02E88978
+% 70F8BB39189899B43314B89A5B04110E0E05AEDA196582CF7B7F9CDECFD325D2
+% 31DD46132AB2CF55ED2438F8104FE8F977F37F450BA6613DB41BAFBBD7C8BD8C
+% 6DEE6BB4696496D34D94FA7FA3A9F659EFDBEA588F45D915BC372FD30EB6368A
+% C1FA41BFA5DEE27DDF454B44824EFD596EA8550D9B8924926AE524924929FFD3
+% F554C74D53A8BDA1ED2D3C1E47924A44CB1FF69B1AF2D02016346A4B40D6C7FB
+% 7DBB9FEC6FFC5A0BB3706CCC6E31BEB75C06E65421CE691FE11DF4B67F21567E
+% 0DD915BDF97A5971F731A4B9AD00FE8AA6CFEEB7F9DFF4967A8957F64E9EE656
+% DDAD2E92F7C06807F96EFDE530803B1B95550FE2D696522C513ADBA2DC7A8012
+% DDC7C5DA93F1944F6B60683B008745ECB9BB9A6478F8A8B1EF0FF4DD5B84925D
+% 669B493FD53BFF00CE6A866640D166870571446FD833B68A6D20D8D0E2D9027C
+% 0FD26FF55CA9D580FC2A5CDC67B4971DCEB2FDC63C5DB1AE6D7F47F36BF415C6
+% 58C2D1E9CB9BC0238FF3BF393DAF656C2EB012D04030D2EE4EDFA2D0EFFCC134
+% 709D579DABBBCE3F0F2B3DD7065FEB536C7AD94DFD1B1DE9977A7563D156F73E
+% A6EFFD25B65D67A9FF0017B158FB0E261DB4D977A7EA39BB2AF6973811FE8F76
+% E72D2A3AB74FBC5A59688A1CE6DA4F0DDBF9CE7FF36D67F2B77FE09BD1DD451B
+% 8DA58DDF1F4C8D614D0C911A01A3164C529697FF0072D2C3ADF4836DAF739D61
+% 009768E33A37467B559C8B1B5D4D6BD9BD847B817098FA3A6FFA7F4BF7D1DA1A
+% 00DBC762B23AC6506D4D0F6C5AED6AD636C3873FBDBFD9FA2FF0B67E8D899932
+% 13B685118184753C44BAB8F732FA596B0CB5C3BE864687FE9222CCFABC727F67
+% 4640877A961699E5AE77A9C7E66C73FD2DBFF06B4D0F3661B6AA49249253FFD4
+% F5550B63D27CC81B4EA2678EDB21FF00E6A9A6735AE696B84B5C2083C1052521
+% 756DB7D37133B007026473DF669EE5917B76BDF6BEB796D7616D4C716D758FE5
+% 0FCEB372D2B32DEC6D0D6D42CB6DD1E1AE68637696B6EF7D858E77A5BBF32BFC
+% C51FD9D5BB25F9169F56C71258481B5A3B358DFDEDBF9EA6C79044907A7460CB
+% 8CCA363525AACCBCD758DAEB6358D03DDB89E4FEEED5A34D8F6B0BAF78D3BC6D
+% 1F892A4DA76C00040F1D4A1370DDB8BAD7FAAE719F701007EEB1A94A5097411F
+% CD8F1C32C28EFE1D190BECB2C0DA9AD2CFCE7870D3FAAD83B9584014EC3B8B8B
+% 8766E908A663DC62398D1472AD299E065AF10D5AD7D599BB6D26B7D446A2E930
+% 7F77D9FCE31DFCBFA1FF000BBFF461AB1B230B1B2AE786E55AE3BEBC7AC7A758
+% DAD8AE9AD8E758DDCE7FB9F77E7FFDB6AF36D63EB0FACEF69E0B759F8154F32E
+% C8C70F758F636A26597381DACFE45CDDDF4BFD1DDFF5BFD17E8FD5611C3A81AA
+% FB02CD5F7F1497DD15C5A62752C64C9FE40DB0EFF5FA0B16D75965B664871391
+% EB86D0D0FDD5D15967A5F687532DFD2BB75DE9FF00C27E8FFD221E5E5B9DF67B
+% CD576CB5F1481A3AD77954E76F6334FF00468DD3F14D4CB2ECD0319D63CD950B
+% 1BC47E84DB65BA535DB6BEFDB8D5DBF99FE0FF009DF4C63F9AE4C71E33648E9A
+% 7F55D2E867761B9ED9F49D63853BB9D8C8A013FD6755B968A0E1D031F16AA75F
+% 6B759E64FB9DFF0049193E5B9F3648EC1492492097FFD5F5549249252175465C
+% 19A171DED9D4077E77B7F95FF56B2197E4B6E353AD3894D0F1E8D75ED797B662
+% E65CCDB635B56EFE6FD3F4ED62DB7B43DA5A6402224120EBE0E6C39AB2BA80B3
+% 1EA631F63D9481FA7CA76E76CAC37F4AF73EBDBFA6DAC6ECBACFD1D7FCF7E93F
+% 997B67777F4639020831BBFC1B14F53ADD98EC176E7DD24B0B58E03601BF758E
+% 70D9FF0007BD8EFF0047FBEACE564371A875EFFA0C8DE7B35A486BAC77EED75B
+% 7F4967F2163538169F4FA8623ADB5EC8153B29C5E367D0F5D94511BDDE9BECF4
+% BDCCFE73E82D5C7C877A7B0EEB6C61DAE716ECDC47EEB53C4254B84C0AE22906
+% 454FAEBBEBB05955801ACD7EF0F0ED5AE6B99BB7336AA7D40D97B4B585D536A9
+% 2E7176D0EFE4EC66EB1EADDEF2C754E86EA483B84BBE8B9D0CD5BFBAA961F56F
+% B56406331DCEC7B1FB29BC35DB5C035EFB2F2EDA6AF437B19456EF57D4B2CFF0
+% 7E9FA6FB146601DB50A944CAC0F36A60D79877B8D8E73C18697CB8347FC1876D
+% 5A7EADE1BE98607088758490493FBAC60F77F9EC44BD8E6B41A9BE32D02499FE
+% DD6D6AA96E6D58A7D323ED196D689AEB074DDF47D5B0EF652D77F2FF00EB75A9
+% 8C8486C3CBAB008CE32278BFB12E174F38F90FCAB6C375D635B5EE7B40735838
+% ADAE6FE6EEF7BFFE11553D359665D7451FA3E9F4B8BDD8EC02BAA49F58C56D1F
+% A675B92EDF63FF0099F4FF0043E9FE96E49D5E5E639A2D787020C5357B6B0276
+% D85EF796D96ECFE6FE87FD67F48B4B1B1ABC6ABD3AC47771F13F3DCA23103CFB
+% 766789BD3A2649249357292492494FFFD6F554924925290EEA59706EED0B0EE6
+% 38685AE1F9CD3FF47F96CFD1BFF4688924A73FA937A836B73B1ACFA65A37113E
+% 9025AC7BEBAEB0DF53FD2FE9ACFF00C013E167E2DEC0DA6C6BAD76E06C6B086B
+% 9ECF6DBDBE96EFF07BD5F42BB1E9BD8596B0381F9107F79AF6FB98EFE53521D7
+% B1457F22E4E7E46654FF00758DA5BCBDF638C081BBD9B5BB76FB7E9D8F546BEA
+% B936D95DD48BEE6BA41706BEBADC08D3D371FF00C8FBD6FB7A7630209DEF8FA3
+% EA3DCF23FAAFB0B9FDFF0079577742C7B06CBEFC8BABEF5BAD2D0E3FBD61A7D2
+% 7D9FBBB1EFF4BFE0D33835DD8C62FE56E659D4F305753ADB61ECD59435E1BBDC
+% DFA2EC87B9DEB3F1B77D3F47F4977FC5AD46306535DE9D64B490E36BC1ADAF71
+% 078AA1B6BABAFD9FF1BFE9559C5C0C2C36918D4B6A9E481A9FEB3CFB9CAC27C6
+% E3B15E23A51D50D18B5504B9A25EE0017F7DADFA15B7F72AAF77E8EB6A324924
+% B94924924A524924929FFFD93842494D04210000000000790000000101000000
+% 1800410064006F00620065002000500068006F0074006F00730068006F007000
+% 200045006C0065006D0065006E007400730000001C00410064006F0062006500
+% 2000500068006F0074006F00730068006F007000200045006C0065006D006500
+% 6E0074007300200032002E003000000001003842494D042200000000012E4D4D
+% 002A000000080007011200030000000100010000011A00050000000100000062
+% 011B0005000000010000006A012800030000000100020000013100020000001D
+% 0000007201320002000000140000008F8769000400000001000000A4000000D0
+% 0000004800000001000000480000000141646F62652050686F746F73686F7020
+% 456C656D656E747320322E3000323030363A31303A30392032323A30393A3238
+% 00000003A001000300000001FFFF0000A00200040000000100000156A0030004
+% 00000001000001830000000000000006010300030000000100060000011A0005
+% 000000010000011E011B00050000000100000126012800030000000100020000
+% 02010004000000010000012E0202000400000001000000000000000000000048
+% 0000000100000048000000013842494D03FD0000000000070000000000000000
+%EndPhotoshop
+%begin_xml_code
+/pdfmark where {pop true} {false} ifelse
+/currentdistillerparams where {pop currentdistillerparams
+/CoreDistVersion get 5000 ge } {false} ifelse
+and not {userdict /pdfmark /cleartomark load put} if
+[/NamespacePush pdfmark
+[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark
+/MetadataString 5038 string def % exact length of metadata
+/TempString 100 string def
+/ConsumeMetadata {
+currentfile TempString readline pop pop
+currentfile MetadataString readstring pop pop
+} bind def
+ConsumeMetadata
+%begin_xml_packet: 5038
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<?adobe-xap-filters esc="CR"?>
<x:xapmeta xmlns:x='adobe:ns:meta/' x:xaptk='XMP toolkit 2.8.2-33, framework 1.5'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
@@ -61,7 +526,77 @@
-<?xpacket end='w'?> %end_xml_packet [{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark [{photoshop_metadata_stream} MetadataString /PUT pdfmark [/_objdef {nextImage} /NI pdfmark %end_xml_code gsave % EPS gsave /hascolor /deviceinfo where {pop deviceinfo /Colors known {deviceinfo /Colors get exec 1 gt} {false} ifelse} {/statusdict where {pop statusdict /processcolors known {statusdict /processcolors get exec 1 gt} {false} ifelse} {false} ifelse} ifelse def 40 dict begin /_image systemdict /image get def /_setgray systemdict /setgray get def /_currentgray systemdict /currentgray get def /_settransfer systemdict /settransfer get def /_currenttransfer systemdict /currenttransfer get def /blank 0 _currenttransfer exec 1 _currenttransfer exec eq def /negative blank {0 _currenttransfer exec 0.5 lt} {0 _currenttransfer exec 1 _currenttransfer exec gt} ifelse def /inverted? negative def /level2 systemdict /languagelevel known {languagelevel 2 ge} {false} ifelse def /level3 systemdict /languagelevel known {languagelevel 3 ge} {false} ifelse def level2 {/band 0 def} {/band 5 def} ifelse gsave % Image Header gsave /rows 387 def /cols 342 def 342 387 scale level2 { /DeviceRGB setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if /beginimage level2 {/image load def} {{pop .9 setgray 0 0 moveto 0 1 lineto 1 1 lineto 1 0 lineto fill 0 setgray 0 1 translate 1 cols div 1 rows div scale /ratio {cols 400 div mul} def /Helvetica findfont 15 ratio scalefont setfont 5 ratio -20 ratio moveto (Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show /x 128 string def {currentfile x readline {} {pop exit} ifelse (~>) search {pop pop pop exit} {pop} ifelse } loop } def} ifelse 12 dict begin /ImageType 1 def /Width cols def /Height rows def /ImageMatrix [cols 0 0 rows neg 0 rows] def /BitsPerComponent 8 def /Decode [0 1 0 1 0 1] def /DataSource currentfile /ASCII85Decode filter /DCTDecode filter def currentdict end %%BeginBinary: 12801 beginimage s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt
+<?xpacket end='w'?>
+%end_xml_packet
+[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark
+[{photoshop_metadata_stream} MetadataString /PUT pdfmark
+[/_objdef {nextImage} /NI pdfmark
+%end_xml_code
+gsave % EPS gsave
+/hascolor
+/deviceinfo where
+{pop deviceinfo /Colors known
+{deviceinfo /Colors get exec 1 gt}
+{false} ifelse}
+{/statusdict where
+{pop statusdict /processcolors known
+{statusdict /processcolors get exec 1 gt}
+{false} ifelse}
+{false} ifelse}
+ifelse
+def
+40 dict begin
+/_image systemdict /image get def
+/_setgray systemdict /setgray get def
+/_currentgray systemdict /currentgray get def
+/_settransfer systemdict /settransfer get def
+/_currenttransfer systemdict /currenttransfer get def
+/blank 0 _currenttransfer exec
+1 _currenttransfer exec eq def
+/negative blank
+{0 _currenttransfer exec 0.5 lt}
+{0 _currenttransfer exec 1 _currenttransfer exec gt}
+ifelse def
+/inverted? negative def
+/level2 systemdict /languagelevel known
+{languagelevel 2 ge} {false} ifelse def
+/level3 systemdict /languagelevel known
+{languagelevel 3 ge} {false} ifelse def
+level2 {/band 0 def} {/band 5 def} ifelse
+gsave % Image Header gsave
+/rows 387 def
+/cols 342 def
+342 387 scale
+level2 {
+/DeviceRGB
+setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if
+/beginimage level2
+{/image load def}
+{{pop .9 setgray 0 0 moveto 0 1 lineto
+1 1 lineto 1 0 lineto fill 0 setgray
+0 1 translate 1 cols div 1 rows div scale
+/ratio {cols 400 div mul} def
+/Helvetica findfont 15 ratio scalefont setfont
+5 ratio -20 ratio moveto
+(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show
+/x 128 string def
+{currentfile x readline {} {pop exit} ifelse
+(~>) search {pop pop pop exit} {pop} ifelse
+} loop } def}
+ifelse
+12 dict begin
+/ImageType 1 def
+/Width cols def
+/Height rows def
+/ImageMatrix [cols 0 0 rows neg 0 rows] def
+/BitsPerComponent 8 def
+/Decode [0 1 0 1 0 1] def
+/DataSource currentfile /ASCII85Decode filter
+/DCTDecode filter def
+currentdict end
+%%BeginBinary: 12801
+beginimage
+s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt
'+km!,8q:3)C$FB(Ddl(+qY4l$k*OQ&I]'V$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
$iq%U',DH$)]';0'FkT_'GM#e%Ls0b$k*OQ$kX'[$k*OQ$kWmV$k*OQ$k*OQ$k*OQ
$k*OQ$k*OQ$k*OQ$k30O!"fJ;K)o!T!?qLF&HMtG!WUsU"995;_uW(&!!*6(!<E3%
@@ -254,4 +789,9 @@ P"?rK,a(_k8L0HsP"?p`Uln:q.3t'J8kC:k;NaTsPekl!n"d`jmi)3+S>%b'+%/FF
(5C.cK]sbFP`eT`V'M3q.7keJ8lA5+P*D,$,c)cL8L[4VP"JVD,a+CT8L156fBs8X
*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVqb0V
*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVqb0V
-*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@Cs4I~> %%EndBinary grestore end % Image Trailer grestore grestore % EPS grestore [{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark [/NamespacePop pdfmark \ No newline at end of file
+*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@Cs4I~>
+%%EndBinary
+grestore end % Image Trailer grestore
+grestore % EPS grestore
+[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark
+[/NamespacePop pdfmark
diff --git a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps
index 1c5f93cff22..680ee260892 100644
--- a/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps
+++ b/Master/texmf-dist/doc/generic/pgf/images/brave-gnu-world-logo.eps
@@ -1,4 +1,541 @@
-%!PS-Adobe-3.0 EPSF-3.0 %%Title: brave-gnu-world-logo.eps %%CreationDate: 09.10.2006 22:10 Uhr %%BoundingBox: 0 0 342 387 %%HiResBoundingBox: 0 0 342 387 %%SuppressDotGainCompensation %%EndComments %%BeginProlog %%EndProlog %%BeginSetup %%EndSetup %ImageData: 342 387 8 3 0 1 3 "beginimage" %BeginPhotoshop: 16252 % 3842494D0425000000000010000000000000000000000000000000003842494D % 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F % 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050 % 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C % 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63 % 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C % 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65 % 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48 % 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72 % 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 % 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61 % 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579 % 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63 % 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269 % 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265 % 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D % 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A % 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D % 30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B % 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909 % 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65 % 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F % 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F % 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E % 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070 % 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A % 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74 % 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465 % 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 % 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F % 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E % 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130 % 2D30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F % 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F % 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909 % 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B % 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D % 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579 % 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61 % 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C % 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F % 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579 % 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F % 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74 % 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579 % 3E0A090909093C646174653E323030362D31302D30395432303A31303A30355A % 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74 % 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F % 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E % 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F % 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 % 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 % 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A % 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D % 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E % 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D % 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070 % 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909 % 09093C646174653E323030362D31302D30395432303A31303A30355A3C2F6461 % 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572 % 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261 % 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E % 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F % 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072 % 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963 % 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909 % 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B % 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B % 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469 % 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E % 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E % 0A090909093C646174653E323030362D31302D30395432303A31303A30355A3C % 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E % 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465 % 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61 % 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70 % 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574 % 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E % 7072696E742E50616765466F726D61742E504D41646A75737465645061676552 % 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61 % 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A % 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E % 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909 % 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D % 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374 % 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909 % 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C % 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561 % 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C % 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E % 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269 % 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374 % 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E % 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E % 323030362D31302D30395432303A31303A30355A3C2F646174653E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461 % 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E % 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09 % 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E % 50616765466F726D61742E504D41646A75737465645061706572526563743C2F % 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E % 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73 % 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C % 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261 % 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C % 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170 % 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909 % 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138 % 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09 % 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272 % 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469 % 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63 % 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67 % 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B % 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036 % 2D31302D30395432303A31303A30355A3C2F646174653E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C % 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765 % 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64 % 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065 % 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E % 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070 % 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A % 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69 % 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64 % 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50 % 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909 % 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C % 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269 % 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C % 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 % 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431 % 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E % 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C % 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C % 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D % 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374 % 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170 % 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E % 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C % 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E % 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F % 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E % 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A % 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265 % 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69 % 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65 % 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C % 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461 % 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432 % 303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E6170 % 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E % 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C % 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C % 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D % 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963 % 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65 % 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61 % 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67 % 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909 % 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74 % 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374 % 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E % 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C % 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C % 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909 % 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63 % 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070 % 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64 % 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039 % 5432303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E % 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65 % 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909 % 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09 % 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E % 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09 % 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372 % 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65 % 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909 % 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465 % 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963 % 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170 % 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909 % 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E % 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B % 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74 % 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465 % 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A % 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C % 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09 % 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64 % 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65 % 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273 % 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E % 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574 % 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909 % 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065 % 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74 % 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963 % 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E % 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C % 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74 % 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F % 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74 % 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269 % 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64 % 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048 % 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048 % 0000000002D802280001000000640000000100030303000000017FFF00010001 % 0000000000000000000000006808001901900000000000200000000000000000 % 0000000000000000000000000000000000003842494D03ED0000000000100048 % 00000001000200480000000100023842494D042600000000000E000000000000 % 000000003F8000003842494D040D0000000000040000001E3842494D04190000 % 000000040000001E3842494D03F3000000000009000000000000000001003842 % 494D040A00000000000100003842494D271000000000000A0001000000000000 % 00023842494D03F5000000000048002F66660001006C66660006000000000001 % 002F6666000100A1999A0006000000000001003200000001005A000000060000 % 00000001003500000001002D000000060000000000013842494D03F800000000 % 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000 % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF % FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF % FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000 % 00010000024000000240000000003842494D041E000000000004000000003842 % 494D041A00000000035D00000006000000000000000000000183000001560000 % 001400620072006100760065002D0067006E0075002D0077006F0072006C0064 % 002D006C006F0067006F00000001000000000000000000000000000000000000 % 0001000000000000000000000156000001830000000000000000000000000000 % 0000010000000000000000000000000000000000000010000000010000000000 % 006E756C6C0000000200000006626F756E64734F626A63000000010000000000 % 00526374310000000400000000546F70206C6F6E6700000000000000004C6566 % 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768 % 746C6F6E670000015600000006736C69636573566C4C73000000014F626A6300 % 000001000000000005736C6963650000001200000007736C69636549446C6F6E % 67000000000000000767726F757049446C6F6E6700000000000000066F726967 % 696E656E756D0000000C45536C6963654F726967696E0000000D6175746F4765 % 6E6572617465640000000054797065656E756D0000000A45536C696365547970 % 6500000000496D672000000006626F756E64734F626A63000000010000000000 % 00526374310000000400000000546F70206C6F6E6700000000000000004C6566 % 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768 % 746C6F6E67000001560000000375726C54455854000000010000000000006E75 % 6C6C54455854000000010000000000004D736765544558540000000100000000 % 0006616C74546167544558540000000100000000000E63656C6C546578744973 % 48544D4C626F6F6C010000000863656C6C546578745445585400000001000000 % 000009686F727A416C69676E656E756D0000000F45536C696365486F727A416C % 69676E0000000764656661756C740000000976657274416C69676E656E756D00 % 00000F45536C69636556657274416C69676E0000000764656661756C74000000 % 0B6267436F6C6F7254797065656E756D0000001145536C6963654247436F6C6F % 7254797065000000004E6F6E6500000009746F704F75747365746C6F6E670000 % 00000000000A6C6566744F75747365746C6F6E67000000000000000C626F7474 % 6F6D4F75747365746C6F6E67000000000000000B72696768744F75747365746C % 6F6E6700000000003842494D041100000000000101003842494D041400000000 % 0004000000013842494D040C000000001A350000000100000071000000800000 % 01540000AA0000001A1900180001FFD8FFE000104A4649460001020100480048 % 0000FFED000C41646F62655F434D0002FFEE000E41646F626500648000000001 % FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15181313151313 % 18110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C % 0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E14110C0C0C0C % 0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C % 0C0C0C0C0C0CFFC00011080080007103012200021101031101FFDD00040008FF % C4013F0000010501010101010100000000000000030001020405060708090A0B % 0100010501010101010100000000000000010002030405060708090A0B100001 % 0401030204020507060805030C33010002110304211231054151611322718132 % 061491A1B14223241552C16233347282D14307259253F0E1F163733516A2B283 % 264493546445C2A3743617D255E265F2B384C3D375E3F3462794A485B495C4D4 % E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797A7B7C7D7E7F7 % 1100020201020404030405060707060535010002110321311204415161712213 % 0532819114A1B14223C152D1F0332462E1728292435315637334F1250616A2B2 % 83072635C2D2449354A317644555367465E2F2B384C3D375E3F34694A485B495 % C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767778797A7B7C7 % FFDA000C03010002110311003F00F5549249252962FD63FADFD0BEADD3BFA95F % FA67006BC4AA1D7BC1DC039B4EE6EDAFF46FFD35BE9D3FF09BD61FD7EFAFE3A1 % 8FD91D22323AEDE000000E18E1C3DB658DFA2FC87B7DD451FF00A1191FA2F4AA % C9E1FA4FD5DCEEA998EEA7D58BFA8751CC74D3597026D70038716BABAF1F1D8D % DB65FF00CC52CF469AB67A94D8929EA2CFF1C4CB2D8E9FD132322AEEEB2C6D6E % E63F9BAD993F9BFF0008B5A9FF0018D45AD31D1F3C585E6BA9B1400F7EA1B5D7 % BF258EB2C76DFA14D76A9F4FFA834B58D7E7E4D8D773F66C6706D4D91F47D6B2 % BFB4DCE6EEFE77F56FFC2F5ADDE9BD07A474B71B30B19B5DCE043AF717597104 % 8739AFCABDD6E4399B9BBB67AA9292F4DBFA86452EB73B1460B8B88AA8F505AF % 0C1F45F7BEAFD0B2C7FF00A1A5F7FA7FF721FF00E0ADA4924A79BEBBD47EB974 % 9B1F7E06053D6B05DAB59597539356AEDCCB1937332D9B7D3F4ACC7632DFF494 % 7F855CB752FF0019FF005971C7A7FB2A8E9F748939A320340D665B65185FF07F % E13FF3E2F4D49253E59D37FC66FD64B323D4C9AF03269827ECF8FEA31CE8F67E % 8B21CFC8D9EFFF004B4FFDB5FCF57E83D13AFF004EEB743ADC37383EBDBEB63D % A36DB5EE1B99BD9AEE63FF00C1DF53ACC7BBFC0DB62C4FAD5FE2EFA4F5B6D995 % 84D6F4EEABF49B91588AEC7025F199437D96FA9BDDFA7FE91FF1BE9FA2BCFABB % FAD740EBC303A89FB1754C40E38990C135DA1FFE1F7B87EB38D76CF753FF005B % FD0E4D1FA24A7DB9258DF56FEB0B3ACE31173063E75207AF44CB48FCDC9C677F % 84C5B7F33FD1FF00336FE916CA4A524924929FFFD0F555CC7D7DFAE15FD58E96 % 3D269B3A96687D7835812039BB77DF618DBB28F52BFD1FF86B3F47F43D5B6AE9 % D782F56EA87EB37D6BCAEAAE71B315961A30441814D42CB3D50DB7DCDD98F5DB % 97657B7FA45DFE0D2527FAADD06CCA7D9D433C3F2AFB9C2581FF00A5BEEB9DBD % 98E2CB377BED7B7D5CABBFC151FA7C8B3D15EBDD07A1D7D2F1F7DA18FCFB9A06 % 4DCC076C0FA18F8FBE5D5E263FD0A6BFFAF59FA7B6D58DF527A355481956FBED % A2B635B31FA3B2D636FBDBB3DCE6DCDAACAFF49F4FF58BAA5D724A52499CE6B1 % A5CE21AD689738E8001DCAE03AFF00F8DAC1C6C87E07D5FC63D57246E67AF3B6 % 86BFE830B3682FCA67A9FB9E8D567F81C9494FA024BCBFA6FF008CDFAD0EC963 % 73B0F06DAF5DF4D0E7D76684336B2CB2DC9ABD5F51DF42C6319FF0D5AE9FA87F % 8CAFAAB81D3E9CCB6EB1F66434BABC163272416BBD1B59754E2C663BAAB37FF3 % F6D7EAFA567D9FD6494F5292E1F0FF00C6C746C8B62DC0CDA292EDA2ED8D7800 % 7D27DB5D563AE6EC6EDDDE9577AEB7A6756E9BD5F1465F4DC8665504ED2F61E1 % D01DE9D8C3EFAACDAE6FE8EC6FA8929B6B9FFAEDF5529FACFD1DD8A36579F4FE % 930725E0FB1FA6E61733DEDAB21ADF4EDFFADDFE958FA2B5D024929F11FAB3D7 % 3A85393582F38BD4F049AB6580B75691F68C7CE66D7BFECB7ECD96B367AACCA6 % 7E8EAFB4D78FE9FB2F4ECFA3A8E15799402D65920B1D1B98F6935DD4D9B4B9BE % A536B1F559B5CBC5FEB8B2AE9FFE303AA8A229AEC6B2D796E9B5D6B28B6DB7FE % DE7BAE7AEFBEA266165F6E00115DB59B76811B2DC77370AFF5777B9D6DF5FD99 % DFF07E8BFF00B694F66924924A7FFFD1F50CA6DCFC5B9943B6DCEADC2B7710E2 % 0EC77F9CBE7BFAB4E0031BB8377BECA4171F687DA296D46C0DF76C7EC77FDB5F % CB5F44AF2FFAEFF50F37133EFEBBD0697E5D19AE2EEA3D3DB2FB03DC4BDD918C % DFA56B2C7B9DBAAFE728B1FF00A1FD0FF454A75FEABFD6CE958551C5CFB7ECF5 % 585A5B976FB6BF576B6ABB1EFB3E856FFD17A8CB5DB29FF03FA3B29FD274EFFA % CBF5718DDCFEAB86D6F89C8A80FF00AB5E29565B32D95ED7EE021B66FF007169 % 8D1CF6EEAFD4B58DFF00AEBFFAEAE51F567A78A1D939748A98D87B59639AC3EF % FE65B90E26AAE86BBE97BFFF0003FCF4A6F7D6CFAD79DF5D731DD27A3EFABA15 % 0EFD259043B21CD3B9AFB07E653B87EAD8EFFF008EBFF58FB3E3D15B1BEAF328 % A994359B8D861B5D675B0804BFE916D96FE6FAAC67E67E8BFC27A0AE74EB72F2 % 5870FEAFE28BE9A5C2B665D601C7A3633D4B6DB03D94D3EADAEB376FBEFF00A1 % BFF43916FF00379FD33A66664752756E75BD42C69DAEAEB0C7EE206DDD6DB697 % 6DDBFF0069BF4791F63FE91FA0BD3A1094FE51F5DB4592CB18EA5B67A664E3D2 % 2CFB3D8CA7710D2D6398C0EDAF6B296B3D3AD9EAEBFB9EA7F3BF43F3F3727168 % 19363AD65673C1FD333783732086ED756E2EB9F6FF00C5FDA2F7B3FE1175DD4D % B57D9CBF368C367516FA78ADC2A326FBC8C6AEC7E4E463F517D77D1535FEA3BF % 43BFF9CBFF0056FD27ABE9ACCE9F89899F636ACAE9F878990197598CCFB5B28B % 2B25D35E2E6E1DF75F915DBB3D4C87BEBC6FF47EAD767E92C481C7C5C249F31C % 3308E324D47865A5D7CAE05D7D74EFAAF0FA5EE716163DA46D734B37D3B086FA % 16FD0F568FE77DFF00A657BA5F54C8C1CCAF370EFF00B2DAD86B5ED1B9AF6C7F % 35918ECFE9547FC67E9B7FF45FB3FD35B35F41EAB876BF763B6DC4B6B873F633 % 63B74FF3B4B5D7D9F67D5ED6E5595FBFFE2972AFC5AF2736EFD9CE6E157EA0AA % 9DC1EDAED786FB9BE859BBD2FA5F9BFF006CFEE38E23FA244BF050C9FBC0C5F5 % 7E8DF5F3A4655219D5AEA7A5E6B44B9B6D81B4BC69FA5C5C9B7D3ADFBB77F30E % FD62AFF8BFD3595BAD7F8D3FAA9D36A78C6C8FDA59634AE8C604B4B88259BB28 % B7D06D7BBD8FF4DD75ACFF004162F2BBED78B0E1753A832CD4327F9A7C7B5BB2 % C1FE05AE6FBF6BFF00EDB46C6C460692D0CADDA83B581B13F9D5B9A2FC8B9BFB % 9E933E87F39E8A8D911B9DD47AC754BFAAF5100E6E7BD8E3535BA064B7ECF486 % 39DFE15F551450CDFF00D169CBB6FF00E6BD45E93F526870CC65A5C48B3ED16B % 09DB2F639D57BDAD23D477B9DEA596FEFDB5D5FF0072172BD2FA68BEE630576F % A4F0EDC04BF22E062A7574D67DEF7E47D0BBF49ECC3FE7B2A9C15E97F573A3BB % A6E33ACBDA1995901BEA3038BF635BBBD2A5D6E9EB58CF52CF52EDBFF07FCC55 % 424A7612492494FF00FFD2F5549249253CF7D68FABFF0055F268B3AA755C3DD7 % D23DB918FB9992E7BB6D345553F1DD5D9917BECF4E9C5AADF53F49FA35C2E4F5 % 3661D76B2DA3EDF994EFAB23A78AFED5563B590F7613C3856CCACBF6FA99BD4E % EFF26E33FF0047D330723D3FD1749F5D7A9F52CCCFAFA27437554E6B008CAB1E % 5B6B5D68B2BB5BD3298FD264D78CCB7D5CD67F43AAEBAA65B55CFB3D3E7F230C % B2ACACAEB9946F65120D3539C7098F7FE8EBFB7E5BEFAF2BABE53D9E97EADEAF % F83FD62CF4922247488DF792C9DE801AEB6931EFCEFDA15D7D53229C8C363C33 % 0BA4E23EB661E457B3754FF4EDF4FD7C2AABB7F9CA3A6B2AC8B7F49FCD7A2B5B % AE67E453D0FECD5B9CEA3D573336EC4A982B67B4BAAC5CAFB3D8FF00D5AFB1FF % 00A4BD9E933F57F432FF004795F67B70BA2E4E3E3DB9165384324BFF00441C1A % DC72F1F9D6DAEA5F4E2D357FC17ABB2BAFF4752DAEA3D4DDD4307131FA18A2DA % 301CE7E6E2E23DB5B18F1FD15DBEE7D3859B4D0EDEFBB17ED6CFD73ECB91FA5A % EAB2A5265C5C38AA20D91F6B1717171441D28D7EFF00F8CF0993539C5FBEF15B % 291B9D5D55B8811F9D75B90E63BFEB752C8BBAAE3ED69A45B63AA3BCBDE1AD0E % 27F36CDBBB756BAAB3A062D9EA37A9D79B65D66EB68A2C6B6963DAD875B73BA8 % 5566563E5D0DF519FCCBF7D2A3D32CC365CCAFA7537E63041B29C67B1986C7FD % 16B9F75ADDEFFF0084B37AA5A0BB04D74F958408C7420923A7F37170065DD7D4 % 6AB5CD14002D632A77B6BD7F9B0D656FDAD64FE8B73FF43FE0D74EDEAACBBAB5 % 54F54A2D38F750D37676D0368693B72AC7E3B1CC7D6EDDEFB3D0A2CC6FE777AC % BEBF9D8B84D76331953F2EDDC6E6E35E6DA9A09FFB55B9BB773377E62CFC4B3A % BDD857DB5DB8B8C368A4DD6BCD6F7899FD0BED3E9B94B8BDCF9A029920244588 % 81127691F9BC5ECBAAF4BE92FE934F45AB25D9349B5D6E0DD5D6CBDB734B0B3E % CD4E5FAB7E3FDA5AD637D47B3D3C9A3D2F655E865FA8AC7D4AFA96DCCE995DB6 % 7516BEB63BD3C8AEBAE6EAEC60FD2E1DAEB9F6D0C7635DF47F57BBD7A7D2B3F9 % 9F4960F4AE946EC62D17FDAAEC96B6BCA2D756CABD6AC3DF8D55198CB2BF4DBE % EF7DDB3F4967AAB4FEAA75FCBE97D7AAB7A99ADADEA8598D7FA43F3E3D3664DF % EED8EF4727F41F68FDCBAFF53D5FD0FA73F0C88E23BF567040A1B7F2EEFA574D % E8FD3FA6348C5ACFA8F1166458E365CFFF008DC8B4BED7FF005377A75FF83575 % 249317A92492494FFFD3F5540CDCBA7070EFCDBE7D1C6ADF759024EDADA6C7ED % 1FD56A3AC6FADED73FEAEE5D4D0E70BFD3A5ED67D2732DB6AA2D637FAF558F6A % 205903BA09A04F67CF7033735DD49EFCCBC56FB817E4B2A8B5F73277E5BED716 % 8AFECD7DFF00AB50C6DB5E27A18FFA0F52BF52EB639FD5FA4F53EA95BDF7D74B % F56E363068BACAC47BF3B2AF6B7ECD4E43F6ECA7171BF9AAD6565E065E7B6CCB % EA00B6ECB3AD4C97319B0B6BA316B69FA0DA59ECD8D51ADDD3FA45B4D74B9A5C % 4137BDCD0D0D703F45EF8F7395D8E2BE136234D2965AE214657FB1EB3A2FD5AC % 1CE65561C3765C1871B1CD74FF00C3653ACFFA152E94748E9B896558B9D9D4D3 % EAB837170DA2AA019D19556C76EB2E589F54BEB1DB957B28B2C2719C4CFBAAAD % BFD7DC18CB9FB7F777AA37D79D5B5ECCEE9B7FA5937D97752CDC50C7E2DAF7B9 % E5CE65949BADFB1B58D63297E5329F43FED5FE9941CD66CB8F4034FD8BB1C61C % 3C422724AF500FC81EA3EB5D5F57A707F6BE0D9D42DAF78C4631AE2D13E9FAA2 % FDAEAB1BD37EDABD97FF00DB6B88C5E875E063D9FB2F3701F1FCF65F546BEA35 % C0F7BAA6FAD761DBFF0007B28A3FEBCB7BA3F59C3C8C3C5E9E3A7D995D1AA7B6 % 8A6F6D6E6B68630399F68BB3BDBD3F32B63BDB63E9BBD7FF0083CAB568F55C1E % 974D03A87567557E257B431CCADD90F74FD06D7454C737FB7B2C55E1EDE404CE % C3626090008F144F4F95F27C9AB273DD90CA328DD8EF2DFB4E5340AABB4D5BFD % 1F4F1696EF7B6BF51DFA4BBFF0244FB062605943F20B03EC6EDADA185EE04705 % ACB0EE5DD1FACBF563A858DB3A6DD461BAB7FA577DB5CEAB68076B2C6D78D5D9 % 89E959FE96DC9ABFE13629E67D54C4A1B9199BEA3601B9D977B0D74B43BFD1DB % 7FB6EFE47A2AD619E28815F9316486422AA8741178FC2A1D8C0E5E53DE5F6383 % 7F492DB1D3F4767A7BB62D7CEFD99574AC2A32697DADBF7FDA5CDB87A8CAD8E1 % 8FE8E39B9B5D76DF6FDA5CFB3D4B6AA6AABFE16C5BBD12AE9991655563E3E466 % 565C19F6A35B4540BBDAEB3DCFF57D26CFEE2E33EB4F561922B6FA5B1A379C0A % BE8FA55FABFE135B7ED19190CAAAFB4BFD6B3D6B595D389FA2AFF4ADE672C741 % 0DEC52DC6271167524D01FCBFAAFAEFD55EA87ABFD5DC0CF738D96DB486DEF23 % 693757FA0C9F60FF00BB15DAB55711FE2872326DFAAF757907F98CCB5958F06B % 9B4E4B9BFF006EE45ABB75036D4924924A7FFFD4F5558DF5BDF6D7F56F3ADA49 % 6BEA636D2F01C4B5B5BD965B6B3D27D36FA9556C7D95FA76D6FDEB6557EA1875 % 67E064E0DD22ACBA5F45846876D8D756E8FECB920A7C9EEA6ACA38EE3906D662 % D4CB5F75EDF4FDD73836D77A34BBDAFF006EC7596FBFD8B9FBDAD63ADBECA9E6 % BAEE7578F5B8B29AC1ECED9EEB2DDCBB1A73AA181D3F1AFE97567754CE0FC67D % 15B8627A2CC670AF2AA7DF93BB7E6E265BF7FA0CF57F55F52FBBF43E9AC7B7A1 % 0A3AADE3A9EF7673CB9D8E5CC1B5CD0760FB3501D67B9D5ED77D3FE5AB98720E % 2E1EDDDA99B1CB8788F5EDFCA2D06750EAD7DADA2BDAC635BEE0E240D7F77D3D % BB96DF4EB5F80D6E665DB2FA3FA3B48343371FF876BFD472BB8FD1FA87A6D751 % 8CD6318D906DF7DA5C78F6FB58CFEA6E552EFAB5998E0E6752C865CEB6093686 % B4B5AEF6B5B4D13F9AAC4CE396FA9FDE916B43DC8EDE91FBB10A1D6BAE751C81 % 5636539A376E7D8DCB018C6F01B4D3634AE9B05BD4322E6E4BBA8E7166303EF6 % 369B19FCADDEDF771FB8B98FB25188064DD6597D6E3B69A890DAE7FE118D1B95 % DBE9C9C8A98DC9CDAB171DBEEB035E71E96B40ED57D3B1CA0963801A533C72CC % CB5B010F59C56E3D95E2F4ECEA9D80E712CC5EA356512D2E3B8D2D6D1558FEA1 % 539CE73EBB2EFD255FCDDD7DDFA351E9FD2F1307A6754CDEA783FB50E316E4D3 % 82C16E26234B22A3E85777E8D8E731CFB3F494FAD91FCDD14BEC57F13AEF4AC2 % C607A6D2FCDA1CE0D2E61735D69F065D99B1EDABFA8A97D64CEEB228FB65B7D6 % DC5DE0D75BDBB6BC279DD6578D663D363AAC8B7F47EAE1755B3FED47A95FEA17 % 7A75AA73C631DCA313E619C480B908EA770373E6D6EA9D5B2998EEC379AFA763 % 3C7E93030B7B5CFD1D355F6B36E5DBB98FD8FF0052EC7FFC28B98C8B85A1F940 % 9194EC8D9556D7EFA68A7D36D755BE87B76BFF0048FF0041BBBF45E97A5E9A06 % 4D97D871AEF42F73322C2DC7810EBDE0ECDB5D7B9EE6B77FE6318AE61747B71B % 09FD43A8BEBC375B3914D17822D35CBB1DD9505BE937D5BACF4B11B77E93F476 % 5D4D1E9FE99478ACCAE66FCD18C4F52753AD7689FEAC5F48FF0014B5399F56F2 % 2D8229BF32C763B9D12EAD95D18BBFFCFC7B176CB17EA6F4B7F49FAAFD3B06D0 % E6DCDA459736CFA4DB2E2ECABEB3FF001575CFAD6D2909B24B30D8292492412F % FFD5F5549249253E7FF59FA2BA8EB36D54322BEA85B97845D5B1F43336B0E666 % 36E6E8EAA9C8A1FF006AB1FF00E9BED19DFF0068D71BD3BAFF0059E997BF1ABC % DBFA6D588F7369C41B6EDAE2FDB94CBB0DFBE86FA567A9B6B6FD9FD25ECDD57A % 5E3F54C3762DC5D59FA555F512CB6A7C1636EA2D6FBEBB36BDECFE5D6FB2AB3F % 45658BC83AF62752C0CDFB0756B6F168975D9CFDF683496B68B3305EDFD25DED % AF1EADF657FAAFF84FD37F3CD98BA901AEC4FF00D12C538906E3609D3FDF76F1 % FEB7579F9197D3B2E8CAEA179B3ED347D8E9DAD732B6EEDB9955C5DE87BB657E % BD3EA63FBEAB6DF47F49BF732EDE91D3F16EEA8CC68CE636B376156F66EA6B2E % 6B2FC9B6CC6AAFB594E356FF005AFB3659FF004D79C63F4FCDF4DBD5F019916B % 6A314D992E360158DD53AEAE9A19FA6F4B73FDDBBD3FF825D1F40FACAFE9186F % C3A319F9E64D6E360FB33741EE6B31EB190CBB9FF0FE9A9E10C9C3E202B8A028 % 4883D24D8CFC8C7AADAF26CCA63A9B9C7D0C5E9CDF5CD8D9735B7DD9DBF73B7E % DFCC585D7F21DD41CE755EAE3328FE75D75D1BDDE544D97B96F7526331B0307A % 93BA3E253EAD8EA48B6B326297E4D57D7F637E135DBFECF7FDA7FC1FF33F6654 % 3A7750AF39AD03A636BA32ED34E26563D37D4031822FCADB6372B0B231FD7FD5 % BFE50FB431FF00E0D18E500F0CAEC782D30B97A2B6E2FA3CD60559AF2E79B5CF % B1876B0D9EF0D1FF00042C236FF9AB77173B330996578D8B45965B5BA9393635 % CE7FE91A6BB5B8D5D1B37BFD377F38F7A2751A5D4877D9F19F4575CD6FA4B4B9 % FBBFD23DCCB2AA68639DFE95DEA2A1665518321FB32B318C00D4C6B9DB77F6B2 % DDEFAA9FEDFF00EC3298CA128D57F6B1819233BBEBA7F55B7D331B2BA7E47DA9 % D96F7E4DB532B69F49AEB98D67E869A6BB1AF7ECF53F3B66CF5BFC3AB9D23A4D % 3D73EB0E1F4BC661FD8D82FF00B5E550C0CFB392DF73BD59AF6E6BB3733F47F4 % 28C5A71BEDB8DD3EAB31FF004EB0DB89D4FAC64D54301C8B321C594E2E382CAB % DA36DAEB2C77E652D3B2D7B99FABB3F9CAFF004F532CF5DFAAFF0056707EAEF4 % FF00B3E3B41C8BA1F9778E6CB23B6EF7368ABE863D5F98CFF497D975D6D69803 % 402BC1B10DBC3F96CECA492498BD4924924A7FFFD6F5549249252952EA9D2713 % AAE31A32439AE1269BEB3B6DA9C46DF571EDFF0006FF00FC0EDAFF00437B2DA6 % CB2B5752494F997D6BE8DF5C7A66396E2DCEBBA73A03ECC16BAAF4F46FDA6FBF % A762EC7DBEB3C7ADEA3B272E967A6FFD16262DDE9ACCE85D7BA735CCF4AAC7AE % F757635D9F5D0E70F5D83FA6578D3E93EF636CAAEBB1BF9A7BFF0098F4D7B02C % AEABF55BEAF75871B3A8605375CE2D27200F4EEF6FD0FD6A8F4F23DB1FE95189 % A24EBAF62B4C7EBFDEF57FD27C67AA5DD5E8C99CBB5F55F631AE75D90F739EE6 % 387A83D3B7F3E9B367F38FB3DFB3F9AFF06A855D63A97DA19958F66497B8906C % A8BE96991B36D6FA9DEDFF0037DEBD6F23FC58740BEFF546466D4D6886542E16 % 359F4B5ADF975E4DEDDAE7EEFE79059FE2A3A00205D9BD4322A9F7D365CC0C7C % F6B7D1A29B5DC7FA451FB601D18FDAA363F3D5F361F597AC0AAAFB5E6D8EAEB6 % 6D6E27AA58CB23F372F65953EDC777F85DBFA7C9FF00C11747D1BEABE5F5CD8F % C4C72709E5B65B9F91BA8C7B090DDDF67C46B6ACDC8AAA63FF0045FA4A2AC8FC % FCCA7FC27A074AFA97F557A4383F03A6D2CB1AFF005196D80DD635C349AAFC93 % 75B57FD6DEB6D3E371BA3BB208F7F579B95D03EAEE0F43C7D94FE9B25E22ECA7 % B5A1EE03E8D4C6D6D65746355FE031286B28ABFE37D5B2CD5492497292492494 % A49249253FFFD9003842494D0421000000000079000000010100000018004100 % 64006F00620065002000500068006F0074006F00730068006F00700020004500 % 6C0065006D0065006E007400730000001C00410064006F006200650020005000 % 68006F0074006F00730068006F007000200045006C0065006D0065006E007400 % 7300200032002E003000000001003842494D042200000000012E4D4D002A0000 % 00080007011200030000000100010000011A00050000000100000062011B0005 % 000000010000006A012800030000000100020000013100020000001D00000072 % 01320002000000140000008F8769000400000001000000A4000000D000000048 % 00000001000000480000000141646F62652050686F746F73686F7020456C656D % 656E747320322E3000323030363A31303A30392032323A31303A313900000003 % A001000300000001FFFF0000A00200040000000100000156A003000400000001 % 000001830000000000000006010300030000000100060000011A000500000001 % 0000011E011B0005000000010000012601280003000000010002000002010004 % 000000010000012E020200040000000100000000000000000000004800000001 % 00000048000000013842494D03FD0000000000070000000000000000 %EndPhotoshop %begin_xml_code /pdfmark where {pop true} {false} ifelse /currentdistillerparams where {pop currentdistillerparams /CoreDistVersion get 5000 ge } {false} ifelse and not {userdict /pdfmark /cleartomark load put} if [/NamespacePush pdfmark [/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark /MetadataString 5038 string def % exact length of metadata /TempString 100 string def /ConsumeMetadata { currentfile TempString readline pop pop currentfile MetadataString readstring pop pop } bind def ConsumeMetadata %begin_xml_packet: 5038 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: brave-gnu-world-logo.eps
+%%CreationDate: 09.10.2006 22:10 Uhr
+%%BoundingBox: 0 0 342 387
+%%HiResBoundingBox: 0 0 342 387
+%%SuppressDotGainCompensation
+%%EndComments
+%%BeginProlog
+%%EndProlog
+%%BeginSetup
+%%EndSetup
+%ImageData: 342 387 8 3 0 1 3 "beginimage"
+%BeginPhotoshop: 16252
+% 3842494D0425000000000010000000000000000000000000000000003842494D
+% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F
+% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050
+% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C
+% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63
+% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C
+% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65
+% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48
+% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72
+% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
+% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61
+% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579
+% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63
+% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269
+% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265
+% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D
+% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A
+% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31302D
+% 30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B
+% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909
+% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65
+% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F
+% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F
+% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E
+% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070
+% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A
+% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74
+% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465
+% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
+% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F
+% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E
+% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3130
+% 2D30395432303A31303A30355A3C2F646174653E0A090909093C6B65793E636F
+% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F
+% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909
+% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B
+% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D
+% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579
+% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61
+% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C
+% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F
+% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579
+% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F
+% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74
+% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579
+% 3E0A090909093C646174653E323030362D31302D30395432303A31303A30355A
+% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74
+% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F
+% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E
+% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F
+% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
+% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
+% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A
+% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E
+% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D
+% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070
+% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909
+% 09093C646174653E323030362D31302D30395432303A31303A30355A3C2F6461
+% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572
+% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261
+% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E
+% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F
+% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
+% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
+% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
+% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B
+% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
+% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469
+% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E
+% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E
+% 0A090909093C646174653E323030362D31302D30395432303A31303A30355A3C
+% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465
+% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61
+% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70
+% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574
+% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E
+% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552
+% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61
+% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A
+% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E
+% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909
+% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D
+% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374
+% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909
+% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C
+% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561
+% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C
+% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E
+% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269
+% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
+% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E
+% 323030362D31302D30395432303A31303A30355A3C2F646174653E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461
+% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E
+% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09
+% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E
+% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F
+% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E
+% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73
+% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C
+% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261
+% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C
+% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170
+% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909
+% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138
+% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09
+% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272
+% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
+% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63
+% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67
+% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B
+% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036
+% 2D31302D30395432303A31303A30355A3C2F646174653E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C
+% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765
+% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64
+% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065
+% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E
+% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070
+% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A
+% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69
+% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64
+% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50
+% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909
+% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C
+% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269
+% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C
+% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
+% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431
+% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
+% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C
+% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
+% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
+% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374
+% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170
+% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E
+% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C
+% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
+% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F
+% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E
+% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A
+% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265
+% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69
+% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65
+% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C
+% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
+% 74653C2F6B65793E0A09090909093C646174653E323030362D31302D30395432
+% 303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
+% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
+% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C
+% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
+% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
+% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963
+% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65
+% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61
+% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67
+% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909
+% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74
+% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374
+% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E
+% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C
+% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C
+% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909
+% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63
+% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070
+% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64
+% 446174653C2F6B65793E0A09090909093C646174653E323030362D31302D3039
+% 5432303A31303A30355A3C2F646174653E0A09090909093C6B65793E636F6D2E
+% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65
+% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909
+% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09
+% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E
+% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09
+% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372
+% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65
+% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909
+% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465
+% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963
+% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170
+% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909
+% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E
+% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
+% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74
+% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465
+% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A
+% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C
+% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09
+% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64
+% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65
+% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273
+% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E
+% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
+% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909
+% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065
+% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
+% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963
+% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
+% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C
+% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74
+% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F
+% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74
+% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269
+% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64
+% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048
+% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048
+% 0000000002D802280001000000640000000100030303000000017FFF00010001
+% 0000000000000000000000006808001901900000000000200000000000000000
+% 0000000000000000000000000000000000003842494D03ED0000000000100048
+% 00000001000200480000000100023842494D042600000000000E000000000000
+% 000000003F8000003842494D040D0000000000040000001E3842494D04190000
+% 000000040000001E3842494D03F3000000000009000000000000000001003842
+% 494D040A00000000000100003842494D271000000000000A0001000000000000
+% 00023842494D03F5000000000048002F66660001006C66660006000000000001
+% 002F6666000100A1999A0006000000000001003200000001005A000000060000
+% 00000001003500000001002D000000060000000000013842494D03F800000000
+% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF
+% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000
+% 00010000024000000240000000003842494D041E000000000004000000003842
+% 494D041A00000000035D00000006000000000000000000000183000001560000
+% 001400620072006100760065002D0067006E0075002D0077006F0072006C0064
+% 002D006C006F0067006F00000001000000000000000000000000000000000000
+% 0001000000000000000000000156000001830000000000000000000000000000
+% 0000010000000000000000000000000000000000000010000000010000000000
+% 006E756C6C0000000200000006626F756E64734F626A63000000010000000000
+% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566
+% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768
+% 746C6F6E670000015600000006736C69636573566C4C73000000014F626A6300
+% 000001000000000005736C6963650000001200000007736C69636549446C6F6E
+% 67000000000000000767726F757049446C6F6E6700000000000000066F726967
+% 696E656E756D0000000C45536C6963654F726967696E0000000D6175746F4765
+% 6E6572617465640000000054797065656E756D0000000A45536C696365547970
+% 6500000000496D672000000006626F756E64734F626A63000000010000000000
+% 00526374310000000400000000546F70206C6F6E6700000000000000004C6566
+% 746C6F6E67000000000000000042746F6D6C6F6E670000018300000000526768
+% 746C6F6E67000001560000000375726C54455854000000010000000000006E75
+% 6C6C54455854000000010000000000004D736765544558540000000100000000
+% 0006616C74546167544558540000000100000000000E63656C6C546578744973
+% 48544D4C626F6F6C010000000863656C6C546578745445585400000001000000
+% 000009686F727A416C69676E656E756D0000000F45536C696365486F727A416C
+% 69676E0000000764656661756C740000000976657274416C69676E656E756D00
+% 00000F45536C69636556657274416C69676E0000000764656661756C74000000
+% 0B6267436F6C6F7254797065656E756D0000001145536C6963654247436F6C6F
+% 7254797065000000004E6F6E6500000009746F704F75747365746C6F6E670000
+% 00000000000A6C6566744F75747365746C6F6E67000000000000000C626F7474
+% 6F6D4F75747365746C6F6E67000000000000000B72696768744F75747365746C
+% 6F6E6700000000003842494D041100000000000101003842494D041400000000
+% 0004000000013842494D040C000000001A350000000100000071000000800000
+% 01540000AA0000001A1900180001FFD8FFE000104A4649460001020100480048
+% 0000FFED000C41646F62655F434D0002FFEE000E41646F626500648000000001
+% FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15181313151313
+% 18110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
+% 0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E14110C0C0C0C
+% 0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
+% 0C0C0C0C0C0CFFC00011080080007103012200021101031101FFDD00040008FF
+% C4013F0000010501010101010100000000000000030001020405060708090A0B
+% 0100010501010101010100000000000000010002030405060708090A0B100001
+% 0401030204020507060805030C33010002110304211231054151611322718132
+% 061491A1B14223241552C16233347282D14307259253F0E1F163733516A2B283
+% 264493546445C2A3743617D255E265F2B384C3D375E3F3462794A485B495C4D4
+% E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797A7B7C7D7E7F7
+% 1100020201020404030405060707060535010002110321311204415161712213
+% 0532819114A1B14223C152D1F0332462E1728292435315637334F1250616A2B2
+% 83072635C2D2449354A317644555367465E2F2B384C3D375E3F34694A485B495
+% C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767778797A7B7C7
+% FFDA000C03010002110311003F00F5549249252962FD63FADFD0BEADD3BFA95F
+% FA67006BC4AA1D7BC1DC039B4EE6EDAFF46FFD35BE9D3FF09BD61FD7EFAFE3A1
+% 8FD91D22323AEDE000000E18E1C3DB658DFA2FC87B7DD451FF00A1191FA2F4AA
+% C9E1FA4FD5DCEEA998EEA7D58BFA8751CC74D3597026D70038716BABAF1F1D8D
+% DB65FF00CC52CF469AB67A94D8929EA2CFF1C4CB2D8E9FD132322AEEEB2C6D6E
+% E63F9BAD993F9BFF0008B5A9FF0018D45AD31D1F3C585E6BA9B1400F7EA1B5D7
+% BF258EB2C76DFA14D76A9F4FFA834B58D7E7E4D8D773F66C6706D4D91F47D6B2
+% BFB4DCE6EEFE77F56FFC2F5ADDE9BD07A474B71B30B19B5DCE043AF717597104
+% 8739AFCABDD6E4399B9BBB67AA9292F4DBFA86452EB73B1460B8B88AA8F505AF
+% 0C1F45F7BEAFD0B2C7FF00A1A5F7FA7FF721FF00E0ADA4924A79BEBBD47EB974
+% 9B1F7E06053D6B05DAB59597539356AEDCCB1937332D9B7D3F4ACC7632DFF494
+% 7F855CB752FF0019FF005971C7A7FB2A8E9F748939A320340D665B65185FF07F
+% E13FF3E2F4D49253E59D37FC66FD64B323D4C9AF03269827ECF8FEA31CE8F67E
+% 8B21CFC8D9EFFF004B4FFDB5FCF57E83D13AFF004EEB743ADC37383EBDBEB63D
+% A36DB5EE1B99BD9AEE63FF00C1DF53ACC7BBFC0DB62C4FAD5FE2EFA4F5B6D995
+% 84D6F4EEABF49B91588AEC7025F199437D96FA9BDDFA7FE91FF1BE9FA2BCFABB
+% FAD740EBC303A89FB1754C40E38990C135DA1FFE1F7B87EB38D76CF753FF005B
+% FD0E4D1FA24A7DB9258DF56FEB0B3ACE31173063E75207AF44CB48FCDC9C677F
+% 84C5B7F33FD1FF00336FE916CA4A524924929FFFD0F555CC7D7DFAE15FD58E96
+% 3D269B3A96687D7835812039BB77DF618DBB28F52BFD1FF86B3F47F43D5B6AE9
+% D782F56EA87EB37D6BCAEAAE71B315961A30441814D42CB3D50DB7DCDD98F5DB
+% 97657B7FA45DFE0D2527FAADD06CCA7D9D433C3F2AFB9C2581FF00A5BEEB9DBD
+% 98E2CB377BED7B7D5CABBFC151FA7C8B3D15EBDD07A1D7D2F1F7DA18FCFB9A06
+% 4DCC076C0FA18F8FBE5D5E263FD0A6BFFAF59FA7B6D58DF527A355481956FBED
+% A2B635B31FA3B2D636FBDBB3DCE6DCDAACAFF49F4FF58BAA5D724A52499CE6B1
+% A5CE21AD689738E8001DCAE03AFF00F8DAC1C6C87E07D5FC63D57246E67AF3B6
+% 86BFE830B3682FCA67A9FB9E8D567F81C9494FA024BCBFA6FF008CDFAD0EC963
+% 73B0F06DAF5DF4D0E7D76684336B2CB2DC9ABD5F51DF42C6319FF0D5AE9FA87F
+% 8CAFAAB81D3E9CCB6EB1F66434BABC163272416BBD1B59754E2C663BAAB37FF3
+% F6D7EAFA567D9FD6494F5292E1F0FF00C6C746C8B62DC0CDA292EDA2ED8D7800
+% 7D27DB5D563AE6EC6EDDDE9577AEB7A6756E9BD5F1465F4DC8665504ED2F61E1
+% D01DE9D8C3EFAACDAE6FE8EC6FA8929B6B9FFAEDF5529FACFD1DD8A36579F4FE
+% 930725E0FB1FA6E61733DEDAB21ADF4EDFFADDFE958FA2B5D024929F11FAB3D7
+% 3A85393582F38BD4F049AB6580B75691F68C7CE66D7BFECB7ECD96B367AACCA6
+% 7E8EAFB4D78FE9FB2F4ECFA3A8E15799402D65920B1D1B98F6935DD4D9B4B9BE
+% A536B1F559B5CBC5FEB8B2AE9FFE303AA8A229AEC6B2D796E9B5D6B28B6DB7FE
+% DE7BAE7AEFBEA266165F6E00115DB59B76811B2DC77370AFF5777B9D6DF5FD99
+% DFF07E8BFF00B694F66924924A7FFFD1F50CA6DCFC5B9943B6DCEADC2B7710E2
+% 0EC77F9CBE7BFAB4E0031BB8377BECA4171F687DA296D46C0DF76C7EC77FDB5F
+% CB5F44AF2FFAEFF50F37133EFEBBD0697E5D19AE2EEA3D3DB2FB03DC4BDD918C
+% DFA56B2C7B9DBAAFE728B1FF00A1FD0FF454A75FEABFD6CE958551C5CFB7ECF5
+% 585A5B976FB6BF576B6ABB1EFB3E856FFD17A8CB5DB29FF03FA3B29FD274EFFA
+% CBF5718DDCFEAB86D6F89C8A80FF00AB5E29565B32D95ED7EE021B66FF007169
+% 8D1CF6EEAFD4B58DFF00AEBFFAEAE51F567A78A1D939748A98D87B59639AC3EF
+% FE65B90E26AAE86BBE97BFFF0003FCF4A6F7D6CFAD79DF5D731DD27A3EFABA15
+% 0EFD259043B21CD3B9AFB07E653B87EAD8EFFF008EBFF58FB3E3D15B1BEAF328
+% A994359B8D861B5D675B0804BFE916D96FE6FAAC67E67E8BFC27A0AE74EB72F2
+% 5870FEAFE28BE9A5C2B665D601C7A3633D4B6DB03D94D3EADAEB376FBEFF00A1
+% BFF43916FF00379FD33A66664752756E75BD42C69DAEAEB0C7EE206DDD6DB697
+% 6DDBFF0069BF4791F63FE91FA0BD3A1094FE51F5DB4592CB18EA5B67A664E3D2
+% 2CFB3D8CA7710D2D6398C0EDAF6B296B3D3AD9EAEBFB9EA7F3BF43F3F3727168
+% 19363AD65673C1FD333783732086ED756E2EB9F6FF00C5FDA2F7B3FE1175DD4D
+% B57D9CBF368C367516FA78ADC2A326FBC8C6AEC7E4E463F517D77D1535FEA3BF
+% 43BFF9CBFF0056FD27ABE9ACCE9F89899F636ACAE9F878990197598CCFB5B28B
+% 2B25D35E2E6E1DF75F915DBB3D4C87BEBC6FF47EAD767E92C481C7C5C249F31C
+% 3308E324D47865A5D7CAE05D7D74EFAAF0FA5EE716163DA46D734B37D3B086FA
+% 16FD0F568FE77DFF00A657BA5F54C8C1CCAF370EFF00B2DAD86B5ED1B9AF6C7F
+% 35918ECFE9547FC67E9B7FF45FB3FD35B35F41EAB876BF763B6DC4B6B873F633
+% 63B74FF3B4B5D7D9F67D5ED6E5595FBFFE2972AFC5AF2736EFD9CE6E157EA0AA
+% 9DC1EDAED786FB9BE859BBD2FA5F9BFF006CFEE38E23FA244BF050C9FBC0C5F5
+% 7E8DF5F3A4655219D5AEA7A5E6B44B9B6D81B4BC69FA5C5C9B7D3ADFBB77F30E
+% FD62AFF8BFD3595BAD7F8D3FAA9D36A78C6C8FDA59634AE8C604B4B88259BB28
+% B7D06D7BBD8FF4DD75ACFF004162F2BBED78B0E1753A832CD4327F9A7C7B5BB2
+% C1FE05AE6FBF6BFF00EDB46C6C460692D0CADDA83B581B13F9D5B9A2FC8B9BFB
+% 9E933E87F39E8A8D911B9DD47AC754BFAAF5100E6E7BD8E3535BA064B7ECF486
+% 39DFE15F551450CDFF00D169CBB6FF00E6BD45E93F526870CC65A5C48B3ED16B
+% 09DB2F639D57BDAD23D477B9DEA596FEFDB5D5FF0072172BD2FA68BEE630576F
+% A4F0EDC04BF22E062A7574D67DEF7E47D0BBF49ECC3FE7B2A9C15E97F573A3BB
+% A6E33ACBDA1995901BEA3038BF635BBBD2A5D6E9EB58CF52CF52EDBFF07FCC55
+% 424A7612492494FF00FFD2F5549249253CF7D68FABFF0055F268B3AA755C3DD7
+% D23DB918FB9992E7BB6D345553F1DD5D9917BECF4E9C5AADF53F49FA35C2E4F5
+% 3661D76B2DA3EDF994EFAB23A78AFED5563B590F7613C3856CCACBF6FA99BD4E
+% EFF26E33FF0047D330723D3FD1749F5D7A9F52CCCFAFA27437554E6B008CAB1E
+% 5B6B5D68B2BB5BD3298FD264D78CCB7D5CD67F43AAEBAA65B55CFB3D3E7F230C
+% B2ACACAEB9946F65120D3539C7098F7FE8EBFB7E5BEFAF2BABE53D9E97EADEAF
+% F83FD62CF4922247488DF792C9DE801AEB6931EFCEFDA15D7D53229C8C363C33
+% 0BA4E23EB661E457B3754FF4EDF4FD7C2AABB7F9CA3A6B2AC8B7F49FCD7A2B5B
+% AE67E453D0FECD5B9CEA3D573336EC4A982B67B4BAAC5CAFB3D8FF00D5AFB1FF
+% 00A4BD9E933F57F432FF004795F67B70BA2E4E3E3DB9165384324BFF00441C1A
+% DC72F1F9D6DAEA5F4E2D357FC17ABB2BAFF4752DAEA3D4DDD4307131FA18A2DA
+% 301CE7E6E2E23DB5B18F1FD15DBEE7D3859B4D0EDEFBB17ED6CFD73ECB91FA5A
+% EAB2A5265C5C38AA20D91F6B1717171441D28D7EFF00F8CF0993539C5FBEF15B
+% 291B9D5D55B8811F9D75B90E63BFEB752C8BBAAE3ED69A45B63AA3BCBDE1AD0E
+% 27F36CDBBB756BAAB3A062D9EA37A9D79B65D66EB68A2C6B6963DAD875B73BA8
+% 5566563E5D0DF519FCCBF7D2A3D32CC365CCAFA7537E63041B29C67B1986C7FD
+% 16B9F75ADDEFFF0084B37AA5A0BB04D74F958408C7420923A7F37170065DD7D4
+% 6AB5CD14002D632A77B6BD7F9B0D656FDAD64FE8B73FF43FE0D74EDEAACBBAB5
+% 54F54A2D38F750D37676D0368693B72AC7E3B1CC7D6EDDEFB3D0A2CC6FE777AC
+% BEBF9D8B84D76331953F2EDDC6E6E35E6DA9A09FFB55B9BB773377E62CFC4B3A
+% BDD857DB5DB8B8C368A4DD6BCD6F7899FD0BED3E9B94B8BDCF9A029920244588
+% 81127691F9BC5ECBAAF4BE92FE934F45AB25D9349B5D6E0DD5D6CBDB734B0B3E
+% CD4E5FAB7E3FDA5AD637D47B3D3C9A3D2F655E865FA8AC7D4AFA96DCCE995DB6
+% 7516BEB63BD3C8AEBAE6EAEC60FD2E1DAEB9F6D0C7635DF47F57BBD7A7D2B3F9
+% 9F4960F4AE946EC62D17FDAAEC96B6BCA2D756CABD6AC3DF8D55198CB2BF4DBE
+% EF7DDB3F4967AAB4FEAA75FCBE97D7AAB7A99ADADEA8598D7FA43F3E3D3664DF
+% EED8EF4727F41F68FDCBAFF53D5FD0FA73F0C88E23BF567040A1B7F2EEFA574D
+% E8FD3FA6348C5ACFA8F1166458E365CFFF008DC8B4BED7FF005377A75FF83575
+% 249317A92492494FFFD3F5540CDCBA7070EFCDBE7D1C6ADF759024EDADA6C7ED
+% 1FD56A3AC6FADED73FEAEE5D4D0E70BFD3A5ED67D2732DB6AA2D637FAF558F6A
+% 205903BA09A04F67CF7033735DD49EFCCBC56FB817E4B2A8B5F73277E5BED716
+% 8AFECD7DFF00AB50C6DB5E27A18FFA0F52BF52EB639FD5FA4F53EA95BDF7D74B
+% F56E363068BACAC47BF3B2AF6B7ECD4E43F6ECA7171BF9AAD6565E065E7B6CCB
+% EA00B6ECB3AD4C97319B0B6BA316B69FA0DA59ECD8D51ADDD3FA45B4D74B9A5C
+% 4137BDCD0D0D703F45EF8F7395D8E2BE136234D2965AE214657FB1EB3A2FD5AC
+% 1CE65561C3765C1871B1CD74FF00C3653ACFFA152E94748E9B896558B9D9D4D3
+% EAB837170DA2AA019D19556C76EB2E589F54BEB1DB957B28B2C2719C4CFBAAAD
+% BFD7DC18CB9FB7F777AA37D79D5B5ECCEE9B7FA5937D97752CDC50C7E2DAF7B9
+% E5CE65949BADFB1B58D63297E5329F43FED5FE9941CD66CB8F4034FD8BB1C61C
+% 3C422724AF500FC81EA3EB5D5F57A707F6BE0D9D42DAF78C4631AE2D13E9FAA2
+% FDAEAB1BD37EDABD97FF00DB6B88C5E875E063D9FB2F3701F1FCF65F546BEA35
+% C0F7BAA6FAD761DBFF0007B28A3FEBCB7BA3F59C3C8C3C5E9E3A7D995D1AA7B6
+% 8A6F6D6E6B68630399F68BB3BDBD3F32B63BDB63E9BBD7FF0083CAB568F55C1E
+% 974D03A87567557E257B431CCADD90F74FD06D7454C737FB7B2C55E1EDE404CE
+% C3626090008F144F4F95F27C9AB273DD90CA328DD8EF2DFB4E5340AABB4D5BFD
+% 1F4F1696EF7B6BF51DFA4BBFF0244FB062605943F20B03EC6EDADA185EE04705
+% ACB0EE5DD1FACBF563A858DB3A6DD461BAB7FA577DB5CEAB68076B2C6D78D5D9
+% 89E959FE96DC9ABFE13629E67D54C4A1B9199BEA3601B9D977B0D74B43BFD1DB
+% 7FB6EFE47A2AD619E28815F9316486422AA8741178FC2A1D8C0E5E53DE5F6383
+% 7F492DB1D3F4767A7BB62D7CEFD99574AC2A32697DADBF7FDA5CDB87A8CAD8E1
+% 8FE8E39B9B5D76DF6FDA5CFB3D4B6AA6AABFE16C5BBD12AE9991655563E3E466
+% 565C19F6A35B4540BBDAEB3DCFF57D26CFEE2E33EB4F561922B6FA5B1A379C0A
+% BE8FA55FABFE135B7ED19190CAAAFB4BFD6B3D6B595D389FA2AFF4ADE672C741
+% 0DEC52DC6271167524D01FCBFAAFAEFD55EA87ABFD5DC0CF738D96DB486DEF23
+% 693757FA0C9F60FF00BB15DAB55711FE2872326DFAAF757907F98CCB5958F06B
+% 9B4E4B9BFF006EE45ABB75036D4924924A7FFFD4F5558DF5BDF6D7F56F3ADA49
+% 6BEA636D2F01C4B5B5BD965B6B3D27D36FA9556C7D95FA76D6FDEB6557EA1875
+% 67E064E0DD22ACBA5F45846876D8D756E8FECB920A7C9EEA6ACA38EE3906D662
+% D4CB5F75EDF4FDD73836D77A34BBDAFF006EC7596FBFD8B9FBDAD63ADBECA9E6
+% BAEE7578F5B8B29AC1ECED9EEB2DDCBB1A73AA181D3F1AFE97567754CE0FC67D
+% 15B8627A2CC670AF2AA7DF93BB7E6E265BF7FA0CF57F55F52FBBF43E9AC7B7A1
+% 0A3AADE3A9EF7673CB9D8E5CC1B5CD0760FB3501D67B9D5ED77D3FE5AB98720E
+% 2E1EDDDA99B1CB8788F5EDFCA2D06750EAD7DADA2BDAC635BEE0E240D7F77D3D
+% BB96DF4EB5F80D6E665DB2FA3FA3B48343371FF876BFD472BB8FD1FA87A6D751
+% 8CD6318D906DF7DA5C78F6FB58CFEA6E552EFAB5998E0E6752C865CEB6093686
+% B4B5AEF6B5B4D13F9AAC4CE396FA9FDE916B43DC8EDE91FBB10A1D6BAE751C81
+% 5636539A376E7D8DCB018C6F01B4D3634AE9B05BD4322E6E4BBA8E7166303EF6
+% 369B19FCADDEDF771FB8B98FB25188064DD6597D6E3B69A890DAE7FE118D1B95
+% DBE9C9C8A98DC9CDAB171DBEEB035E71E96B40ED57D3B1CA0963801A533C72CC
+% CB5B010F59C56E3D95E2F4ECEA9D80E712CC5EA356512D2E3B8D2D6D1558FEA1
+% 539CE73EBB2EFD255FCDDD7DDFA351E9FD2F1307A6754CDEA783FB50E316E4D3
+% 82C16E26234B22A3E85777E8D8E731CFB3F494FAD91FCDD14BEC57F13AEF4AC2
+% C607A6D2FCDA1CE0D2E61735D69F065D99B1EDABFA8A97D64CEEB228FB65B7D6
+% DC5DE0D75BDBB6BC279DD6578D663D363AAC8B7F47EAE1755B3FED47A95FEA17
+% 7A75AA73C631DCA313E619C480B908EA770373E6D6EA9D5B2998EEC379AFA763
+% 3C7E93030B7B5CFD1D355F6B36E5DBB98FD8FF0052EC7FFC28B98C8B85A1F940
+% 9194EC8D9556D7EFA68A7D36D755BE87B76BFF0048FF0041BBBF45E97A5E9A06
+% 4D97D871AEF42F73322C2DC7810EBDE0ECDB5D7B9EE6B77FE6318AE61747B71B
+% 09FD43A8BEBC375B3914D17822D35CBB1DD9505BE937D5BACF4B11B77E93F476
+% 5D4D1E9FE99478ACCAE66FCD18C4F52753AD7689FEAC5F48FF0014B5399F56F2
+% 2D8229BF32C763B9D12EAD95D18BBFFCFC7B176CB17EA6F4B7F49FAAFD3B06D0
+% E6DCDA459736CFA4DB2E2ECABEB3FF001575CFAD6D2909B24B30D8292492412F
+% FFD5F5549249253E7FF59FA2BA8EB36D54322BEA85B97845D5B1F43336B0E666
+% 36E6E8EAA9C8A1FF006AB1FF00E9BED19DFF0068D71BD3BAFF0059E997BF1ABC
+% DBFA6D588F7369C41B6EDAE2FDB94CBB0DFBE86FA567A9B6B6FD9FD25ECDD57A
+% 5E3F54C3762DC5D59FA555F512CB6A7C1636EA2D6FBEBB36BDECFE5D6FB2AB3F
+% 45658BC83AF62752C0CDFB0756B6F168975D9CFDF683496B68B3305EDFD25DED
+% AF1EADF657FAAFF84FD37F3CD98BA901AEC4FF00D12C538906E3609D3FDF76F1
+% FEB7579F9197D3B2E8CAEA179B3ED347D8E9DAD732B6EEDB9955C5DE87BB657E
+% BD3EA63FBEAB6DF47F49BF732EDE91D3F16EEA8CC68CE636B376156F66EA6B2E
+% 6B2FC9B6CC6AAFB594E356FF005AFB3659FF004D79C63F4FCDF4DBD5F019916B
+% 6A314D992E360158DD53AEAE9A19FA6F4B73FDDBBD3FF825D1F40FACAFE9186F
+% C3A319F9E64D6E360FB33741EE6B31EB190CBB9FF0FE9A9E10C9C3E202B8A028
+% 4883D24D8CFC8C7AADAF26CCA63A9B9C7D0C5E9CDF5CD8D9735B7DD9DBF73B7E
+% DFCC585D7F21DD41CE755EAE3328FE75D75D1BDDE544D97B96F7526331B0307A
+% 93BA3E253EAD8EA48B6B326297E4D57D7F637E135DBFECF7FDA7FC1FF33F6654
+% 3A7750AF39AD03A636BA32ED34E26563D37D4031822FCADB6372B0B231FD7FD5
+% BFE50FB431FF00E0D18E500F0CAEC782D30B97A2B6E2FA3CD60559AF2E79B5CF
+% B1876B0D9EF0D1FF00042C236FF9AB77173B330996578D8B45965B5BA9393635
+% CE7FE91A6BB5B8D5D1B37BFD377F38F7A2751A5D4877D9F19F4575CD6FA4B4B9
+% FBBFD23DCCB2AA68639DFE95DEA2A1665518321FB32B318C00D4C6B9DB77F6B2
+% DDEFAA9FEDFF00EC3298CA128D57F6B1819233BBEBA7F55B7D331B2BA7E47DA9
+% D96F7E4DB532B69F49AEB98D67E869A6BB1AF7ECF53F3B66CF5BFC3AB9D23A4D
+% 3D73EB0E1F4BC661FD8D82FF00B5E550C0CFB392DF73BD59AF6E6BB3733F47F4
+% 28C5A71BEDB8DD3EAB31FF004EB0DB89D4FAC64D54301C8B321C594E2E382CAB
+% DA36DAEB2C77E652D3B2D7B99FABB3F9CAFF004F532CF5DFAAFF0056707EAEF4
+% FF00B3E3B41C8BA1F9778E6CB23B6EF7368ABE863D5F98CFF497D975D6D69803
+% 402BC1B10DBC3F96CECA492498BD4924924A7FFFD6F5549249252952EA9D2713
+% AAE31A32439AE1269BEB3B6DA9C46DF571EDFF0006FF00FC0EDAFF00437B2DA6
+% CB2B5752494F997D6BE8DF5C7A66396E2DCEBBA73A03ECC16BAAF4F46FDA6FBF
+% A762EC7DBEB3C7ADEA3B272E967A6FFD16262DDE9ACCE85D7BA735CCF4AAC7AE
+% F757635D9F5D0E70F5D83FA6578D3E93EF636CAAEBB1BF9A7BFF0098F4D7B02C
+% AEABF55BEAF75871B3A8605375CE2D27200F4EEF6FD0FD6A8F4F23DB1FE95189
+% A24EBAF62B4C7EBFDEF57FD27C67AA5DD5E8C99CBB5F55F631AE75D90F739EE6
+% 387A83D3B7F3E9B367F38FB3DFB3F9AFF06A855D63A97DA19958F66497B8906C
+% A8BE96991B36D6FA9DEDFF0037DEBD6F23FC58740BEFF546466D4D6886542E16
+% 359F4B5ADF975E4DEDDAE7EEFE79059FE2A3A00205D9BD4322A9F7D365CC0C7C
+% F6B7D1A29B5DC7FA451FB601D18FDAA363F3D5F361F597AC0AAAFB5E6D8EAEB6
+% 6D6E27AA58CB23F372F65953EDC777F85DBFA7C9FF00C11747D1BEABE5F5CD8F
+% C4C72709E5B65B9F91BA8C7B090DDDF67C46B6ACDC8AAA63FF0045FA4A2AC8FC
+% FCCA7FC27A074AFA97F557A4383F03A6D2CB1AFF005196D80DD635C349AAFC93
+% 75B57FD6DEB6D3E371BA3BB208F7F579B95D03EAEE0F43C7D94FE9B25E22ECA7
+% B5A1EE03E8D4C6D6D65746355FE031286B28ABFE37D5B2CD5492497292492494
+% A49249253FFFD9003842494D0421000000000079000000010100000018004100
+% 64006F00620065002000500068006F0074006F00730068006F00700020004500
+% 6C0065006D0065006E007400730000001C00410064006F006200650020005000
+% 68006F0074006F00730068006F007000200045006C0065006D0065006E007400
+% 7300200032002E003000000001003842494D042200000000012E4D4D002A0000
+% 00080007011200030000000100010000011A00050000000100000062011B0005
+% 000000010000006A012800030000000100020000013100020000001D00000072
+% 01320002000000140000008F8769000400000001000000A4000000D000000048
+% 00000001000000480000000141646F62652050686F746F73686F7020456C656D
+% 656E747320322E3000323030363A31303A30392032323A31303A313900000003
+% A001000300000001FFFF0000A00200040000000100000156A003000400000001
+% 000001830000000000000006010300030000000100060000011A000500000001
+% 0000011E011B0005000000010000012601280003000000010002000002010004
+% 000000010000012E020200040000000100000000000000000000004800000001
+% 00000048000000013842494D03FD0000000000070000000000000000
+%EndPhotoshop
+%begin_xml_code
+/pdfmark where {pop true} {false} ifelse
+/currentdistillerparams where {pop currentdistillerparams
+/CoreDistVersion get 5000 ge } {false} ifelse
+and not {userdict /pdfmark /cleartomark load put} if
+[/NamespacePush pdfmark
+[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark
+/MetadataString 5038 string def % exact length of metadata
+/TempString 100 string def
+/ConsumeMetadata {
+currentfile TempString readline pop pop
+currentfile MetadataString readstring pop pop
+} bind def
+ConsumeMetadata
+%begin_xml_packet: 5038
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<?adobe-xap-filters esc="CR"?>
<x:xapmeta xmlns:x='adobe:ns:meta/' x:xaptk='XMP toolkit 2.8.2-33, framework 1.5'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
@@ -61,7 +598,77 @@
-<?xpacket end='w'?> %end_xml_packet [{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark [{photoshop_metadata_stream} MetadataString /PUT pdfmark [/_objdef {nextImage} /NI pdfmark %end_xml_code gsave % EPS gsave /hascolor /deviceinfo where {pop deviceinfo /Colors known {deviceinfo /Colors get exec 1 gt} {false} ifelse} {/statusdict where {pop statusdict /processcolors known {statusdict /processcolors get exec 1 gt} {false} ifelse} {false} ifelse} ifelse def 40 dict begin /_image systemdict /image get def /_setgray systemdict /setgray get def /_currentgray systemdict /currentgray get def /_settransfer systemdict /settransfer get def /_currenttransfer systemdict /currenttransfer get def /blank 0 _currenttransfer exec 1 _currenttransfer exec eq def /negative blank {0 _currenttransfer exec 0.5 lt} {0 _currenttransfer exec 1 _currenttransfer exec gt} ifelse def /inverted? negative def /level2 systemdict /languagelevel known {languagelevel 2 ge} {false} ifelse def /level3 systemdict /languagelevel known {languagelevel 3 ge} {false} ifelse def level2 {/band 0 def} {/band 5 def} ifelse gsave % Image Header gsave /rows 387 def /cols 342 def 342 387 scale level2 { /DeviceRGB setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if /beginimage level2 {/image load def} {{pop .9 setgray 0 0 moveto 0 1 lineto 1 1 lineto 1 0 lineto fill 0 setgray 0 1 translate 1 cols div 1 rows div scale /ratio {cols 400 div mul} def /Helvetica findfont 15 ratio scalefont setfont 5 ratio -20 ratio moveto (Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show /x 128 string def {currentfile x readline {} {pop exit} ifelse (~>) search {pop pop pop exit} {pop} ifelse } loop } def} ifelse 12 dict begin /ImageType 1 def /Width cols def /Height rows def /ImageMatrix [cols 0 0 rows neg 0 rows] def /BitsPerComponent 8 def /Decode [0 1 0 1 0 1] def /DataSource currentfile /ASCII85Decode filter /DCTDecode filter def currentdict end %%BeginBinary: 21006 beginimage s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt
+<?xpacket end='w'?>
+%end_xml_packet
+[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark
+[{photoshop_metadata_stream} MetadataString /PUT pdfmark
+[/_objdef {nextImage} /NI pdfmark
+%end_xml_code
+gsave % EPS gsave
+/hascolor
+/deviceinfo where
+{pop deviceinfo /Colors known
+{deviceinfo /Colors get exec 1 gt}
+{false} ifelse}
+{/statusdict where
+{pop statusdict /processcolors known
+{statusdict /processcolors get exec 1 gt}
+{false} ifelse}
+{false} ifelse}
+ifelse
+def
+40 dict begin
+/_image systemdict /image get def
+/_setgray systemdict /setgray get def
+/_currentgray systemdict /currentgray get def
+/_settransfer systemdict /settransfer get def
+/_currenttransfer systemdict /currenttransfer get def
+/blank 0 _currenttransfer exec
+1 _currenttransfer exec eq def
+/negative blank
+{0 _currenttransfer exec 0.5 lt}
+{0 _currenttransfer exec 1 _currenttransfer exec gt}
+ifelse def
+/inverted? negative def
+/level2 systemdict /languagelevel known
+{languagelevel 2 ge} {false} ifelse def
+/level3 systemdict /languagelevel known
+{languagelevel 3 ge} {false} ifelse def
+level2 {/band 0 def} {/band 5 def} ifelse
+gsave % Image Header gsave
+/rows 387 def
+/cols 342 def
+342 387 scale
+level2 {
+/DeviceRGB
+setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if
+/beginimage level2
+{/image load def}
+{{pop .9 setgray 0 0 moveto 0 1 lineto
+1 1 lineto 1 0 lineto fill 0 setgray
+0 1 translate 1 cols div 1 rows div scale
+/ratio {cols 400 div mul} def
+/Helvetica findfont 15 ratio scalefont setfont
+5 ratio -20 ratio moveto
+(Mit JPEG komprimierte Bilder ben\232tigen PostScript Level 2) show
+/x 128 string def
+{currentfile x readline {} {pop exit} ifelse
+(~>) search {pop pop pop exit} {pop} ifelse
+} loop } def}
+ifelse
+12 dict begin
+/ImageType 1 def
+/Width cols def
+/Height rows def
+/ImageMatrix [cols 0 0 rows neg 0 rows] def
+/BitsPerComponent 8 def
+/Decode [0 1 0 1 0 1] def
+/DataSource currentfile /ASCII85Decode filter
+/DCTDecode filter def
+currentdict end
+%%BeginBinary: 21006
+beginimage
+s4IA0!"_al8O`[\!W`9l!([(is6]js6"FnCAH67k!!!!"s4[O,!"obO%M0*b&.fQt
'+km!,8q:3)C$FB(Ddl(+qY4l$k*OQ&I]'V$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ$k*OQ
$iq%U',DH$)]';0'FkT_'GM#e%Ls0b$k*OQ$kX'[$k*OQ$kWmV$k*OQ$k*OQ$k*OQ
$k*OQ$k*OQ$k*OQ$k30O!"fJ;K)o!T!?qLF&HMtG!WUsU"995;_uW(&!!*6(!<E3%
@@ -378,4 +985,9 @@ P"KeukZoD(0?%Inm@+%To>d`-]BZ:eT4b-1P?\XtIBLQ#Ou?0'_*:r(p6IVgL7U\d
e<718C=1KkIR!E`os"4GNSjHmdoMW',cN&P8P2Q"P#@H7,a>*f8L5f2P"A8;,a)&g
8L0OrP"?rK,a(_ps4?ZO?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrk
Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrk
-Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVuPE~> %%EndBinary grestore end % Image Trailer grestore grestore % EPS grestore [{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark [/NamespacePop pdfmark \ No newline at end of file
+Vqb0V*0NpB`?jKb,cBEq?6#,#IDmMkaX!e>;I1?+8q"Z)iQ3@CgeqGuP"L/A-/lrkVuPE~>
+%%EndBinary
+grestore end % Image Trailer grestore
+grestore % EPS grestore
+[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark
+[/NamespacePop pdfmark
diff --git a/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex b/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex
index 9bfa33d0364..116cde6d9bf 100644
--- a/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex
+++ b/Master/texmf-dist/doc/generic/pgf/macros/pgfmanual-en-macros.tex
@@ -7,10 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.28 2008/02/20 11:00:42 tantau Exp $
+% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.45 2009/11/15 13:13:24 ludewich Exp $
+
\providecommand\href[2]{\texttt{#1}}
+\providecommand\hypertarget[2]{\texttt{#1}}
+\providecommand\hyperlink[2]{\texttt{#1}}
\colorlet{examplefill}{yellow!80!black}
@@ -28,6 +31,7 @@
\pgfmanualentryheadline{\texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}}
\index{#1@\protect\texttt{#1} layout}%
\index{Page layouts!#1@\protect\texttt{#1}}%
+ \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -44,55 +48,152 @@
\end{pgfmanualentry}
}
+\newenvironment{commandlist}[1]{%
+ \begin{pgfmanualentry}
+ \foreach \xx in {#1} {%
+ \expandafter\extractcommand\xx\@@
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+
+% \begin{internallist}[register]{\pgf@xa}
+% \end{internallist}
+%
+% \begin{internallist}[register]{\pgf@xa,\pgf@xb}
+% \end{internallist}
+\newenvironment{internallist}[2][register]{%
+ \begin{pgfmanualentry}
+ \foreach \xx in {#2} {%
+ \expandafter\extractinternalcommand\expandafter{\xx}{#1}%
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+\def\extractinternalcommand#1#2{%
+ \pgfmanualentryheadline{Internal #2 \declare{\texttt{\string#1}}}%
+ \removeats{#1}%
+ \index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}%
+ \index{\strippedat @\protect\myprintocmmand{\strippedat}}%
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
+
%% MW: START MATH MACROS
-\def\mvar#1{{\rmfamily\textit{#1}}}
+\def\mvar#1{{\ifmmode\textrm{\textit{#1}}\else\rmfamily\textit{#1}\fi}}
\makeatletter
\def\extractmathfunctionname#1{\extractmathfunctionname@#1(,)\tmpa\tmpb}
\def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}}
-\def\extractmathoperatorname{\begingroup\def\mvar##1{}\def\ {}\extractmathoperatorname@}
-\def\extractmathoperatorname@#1{\xdef\mathname{#1}\endgroup}
-
\makeatother
-\def\vskipspecial#1{\vskip#1\vskip0em}
-
\newenvironment{math-function}[1]{
+ \def\mathdefaultname{#1}
+ \extractmathfunctionname{#1}
+ \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
\begin{pgfmanualentry}
- \extractmathfunctionname{#1}
\pgfmanualentryheadline{\texttt{#1}}%
\index{\mathname @\protect\texttt{\mathname} math function}%
- \index{Math functions!\mathname @\protect\texttt{\mathname}}
+ \index{Math functions!\mathname @\protect\texttt{\mathname}}%
\pgfmanualbody
}
{
- \end{pgfmanualentry}\vskipspecial{-3em}
+ \end{pgfmanualentry}
}
-\newenvironment{math-operator}[1]{
+\def\pgfmanualemptytext{}
+\def\pgfmanualvbarvbar{\char`\|\char`\|}
+
+\newenvironment{math-operator}[4][]{%
\begin{pgfmanualentry}
- \extractmathoperatorname{#1}
- \pgfmanualentryheadline{\texttt{#1}}%
- \index{\mathname @\protect\texttt{\mathname} math operator}%
- \index{Math operators!\mathname @\protect\texttt{\mathname}}
- \pgfmanualbody
-}
-{%
- \end{pgfmanualentry}\vskipspecial{-3em}
+ \csname math#3operator\endcsname{#2}{#4}
+ \def\mathtest{#4}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#3 operator)}
+ \else%
+ \def\mathtype{(#3 operator; uses the \texttt{#4} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2@\protect\texttt{#2} #3 math operator}%
+ \index{Math operators!#2@\protect\texttt{#2}}%
+ \fi%
+ \pgfmanualbody
}
+{\end{pgfmanualentry}}
-\newenvironment{math-constant}[1]{
+\newenvironment{math-operators}[5][]{%
\begin{pgfmanualentry}
- \pgfmanualentryheadline{\texttt{#1}}%
- \index{#1@\protect\texttt{#1} math constant}%
- \index{Math constants!#1@\protect\texttt{#1}}
- \pgfmanualbody
+ \csname math#4operator\endcsname{#2}{#3}
+ \def\mathtest{#5}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#4 operators)}
+ \else%
+ \def\mathtype{(#4 operators; use the \texttt{#5} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}%
+ \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}%
+ \fi%
+ \pgfmanualbody
}
-{
- \end{pgfmanualentry}\vskipspecial{-3em}
+{\end{pgfmanualentry}}
+
+\def\mathinfixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}%
+}
+
+\def\mathprefixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\texttt{#1}\mvar{x}}%
+}
+
+\def\mathpostfixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}
+ \def\mathexample{\mvar{x}\texttt{#1}}%
+}
+
+\def\mathgroupoperator#1#2{%
+ \def\mathoperator{\texttt{#1\ #2}}%
+ \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}%
+}
+
+\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator
+\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator
+
+\def\mathconditionaloperator#1#2{%
+ \def\mathoperator{#1\space#2}
+ \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}}
+}
+
+\newcommand\mathcommand[1][\mathdefaultname]{%
+ \expandafter\makemathcommand#1(\empty)\stop%
+ \expandafter\extractcommand\mathcommandname\@@%
+ \medskip
}
+\makeatletter
+
+\def\makemathcommand#1(#2)#3\stop{%
+ \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}%
+ \ifx#2\empty%
+ \else%
+ \@makemathcommand#2,\stop,
+ \fi}
+\def\@makemathcommand#1,{%
+ \ifx#1\stop%
+ \else%
+ \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}%
+ \expandafter\@makemathcommand%
+ \fi}
+\makeatother
+
\def\calcname{\textsc{calc}}
%% MW: END MATH MACROS
@@ -100,9 +201,12 @@
\def\extractcommand#1#2\@@{%
\pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}%
\removeats{#1}%
- \index{\strippedat @\protect\myprintocmmand{\strippedat}}}
+ \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
+% \begin{environment}{{name}\marg{arguments}}
\renewenvironment{environment}[1]{
\begin{pgfmanualentry}
\extractenvironement#1\@@
@@ -117,7 +221,9 @@
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
\pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}%
\index{#1@\protect\texttt{#1} environment}%
- \index{Environments!#1@\protect\texttt{#1}}}
+ \index{Environments!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
+}
\newenvironment{plainenvironment}[1]{
@@ -134,7 +240,8 @@
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
\pgfmanualentryheadline{{\ttfamily\declare{\char`\\end#1}}}%
\index{#1@\protect\texttt{#1} environment}%
- \index{Environments!#1@\protect\texttt{#1}}}
+ \index{Environments!#1@\protect\texttt{#1}}%
+}
\newenvironment{contextenvironment}[1]{
@@ -159,6 +266,19 @@
\pgfmanualentryheadline{Shape {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} shape}%
\index{Shapes!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{shading}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{Shading {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} shading}%
+ \index{Shadings!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -166,6 +286,18 @@
}
+\newenvironment{dataformat}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{Format {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} format}%
+ \index{Formats!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
\newenvironment{handler}[1]{
\begin{pgfmanualentry}
\extracthandler#1\@nil%
@@ -180,6 +312,7 @@
\pgfmanualentryheadline{Key handler \meta{key}{\ttfamily/\declare{#1}}#2}%
\index{\gobble#1@\protect\texttt{#1} handler}%
\index{Key handlers!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{/handlers/#1}%
}
@@ -196,7 +329,29 @@
\end{pgfmanualentry}
}
-
+\def\choicesep{$\vert$}%
+\def\choicearg#1{\texttt{#1}}
+
+\newif\iffirstchoice
+
+% \mchoice{choice1,choice2,choice3}
+\newcommand\mchoice[1]{%
+ \begingroup
+ \firstchoicetrue
+ \foreach \mchoice@ in {#1} {%
+ \iffirstchoice
+ \global\firstchoicefalse
+ \else
+ \choicesep
+ \fi
+ \choicearg{\mchoice@}%
+ }%
+ \endgroup
+}%
+
+% \begin{key}{/path/x=value}
+% \begin{key}{/path/x=value (initially XXX)}
+% \begin{key}{/path/x=value (default XXX)}
\newenvironment{key}[1]{
\begin{pgfmanualentry}
\def\extrakeytext{}
@@ -208,6 +363,49 @@
\end{pgfmanualentry}
}
+% \insertpathifneeded{a key}{/pgf} -> assign mykey={/pgf/a key}
+% \insertpathifneeded{/tikz/a key}{/pgf} -> assign mykey={/tikz/a key}
+%
+% #1: the key
+% #2: a default path (or empty)
+\def\insertpathifneeded#1#2{%
+ \def\insertpathifneeded@@{#2}%
+ \ifx\insertpathifneeded@@\empty
+ \def\mykey{#1}%
+ \else
+ \insertpathifneeded@#2\@nil
+ \ifpgfutil@in@
+ \def\mykey{#2/#1}%
+ \else
+ \def\mykey{#1}%
+ \fi
+ \fi
+}%
+\def\insertpathifneeded@#1#2\@nil{%
+ \def\insertpathifneeded@@{#1}%
+ \def\insertpathifneeded@@@{/}%
+ \ifx\insertpathifneeded@@\insertpathifneeded@@@
+ \pgfutil@in@true
+ \else
+ \pgfutil@in@false
+ \fi
+}%
+
+% \begin{keylist}[default path]
+% {/path/option 1=value,/path/option 2=value2}
+% \end{keylist}
+\newenvironment{keylist}[2][]{%
+ \begin{pgfmanualentry}
+ \def\extrakeytext{}%
+ \foreach \xx in {#2} {%
+ \expandafter\insertpathifneeded\expandafter{\xx}{#1}%
+ \expandafter\extractkey\mykey\@nil%
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+
\def\extractkey#1\@nil{%
\pgfutil@in@={#1}%
\ifpgfutil@in@%
@@ -263,7 +461,11 @@
\decompose#1/\nil%
}
-\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par}
+% Introduces a key alias '/#1/<name of current key>'
+% to be used inside of \begin{key} ... \end{key}
+\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par
+ \pgfmanualpdflabel{/#1/\myname}{}%
+}
\newif\iffirsttime
@@ -278,6 +480,13 @@
\def\myname{#1}%
\else%
\iffirsttime
+ \begingroup
+ % also make a pdf link anchor with full key path.
+ \def\hyperlabelwithoutslash##1/\nil{%
+ \pgfmanualpdflabel{##1}{}%
+ }%
+ \hyperlabelwithoutslash/#1/#2\nil
+ \endgroup
\def\mypath{#1@\protect\texttt{/#1/}!}%
\firsttimefalse
\else
@@ -288,12 +497,91 @@
\fi%
}
+\def\indexkey#1{%
+ \def\mypath{}%
+ \decompose#1/\nil%
+}
+
+\newenvironment{predefinedmethod}[1]{
+ \begin{pgfmanualentry}
+ \extractpredefinedmethod#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractpredefinedmethod#1(#2)\@nil{%
+ \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)}
+ \index{#1@\protect\texttt{#1} method}%
+ \index{Methods!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
+}
+
+
+\newenvironment{ooclass}[1]{
+ \begin{pgfmanualentry}
+ \def\currentclass{#1}
+ \pgfmanualentryheadline{Class \declare{\texttt{#1}}}
+ \index{#1@\protect\texttt{#1} class}%
+ \index{Class #1@Class \protect\texttt{#1}}%
+ \index{Classes!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{method}[1]{
+ \begin{pgfmanualentry}
+ \extractmethod#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractmethod#1(#2)\@nil{%
+ \def\test{#1}
+ \ifx\test\currentclass
+ \pgfmanualentryheadline{Constructor \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \else
+ \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \fi
+ \index{#1@\protect\texttt{#1} method}%
+ \index{Methods!#1@\protect\texttt{#1}}
+ \index{Class \currentclass!#1@\protect\texttt{#1}}%
+ \pgfmanualpdflabel{#1}{}%
+}
+
+\newenvironment{attribute}[1]{
+ \begin{pgfmanualentry}
+ \extractattribute#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractattribute#1=#2;\@nil{%
+ \def\test{#2}%
+ \ifx\test\@empty
+ \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially empty)}
+ \else
+ \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})}
+ \fi
+ \index{#1@\protect\texttt{#1} attribute}%
+ \index{Attributes!#1@\protect\texttt{#1}}
+ \index{Class \currentclass!#1@\protect\texttt{#1}}%
+ \pgfmanualpdflabel{#1}{}%
+}
+
+
\newenvironment{predefinednode}[1]{
\begin{pgfmanualentry}
\pgfmanualentryheadline{Predefined node {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} node}%
\index{Predefined node!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -305,6 +593,7 @@
\pgfmanualentryheadline{Coordinate system {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} coordinate system}%
\index{Coordinate systems!#1@\protect\texttt{#1}}
+ \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -345,6 +634,23 @@
\ifx\pgfmanualtest\@empty%
\index{#2@\protect\texttt{#2} path operation}%
\index{Path operations!#2@\protect\texttt{#2}}%
+ \pgfmanualpdflabel{#2}{}%
+ \fi%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\newenvironment{datavisualizationoperation}[3][]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\datavisualization}\
+ \ \dots}
+ \declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
+ \def\pgfmanualtest{#1}%
+ \ifx\pgfmanualtest\@empty%
+ \index{#2@\protect\texttt{#2} (data visualization)}%
+ \index{Data visualization!#2@\protect\texttt{#2}}%
+ \pgfmanualpdflabel{#2}{}%
\fi%
\pgfmanualbody
}
@@ -356,7 +662,9 @@
\def\extractcommand#1#2\@@{%
\pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}%
\removeats{#1}%
- \index{\strippedat @\protect\myprintocmmand{\strippedat}}}
+ \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
\def\doublebs{\texttt{\char`\\\char`\\}}
@@ -383,6 +691,7 @@
\index{Modules!#1@\protect\texttt{#1}}%
\pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}
\pgfmanualbody
+ \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -400,6 +709,7 @@
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space
\char`\%\space\space Con\TeX t\space when using \tikzname}}
\pgfmanualbody
+ \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -412,6 +722,7 @@
\index{Libraries!#1@\protect\texttt{#1}}%
\pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}
\pgfmanualbody
+ \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -454,6 +765,7 @@
\def\beamer{\textsc{beamer}}
\def\pdf{\textsc{pdf}}
+\def\eps{\texttt{eps}}
\def\pgfname{\textsc{pgf}}
\def\tikzname{Ti\emph{k}Z}
\def\pstricks{\textsc{pstricks}}
@@ -560,6 +872,28 @@
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
}
+\newcommand\symarrowdouble[1]{
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}
+ \texttt{#1}& yields thick
+ \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+ and thin
+ \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}, double
+ \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and
+ \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
\newcommand\sarrow[2]{
\index{#1@\protect\texttt{#1} arrow tip}%
@@ -577,6 +911,30 @@
\end{tikzpicture}
}
+\newcommand\sarrowdouble[2]{
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{#2@\protect\texttt{#2} arrow tip}%
+ \index{Arrow tips!#2@\protect\texttt{#2}}
+ \texttt{#1-#2}& yields thick
+ \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and thin
+ \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}, double
+ \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and
+ \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
+
\newcommand\carrow[1]{
\index{#1@\protect\texttt{#1} arrow tip}%
\index{Arrow tips!#1@\protect\texttt{#1}}
@@ -617,11 +975,16 @@
\catcode`\\=12 |gdef|find@example#1\end{codeexample}[|endofcodeexample[#1]]
|endgroup
+% define \returntospace.
+%
+% It should define NEWLINE as {}, spaces and tabs as \space.
\begingroup
\catcode`\^=7
\catcode`\^^M=13
+\catcode`\^^I=13
\catcode`\ =13%
-\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^M=13\def^^M{}}%
+\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^I=13\def^^I{\space}}
+\gdef\showreturn{\show^^M}
\endgroup
\begingroup
@@ -634,19 +997,86 @@
\gdef\@typeset@till@return#1^^M{{\def%{\char`\%}\textsl{\char`\%#1}}\par}
\endgroup
-\define@key{codeexample}{width}{\setlength\codeexamplewidth{#1}}
-\define@key{codeexample}{graphic}{\colorlet{graphicbackground}{#1}}
-\define@key{codeexample}{code}{\colorlet{codebackground}{#1}}
-\define@key{codeexample}{execute code}{\csname code@execute#1\endcsname}
-\define@key{codeexample}{code only}[]{\code@executefalse}
-\define@key{codeexample}{pre}{\def\code@pre{#1}}
-\define@key{codeexample}{post}{\def\code@post{#1}}
-\define@key{codeexample}{vbox}[]{\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}}
-\define@key{codeexample}{ignorespaces}[]{\let\@gobble@till@return=\@gobble@till@return@ignore}
-\define@key{codeexample}{leave comments}[]{\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax}
-
-\def\code@pre{}
-\def\code@post{}
+% Define tab-implementation functions
+% \codeexample@tabinit@replacementchars@
+% and
+% \codeexample@tabinit@catcode@
+%
+% They should ONLY be used in case that tab replacement is active.
+%
+% This here is merely a preparation step.
+%
+% Idea:
+% \codeexample@tabinit@catcode@ will make TAB active
+% and
+% \codeexample@tabinit@replacementchars@ will insert as many spaces as
+% /codeexample/tabsize contains.
+{
+\catcode`\^^I=13
+% ATTENTION: do NOT use tabs in these definitions!!
+\gdef\codeexample@tabinit@replacementchars@{%
+ \begingroup
+ \count0=\pgfkeysvalueof{/codeexample/tabsize}\relax
+ \toks0={}%
+ \loop
+ \ifnum\count0>0
+ \advance\count0 by-1
+ \toks0=\expandafter{\the\toks0\ }%
+ \repeat
+ \xdef\codeexample@tabinit@replacementchars@@{\the\toks0}%
+ \endgroup
+ \let^^I=\codeexample@tabinit@replacementchars@@
+}%
+\gdef\codeexample@tabinit@catcode@{\catcode`\^^I=13}%
+}%
+
+% Called after any options have been set. It assigns
+% \codeexample@tabinit@catcode
+% and
+% \codeexample@tabinit@replacementchars
+% which are used inside of
+%\begin{codeexample}
+% ...
+%\end{codeexample}
+%
+% \codeexample@tabinit@catcode is either \relax or it makes tab
+% active.
+%
+% \codeexample@tabinit@replacementchars is either \relax or it inserts
+% a proper replacement sequence for tabs (as many spaces as
+% configured)
+\def\codeexample@tabinit{%
+ \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax
+ \let\codeexample@tabinit@replacementchars=\relax
+ \let\codeexample@tabinit@catcode=\relax
+ \else
+ \let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@
+ \let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@
+ \fi
+}
+
+\pgfqkeys{/codeexample}{%
+ width/.code= {\setlength\codeexamplewidth{#1}},
+ graphic/.code= {\colorlet{graphicbackground}{#1}},
+ code/.code= {\colorlet{codebackground}{#1}},
+ execute code/.is if=code@execute,
+ code only/.code= {\code@executefalse},
+ pre/.store in=\code@pre,
+ post/.store in=\code@post,
+ % #1 is the *complete* environment contents as it shall be
+ % typeset. In particular, the catcodes are NOT the normal ones.
+ typeset listing/.code= {#1},
+ render instead/.store in=\code@render,
+ vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}},
+ ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore},
+ leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax},
+ tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT.
+ every codeexample/.style={width=4cm+7pt},
+}
+
+\let\code@pre\pgfutil@empty
+\let\code@post\pgfutil@empty
+\let\code@render\pgfutil@empty
\def\code@catcode@hook{}
\newdimen\codeexamplewidth
@@ -655,8 +1085,8 @@
\def\codeexample[#1]{%
\begingroup%
\code@executetrue
- \setlength\codeexamplewidth{4cm+7pt}
- \setkeys{codeexample}{#1}%
+ \pgfqkeys{/codeexample}{every codeexample,#1}%
+ \codeexample@tabinit% assigns \codeexample@tabinit@[catcode,replacementchars]
\parindent0pt
\begingroup%
\par%
@@ -668,21 +1098,28 @@
\catcode`\%=13%
\catcode`\^^M=13%
\code@catcode@hook%
+ \codeexample@tabinit@catcode
\relax%
\find@example}
\def\endofcodeexample#1{%
\endgroup%
\ifcode@execute%
\setbox\codeexamplebox=\hbox{%
+ \ifx\code@render\pgfutil@empty%
{%
{%
\returntospace%
\commenthandler%
\xdef\code@temp{#1}% removes returns and comments
}%
+ \catcode`\^^M=9%
\colorbox{graphicbackground}{\color{black}\ignorespaces%
\code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}%
}%
+ \else%
+ \colorbox{graphicbackground}{\color{black}\ignorespaces%
+ \code@render}%
+ \fi%
}%
\ifdim\wd\codeexamplebox>\codeexamplewidth%
\def\code@start{\par}%
@@ -725,6 +1162,7 @@
\frenchspacing\@vobeyspaces
\normalfont\ttfamily\footnotesize
\typesetcomment%
+ \codeexample@tabinit@replacementchars
\@tempswafalse
\def\par{%
\if@tempswa
@@ -735,7 +1173,8 @@
\fi}%
\obeylines
\everypar \expandafter{\the\everypar \unpenalty}%
- #1}
+ \pgfkeysvalueof{/codeexample/typeset listing/.@cmd}{#1}\pgfeov
+ }
\end{minipage}}%
\code@end%
\par%
@@ -748,6 +1187,18 @@
\makeatother
+\usepackage{pgfmanual}
+
+\makeatletter
+% \pgfautoxrefs will be defined by 'make dist'
+\pgfutil@ifundefined{pgfautoxrefs}{%
+ \def\pgfmanualpdflabel#1#2{#2}% NO-OP
+ \def\pgfmanualpdfref#1#2{#2}%
+ \pgfkeys{
+ /pdflinks/codeexample links=false,% DISABLED.
+ }%
+}{}
+\makeatother
%%% Local Variables:
%%% mode: latex
diff --git a/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf b/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf
index 1e115982b01..68d7e593a38 100644
--- a/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf
+++ b/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
index 95d941bd5db..77172602df0 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
@@ -254,9 +254,9 @@ command is described in Section~\ref{section-transparency}.
\subsubsection{Graphic Parameter: Arrows}
After a path has been drawn, \pgfname\ can add arrow tips at the
-ends. Currently, it will only add arrows correctly at the end of paths
-that consist of a single open part. For other paths, like closed paths
-or path consisting of multiple parts, the result is not defined.
+ends. It will only add arrows at the beginning of the first subpath
+and at the end of the last subpath. For closed paths the result is not
+defined, that is, it may change without notice in the future.
\begin{command}{\pgfsetarrowsstart\marg{arrow kind}}
Sets the arrow tip kind used at the start of a (possibly curved)
@@ -337,6 +337,84 @@ or path consisting of multiple parts, the result is not defined.
\end{command}
+\subsubsection{Inner Lines}
+
+When a path is stroked, it is possible to request that it is stroked
+twice, the second time with a different line width and a different
+color. This is a useful effect for creating ``double'' lines, for
+instance by setting the line width to 2pt and stroking a black line
+and then setting the inner line width to 1pt and stroking a white
+line on the same path as the original path. This results in what looks
+like two lines, each of thickness 0.5pt, spaces 1pt apart.
+
+You may wonder why there is direct support for this ``double
+stroking'' in the basic layer. After all, this effect is easy to
+achieve ``by hand''. The main reason is that arrow tips must be
+treated in a special manner when such ``double lines'' are
+present. First, the order of actions is important: First, the (thick)
+main line should be stroked, then the (thin) inner line, and only then
+should the arrow tip be drawn. Second, the way an arrow tip looks
+typically depends strongly on the width of the inner line, so the
+arrow tip code, which is part of the basic layer, needs access to the
+inner line thickness.
+
+Two commands are used to set the inner line width and color.
+
+\begin{command}{\pgfsetinnerlinewidth\marg{dimension}}
+ This command sets the width of the inner line. Whenever a path is
+ stroked (and only then), it will be stroked normally and, afterward,
+ it is stroked once more with the color set to the inner line color
+ and the line width set to \meta{dimension}.
+
+ In case arrow tips are added to a path, the path is first stroked
+ normally, then the inner line is stroked, and then the arrow tip is
+ added. In case the main path is shortened because of the added arrow
+ tip, this shortened path is double stroked, not the original path
+ (which is exactly what you want).
+
+ When the inner line width is set to 0pt, which is the default, no
+ inner line is stroked at all (not even a line of width 0pt). So, in
+ order to ``switch off'' double stroking, set \meta{dimension}
+ to~|0pt|.
+
+ The setting of the inner line width is local to the current \TeX\
+ group and \emph{not} to the current \pgfname\ scope.
+
+ Note that inner lines will \emph{not} be drawn for paths that are
+ also used for clipping. However, this may change in the future, so
+ you should not depend on this.
+
+\begin{codeexample}[]
+\begin{pgfpicture}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{1cm}{1cm}}
+ \pgfpathlineto{\pgfpoint{1cm}{0cm}}
+ \pgfsetlinewidth{2pt}
+ \pgfsetinnerlinewidth{1pt}
+ \pgfusepath{stroke}
+\end{pgfpicture}
+\end{codeexample}
+\end{command}
+
+
+\begin{command}{\pgfsetinnerstrokecolor\marg{color}}
+ This command sets the \meta{color} that is to be used when the inner
+ line is stroked. The effect of this command is also local to the
+ current \TeX\ group.
+
+\begin{codeexample}[]
+\begin{pgfpicture}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{1cm}{1cm}}
+ \pgfpathlineto{\pgfpoint{1cm}{0cm}}
+ \pgfsetlinewidth{2pt}
+ \pgfsetinnerlinewidth{1pt}
+ \pgfsetinnerstrokecolor{red!50}
+ \pgfusepath{stroke}
+\end{pgfpicture}
+\end{codeexample}
+\end{command}
+
\subsection{Filling a Path}
\label{section-fill}
@@ -419,7 +497,7 @@ When you add the |use as bounding box| option, the bounding box of the
picture will be enlarged such that the path in encompassed, but any
\emph{subsequent} paths of the current \TeX\ scope will not have any
effect on the size of the bounding box. Typically, you use this
-command at the very beginning of a |{pgfpicture}| environment.
+command at the very beginning of a |{pgfpicture}| environment. Alternatively, you can use |\pgfresetboundingbox|, followed by |\pgfusepath{use as bounding box}| to overrule the picture's bounding box completely.
\begin{codeexample}[]
Left
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
index 4f5033ec86a..aac739b9d1f 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
@@ -22,7 +22,7 @@ of lines. The interface works as follows:
\begin{enumerate}
\item
You (or someone else) assigns a name to a certain kind of arrow
- tips. For example, the
+ tips. For example, the
arrow tip |latex| is the arrow tip used by the standard \LaTeX\
picture environment; the arrow tip |to| looks like the tip of the
arrow in \TeX's |\to| command; and so on.
@@ -49,6 +49,7 @@ of lines. The interface works as follows:
In the above description, there are a number of ``appropriately.''
The exact details are not quite trivial and described later on.
+
\subsubsection{Meta-Arrow Tips}
In \pgfname, arrows are ``meta-arrows'' in the same way that fonts in
@@ -69,7 +70,7 @@ version scaled by a factor of two. Obviously, the first look
better. Now, compare ``\tikz{\node [scale=.5,inner sep=0pt,outer
sep=0pt]{Berlin};}'' and ``{\tiny Berlin}''. This time, the normal
text was scaled down, while the second text is a ``normal'' tiny
-text. The second text is easier to read.
+text. The second text is easier to read.
\pgfname's meta-arrows work in a similar fashion: The shape of an
arrow tip can vary according to the line width of the arrow tip is
@@ -96,7 +97,7 @@ drawn by \pgfname\ at four different sizes:
\medskip
Here, by comparison, is the same arrow when it is simply ``resized''
-(as done by most programs):
+(as done by some programs):
\pgfarrowsdeclare{bad latex}{bad latex}
{
@@ -156,6 +157,11 @@ Here, by comparison, is the same arrow when it is simply ``resized''
As can be seen, simple scaling produces arrow tips that are way too
large at larger sizes and way too small at smaller sizes.
+In addition to the line width, other options may also influence the
+appearance of an arrow tip. In particular, the width of the inner line
+(the line used to create the effect of a double line) influences arrow
+tips as well as other options that are specific to the arrow tip.
+
\subsection{Declaring an Arrow Tip Kind}
@@ -259,8 +265,8 @@ used:
\item
The code will be executed only once, namely the first time the
arrow tip needs to be drawn. The resulting low-level driver
- commands are protocoled and stored away. In all subsequent
- uses of the arrow tip, the protocoled code is directly inserted.
+ commands are protocolled and stored away. In all subsequent
+ uses of the arrow tip, the protocolled code is directly inserted.
\item
However, the code will be executed anew for each line width. Thus,
an arrow of line width 2pt may result in a different protocol than
@@ -287,7 +293,7 @@ used:
larger. However, the size of the arrow typically \emph{should not}
grow in direct proportion to the line width. On the other hand, the
size of the arrow head typically \emph{should} grow ``a bit'' with
- the line width.
+ the line width.
For these reasons, \pgfname\ will not simply executed your arrow
code within a scaled scope, where the scaling depends on the line
@@ -297,7 +303,7 @@ used:
In our example, we could use the following code for the new arrow
tip kind |arc'| (note the prime):
\begin{codeexample}[code only]
-\newdimen\arrowsize
+\newdimen\arrowsize
\pgfarrowsdeclare{arcs'}{arcs'}{...}
{
\arrowsize=0.2pt
@@ -311,7 +317,7 @@ used:
\pgfusepathqstroke
}
\end{codeexample}
-\newdimen\arrowsize
+\newdimen\arrowsize
\pgfarrowsdeclare{arcs'}{arcs'}{\pgfarrowsleftextend{0pt}\pgfarrowsrightextend{0pt}}
{
\arrowsize=0.2pt
@@ -333,7 +339,7 @@ used:
\useasboundingbox (-2,-1.75) rectangle (0,0.5);
\end{tikzpicture}
\end{codeexample}
-
+
However, sometimes, it can also be useful to have arrows that do not
resize at all when the line width changes. This can be achieved by
giving absolute size coordinates in the code, as done for |arc|. On
@@ -341,6 +347,7 @@ used:
line width by specifying all coordinates as multiples of
|\pgflinewidth|.
+ \medskip
\textbf{The left and right extend.}
Let us have another look at the exact left and right ``ends'' of our
arrow tip. Let us draw the arrow tip |arc'| at a very large size:
@@ -384,13 +391,13 @@ used:
\coordinate (xline 1) at (0,1.5);
\coordinate (xline 2) at (0,2.8);
-
- \draw[|->|] (xline 1 -| a) -- node[above=2pt] {right extend} (xline 1 -| b);
+
+ \draw[|->|] (xline 1 -| a) -- node[above=2pt] {right extend} (xline 1 -| b);
\draw[|<-|] (xline 2 -| c) -- node[above=2pt] {left extend} (xline 2 -| a);
\draw (0,0) -- (1,-1) node[below right] {origin};
\end{tikzpicture}
-
+
The \meta{extend code} is normal \TeX\ code that is executed
whenever \pgfname\ wants to know how far the arrow tip will protrude
@@ -398,7 +405,7 @@ used:
commands: \declare{|\pgfarrowsrightextend|} and
\declare{|\pgfarrowsleftextend|}. Both arguments take one argument
that specifies the size. Here is the final code for the |arc''| arrow
- tip:
+ tip:
\begin{codeexample}[]
\pgfarrowsdeclare{arcs''}{arcs''}
{
@@ -426,6 +433,104 @@ used:
\draw[line width=2pt,white] (-2,0) -- (0,0);
\end{tikzpicture}
\end{codeexample}
+
+ \medskip
+ \textbf{Taking inner lines into account.}
+ In addition to the line width, there is another parameter that (may)
+ influence the way an arrow looks: The inner line width, which is the
+ line width of the second line that is stroked on top of a normal
+ line in order to create the effect of a ``double'' line. When this
+ line width changes, the arrow tip code is also reexecuted (and
+ cached), so your code may depend on the current value of the inner
+ line width.
+
+ The following example shows how this works. The |implies| arrow
+ defined below has to setup the line width not for the ``main'' line
+ width, but for the main line width minus the inner line width,
+ divided by~2.
+\begin{codeexample}[code only]
+\pgfarrowsdeclare{implies}{implies}{...}
+{
+ \pgfmathsetlength{\pgfutil@tempdimb}{.5\pgflinewidth-.5*\pgfinnerlinewidth}%
+ \pgfsetlinewidth{\pgfutil@tempdimb}
+ \pgfsetdash{}{0pt}
+ \pgfsetroundcap
+ \pgfsetroundjoin
+ \pgfmathsetlength{\pgfutil@tempdima}{.25\pgflinewidth+.25*\pgfinnerlinewidth}%
+ \pgfpathmoveto {\pgfpoint{-1.4\pgfutil@tempdima}{2.65\pgfutil@tempdima}}
+ \pgfpathcurveto{\pgfpoint{-0.75\pgfutil@tempdima}{1.25\pgfutil@tempdima}}
+ {\pgfpoint{1\pgfutil@tempdima}{0.05\pgfutil@tempdima}}
+ {\pgfpoint{2\pgfutil@tempdima}{0pt}}
+ \pgfpathcurveto{\pgfpoint{1\pgfutil@tempdima}{-0.05\pgfutil@tempdima}}
+ {\pgfpoint{-.75\pgfutil@tempdima}{-1.25\pgfutil@tempdima}}
+ {\pgfpoint{-1.4\pgfutil@tempdima}{-2.65\pgfutil@tempdima}}
+ \pgfusepathqstroke
+}
+\end{codeexample}
+ Here is the effect for different combinations of line width and
+ inner line width:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \foreach \linewidth in {2,2.4,...,4.4}
+ \foreach \innerlinewidth in {0.4,0.8,...,1.8}
+ {
+ \pgfsetlinewidth{\linewidth pt}
+ \pgfsetinnerlinewidth{\innerlinewidth pt}
+ \draw [-implies] (\innerlinewidth*50pt,\linewidth*40pt) -- ++(4mm,0);
+ }
+\end{tikzpicture}
+\end{codeexample}
+
+ \medskip
+ \textbf{Arrow options.}
+ You may wish to have further option influence the appearance of an
+ arrow tip. For instance, for a ``pointed'' arrow you may wish to set
+ the opening angle of the tip. Then, whenever this option changes
+ that arrow tip code also needs to be reexecuted, even though the
+ line width has stayed the same.
+
+ You can use the commands |\pgfsetarrowoptions| and
+ |\pgfgetarrowoptions| to set such options for an arrow tip. Whenever
+ an arrow tip needs to be rendered, it is checked whether the arrow
+ tip code has already been executed for the current (expanded) value of the
+ options. If so, the cached code is used; otherwise the code is
+ executed once more. Naturally, inside the code the current value of
+ the arrow options should be taken into account.
+
+ Arrow options can and must be specified individually for each arrow
+ type.
+
+ In the following example, we make the arc angle an option.
+\begin{codeexample}[]
+\pgfarrowsdeclare{var arc}{var arc} % options is an angle
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth}
+ \pgfarrowsrightextend{.5\pgflinewidth}
+}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfsetdash{}{0pt} % do not dash
+ \pgfsetroundjoin % fix join
+ \pgfsetroundcap % fix cap
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharc{-90}{-180+\pgfgetarrowoptions{var arc}}{4\arrowsize}
+ \pgfusepathqstroke
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharc{90}{180-\pgfgetarrowoptions{var arc}}{4\arrowsize}
+ \pgfusepathqstroke
+}
+\begin{tikzpicture}
+ \draw[help lines] (-2,-4) grid (1,4);
+ \foreach \option in {-60,-50,...,60}
+ {
+ \pgfsetarrowoptions{var arc}{\option}
+ \draw[ultra thick,-var arc] (-2,\option/15) -- (0,\option/15);
+ }
+\end{tikzpicture}
+\end{codeexample}
\end{command}
\pgfarrowsdeclare{arcs''}{arcs''}
@@ -449,6 +554,17 @@ used:
\pgfusepathqstroke
}
+\begin{command}{\pgfsetarrowoptions\marg{arrow tip}\marg{text}}
+ Sets the options for the \meta{arrow tip} to \meta{text}. The
+ default, before any call to this macro is made, is 0.
+\end{command}
+
+\begin{command}{\pgfgetarrowoptions\marg{arrow tip}}
+ This will expand to the current value of the options for the
+ \meta{arrow tip}.
+\end{command}
+
+
\subsection{Declaring a Derived Arrow Tip Kind}
@@ -480,7 +596,7 @@ set correctly.
This command creates a new arrow kind that is the ``reverse'' of an
existing arrow kind. The (automatically cerated) code of the new
arrow kind will contain a flip of the canvas and the meanings of the
- left and right extend will be reversed.
+ left and right extend will be reversed.
\begin{codeexample}[]
\pgfarrowsdeclarereversed{arcs reversed}{arcs reversed}{arcs''}{arcs''}%
@@ -557,7 +673,7 @@ set correctly.
\pgfusepath{stroke}
\useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
@@ -577,7 +693,7 @@ set correctly.
\pgfusepath{stroke}
\useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
@@ -603,7 +719,7 @@ stroking is done.
\pgfusepath{stroke}
\useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
\begin{command}{\pgfsetarrowsend\marg{start arrow kind}}
@@ -617,11 +733,11 @@ stroking is done.
\pgfusepath{stroke}
\useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
\emph{Warning:} If the compatibility mode is active (which is the
-default), there also exist old commands called |\pgfsetstartarrow| and
+default), there also exist old commands called |\pgfsetstartarrow| and
|\pgfsetendarrow|, which are incompatible with the meta-arrow
management.
@@ -638,7 +754,7 @@ management.
\pgfusepath{stroke}
\useasboundingbox (-0.25,-0.25) rectangle (3.75,2.25);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
@@ -660,7 +776,7 @@ The following arrow tip kinds are always defined:
\sarrow{latex reversed}{latex reversed} \\
\index{*vbar@\protect\texttt{\protect\myvbar} arrow tip}%
\index{Arrow tips!*vbar@\protect\texttt{\protect\myvbar}}
- \texttt{|-|}& yields thick
+ \texttt{|-|}& yields thick
\begin{tikzpicture}[arrows={|-|},thick]
\useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
\draw (0,0) -- (1,0);
@@ -674,7 +790,7 @@ The following arrow tip kinds are always defined:
For further arrow tips, see page~\pageref{section-library-arrows}.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
index 21ddb1f445c..ea145e8fb06 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
@@ -15,7 +15,7 @@
The commands for creating decorations are defined in this
module, so you need to load this module to use decorations. This
module is automatically loaded by the different decoration
- libraries.
+ libraries.
\end{pgfmodule}
@@ -24,7 +24,7 @@
Decorations are a general way of creating graphics by ``moving along''
a path and, while doing so, either drawing something or constructing a
new path. This could be as simple as extending a path with a
-``zigzagged'' line\ldots
+``zigzagged'' line\ldots
\begin{codeexample}[]
\tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)};
@@ -69,9 +69,9 @@ Decoration automata (and the closely related meta-decoration automata)
are a general concept for creating graphics ``along paths.'' For
straight lines, this idea was first proposed by Till Tantau in an
earlier version of \pgfname, the idea to extend this to arbitrary path
-was proposed and implemented by Mark Wibrow. Further versitility is
+was proposed and implemented by Mark Wibrow. Further versatility is
provided by ``meta-decorations''. These are automata that decorate a
-path with decorations.
+path with decorations.
In the present subsection the different ideas underlying decoration
automata are presented.
@@ -81,12 +81,12 @@ automata are presented.
\subsubsection{The Different Paths}
In order to prevent confusion with different types of path, such
-as those that are extended, those that are decorated and those that
+as those that are extended, those that are decorated and those that
are created, the following conventions will be used:
\begin{itemize}
-\item
- The \emph{preexisting} path refers to the current path in existence
+\item
+ The \emph{preexisting} path refers to the current path in existence
before a decoration environment. (Possibly this path has been
created by another decoration used earlier, but we will still call
this path the preexisting path also in this case.)
@@ -95,14 +95,14 @@ are created, the following conventions will be used:
decoration automaton moves along. The input path may consist of many
line and curve input segments (for example, a circle or an ellipse
consists of four curves). It is specified inside the decoration
- environment.
+ environment.
\item
- The \emph{output} path refers to the path that the decoration
+ The \emph{output} path refers to the path that the decoration
creates. Depending on the decoration, this path may or may not be
empty (a decoration can also choose to use side-effects instead of
producing an output path). The input path is always consumed by the
decoration automaton, that is, it is no longer available in any way
- after the decoration automaton has finished.
+ after the decoration automaton has finished.
\end{itemize}
The effect of a decoration environment is the following: The input
@@ -123,10 +123,10 @@ automaton progresses, the current path is constantly being extend by
the output path. This means that first time e |\pgfusepath| command is
used on a decoration, the preexisting path is part of the path this
command operates on; in subsequent calls only the part of the output
-path constructed since the last |\pgfusepath| command will be used.
+path constructed since the last |\pgfusepath| command will be used.
You can use this mechanism to stroke or fill different part of the
-output path in different colors, line widths, fills and shades; all
+output path in different colors, line widths, fills and shades; all
within the same decoration. Alternatively, a decoration can choose to
produce no output path at all: the |text| decoration simply typesets
text along a path.
@@ -135,20 +135,20 @@ text along a path.
\subsubsection{Segments and States}
The most common use a decoration is to ``repeat something along a
-path'' (for example, the |zigzag| decoration
+path'' (for example, the |zigzag| decoration
repeats \tikz\draw decorate[decoration=zigzag]
{(0,0)--(\pgfdecorationsegmentlength,0)}; along a path). However, it
not necessarily the case that only one thing be repeated: a decoration
can consist of different parts, or \emph{segments}, repeated in a
-particular order.
+particular order.
-When you declare a decoration, you provide a description
+When you declare a decoration, you provide a description
of how their different segments will be rendered. The description of
each segment should be given in a way as if the ``x-axis'' of the
segment is the tangent to the path at a particular point,
and that point is the origin of the segment.
Thus, for example, the segment of the |zigzag| decoration might be
-defined using the following code:
+defined using the following code:
\begin{codeexample}[code only]
\pgfpathlineto{\pgfpoint{5pt}{5pt}}
\pgfpathlineto{\pgfpoint{15pt}{-5pt}}
@@ -171,7 +171,7 @@ The width of a segment can (and must) be specified
explicitly. \pgfname\ will use this width to find out the start point
of the next segment and the correct rotation. The width the you
provide need not be the ``real'' width of the segment, which allows
-decoration segments to overlap or to be spaced far apart.
+decoration segments to overlap or to be spaced far apart.
The |zigzag| decoration only has one segment that is repeated again and
again. However, we might also like to have \emph{different} segments
@@ -180,12 +180,12 @@ example, we might have special segments at the start and at the end.
Decorations use a mechanism known in theoretical in computer science
as \emph{finite state automata} to describe which segment is used at a
-particular point. The idea is the following: For the first segment we
+particular point. The idea is the following: For the first segment we
start in a special \emph{state} called the \emph{initial state}. In
this state, and also in all other state later, \pgfname\ first
computes how much space is left on the input path. That is, \pgfname\ keeps
-track of the distance to the end of the input path. Attached to each state
-there is a set of rules of the following form: ``If the remaining
+track of the distance to the end of the input path. Attached to each state
+there is a set of rules of the following form: ``If the remaining
distance on the input path is less than $x$, switch to state~$q$.''
\pgfname\ checks for each of these rules whether it applies and, if
so, immediately switches to state~$q$.
@@ -224,10 +224,10 @@ this command describes the decoration automaton.
will ``travel along the path,'' each time being moved along by a
certain distance. This will also work if the path is not a straight
line. That is, it is permissible that the path curves are veers at a
- sharp angle. It is also permissible that while travelling along the
+ sharp angle. It is also permissible that while traveling along the
input path the current input segment ends and a new input segment starts. In this
case, the remaining distance on the first input segment is subtracted
- from the \meta{dimension} and then we travelled along the second
+ from the \meta{dimension} and then we traveled along the second
input segment for the remaining distance. This input segment may also end
early, in which case we travel along the next input segment, and so
on. Note that it cannot happen that we travel past the end of the
@@ -246,12 +246,12 @@ this command describes the decoration automaton.
\begin{command}{\state\marg{name}\oarg{options}\marg{code}}
This command declares a new state inside the current decoration
automaton. The state is named \meta{name}.
-
+
When the decoration automaton is in state \meta{name}, the following things
happen:
\begin{enumerate}
\item
- The \meta{options} are parsed. This may lead, see below, to a
+ The \meta{options} are parsed. This may lead, see below, to a
state switch. When this happens, the following steps are not
executed. The \meta{options} are executed one after the other in
the given order. If an option causes a state switch, the switch
@@ -261,11 +261,11 @@ this command describes the decoration automaton.
The \meta{code} is executed in a \TeX-group with the current
transformation matrix setup in such a way that the origin is on
the input path at the current point (the point at the distance
- travelled up to now) and the coordinate system is rotated in
+ traveled up to now) and the coordinate system is rotated in
such a way that the positive $x$-axis points in the direction of
the tangent to the input path at the current point, while the
positive $y$-axis points to the left of this tangent.
-
+
As described earlier, the \meta{code} can have two different
effects: If it just contains path construction commands, the
decoration will produce an output path, which is extends the
@@ -300,7 +300,7 @@ this command describes the decoration automaton.
output path for the first invocation and the different parts of
the rest of the output path for the following invocation. Here is
an example:
-
+
\begin{codeexample}[]
\pgfdeclaredecoration{stars}{initial}{
\state{initial}[width=15pt]
@@ -316,7 +316,7 @@ this command describes the decoration automaton.
}
}
\tikz\path[decorate, decoration=stars, star point ratio=2, star points=5,
- inner sep=0, minimum size=rnd*10pt+2pt]
+ inner sep=0, minimum size=rnd*10pt+2pt]
(0,0) .. controls (0,2) and (3,2) .. (3,0)
.. controls (3,-3) and (0,0) .. (0,-3)
.. controls (0,-5) and (3,-5) .. (3,-3);
@@ -362,13 +362,13 @@ this command describes the decoration automaton.
state switches occur, the \meta{code} is executed and the
repetition counter is decreased. Then, there is once more a
chance of a state change caused by any of the \meta{options}. If
- no repetition occurs, the \meta{code} is executed
+ no repetition occurs, the \meta{code} is executed
once more and the counter is decreased once more. When the
counter reaches zero, the \meta{code} is executed once more,
but, then, a different state is entered, as specified by the
|next state| option.
- Note, that the maximum number of times the state will be executed
+ Note, that the maximum number of times the state will be executed
is $\meta{repetitions}+1$.
\end{key}
\begin{key}{/pgf/decoration automaton/next state=\meta{new state}}
@@ -388,7 +388,7 @@ this command describes the decoration automaton.
\begin{key}{/pgf/decoration automaton/auto end on length=\meta{dimension}}
This key is just included for convenience, it does nothing that
cannot be achieved using the previous options. The effect is the
- following: If the remaingin input path's length is at most
+ following: If the remaining input path's length is at most
\meta{dimension}, the decorated path is ended with a straight
line to the end of the input path and, possibly, it is closed,
namely if the input path ended with a closepath
@@ -419,7 +419,7 @@ this command describes the decoration automaton.
transformational \TeX-group of the current segment,
so that these results of these computations are available in the
next state. For this, the following two options are useful:
-
+
\begin{key}{/pgf/decoration automaton/persistent precomputation=\meta{precode}}
If the \meta{code} of state is executed, the \meta{precode} is
executed first and it executed outside the \TeX-group of the
@@ -432,40 +432,40 @@ this command describes the decoration automaton.
\meta{postcode} is executed after (and also outside) the
\TeX-group of the main \meta{code}.
\end{key}
-
+
There are a number of macros and dimensions which may be useful
inside a decoration automaton. The following macros are available:
-
+
\begin{command}{\pgfdecoratedpathlength}
The length of the input path. If the input path consists of
several input segments, this number is the sum of the lengths of the
- input segments.
+ input segments.
\end{command}
-
+
\begin{command}{\pgfdecoratedinputsegmentlength}
The length of the current input segment of the input path. ``Current
input segment'' refers to the input segment on which the current point
- lies.
+ lies.
\end{command}
\begin{command}{\pgfpointdecoratedpathlast}
The final point of the input path.
\end{command}
-
+
\begin{command}{\pgfpointdecoratedinputsegmentlast}
The final point of the current input segment of the input path.
\end{command}
\begin{command}{\pgfdecoratedangle}
The angle of the tangent to the decorated path at the \emph{origin}
- of the current segment. The transformation matrix applied at
- the beginning of a state includes a rotation equivalent to
+ of the current segment. The transformation matrix applied at
+ the beginning of a state includes a rotation equivalent to
this angle.
\end{command}
- The following \TeX\ dimension registers are also available inside the
+ The following \TeX\ dimension registers are also available inside the
automaton:
-
+
\begin{command}{\pgfdecoratedremainingdistance}
The remaining distance on the input path.
\end{command}
@@ -473,25 +473,25 @@ this command describes the decoration automaton.
\begin{command}{\pgfdecoratedcompleteddistance}
The completed distance on the input path.
\end{command}
-
+
\begin{command}{\pgfdecoratedinputsegmentremainingdistance}
The remaining distance on the current input segment of the input path.
\end{command}
-
+
\begin{command}{\pgfdecoratedinputsegmentcompleteddistance}
The completed distance on the current input segment of the input path.
\end{command}
Further keys and macros are defined and used by the decoration
libraries, see Section~\ref{section-library-decorations}.
-
+
The following example shows how these options can be used:
\begin{codeexample}[]
\pgfdeclaredecoration{complicated example decoration}{initial}
{
\state{initial}[width=5pt,next state=up]
{ \pgfpathlineto{\pgfpoint{5pt}{0pt}} }
-
+
\state{up}[width=5pt,next state=down]
{
\ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance
@@ -504,7 +504,7 @@ this command describes the decoration automaton.
\pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
- \fi%
+ \fi%
}
\state{down}[width=5pt,next state=up]
{
@@ -518,7 +518,7 @@ this command describes the decoration automaton.
\pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedremainingdistance}}
\pgfpathlineto{\pgfpoint{5pt}{0pt}}
- \fi%
+ \fi%
}
\state{final}
{
@@ -548,21 +548,21 @@ decorations.
\subsection{Using Decorations}
-Once a decoration has been declared, it can be used.
+Once a decoration has been declared, it can be used.
\begin{environment}{{pgfdecoration}\marg{decoration list}}
The \meta{environment contents} should contain commands for creating
an path. This path is the basis for the \emph{input paths}
for the decorations in the \meta{decoration list}. In detail, the
- following happens:
+ following happens:
\begin{enumerate}
\item
The preexisting unused path is saved.
- \item
+ \item
The path commands specified in \meta{environment contents} are
executed and this resulting path is saved. The path is then
divided into different \emph{input paths} as follows:
- The format for each item in \marg{decoration list} is
+ The format for each item in \marg{decoration list} is
\begin{quote}
\marg{decoration}\marg{length}\opt{\marg{before code}\marg{after code}}
\end{quote}
@@ -590,35 +590,35 @@ Once a decoration has been declared, it can be used.
(and possibly using) the output paths. These output paths extend
(unless they are used) the current path.
\end{enumerate}
-
+
Some important points should be noted regarding the use of this
environment:
-
+
\begin{itemize}
\item
- If \meta{environment contents} does not begin with
- |\pgfpathmoveto|, he last known point on the preexisting path is
+ If \meta{environment contents} does not begin with
+ |\pgfpathmoveto|, he last known point on the preexisting path is
assumed as the starting point.
\item
- All except the last of any sequence of consecutive move-to commands
+ All except the last of any sequence of consecutive move-to commands
in \meta{environment contents} are discarded.
\item
- Any move-to commands at end of \meta{environment contents} are
+ Any move-to commands at end of \meta{environment contents} are
ignored.
\item
- Any close-path commands on the input path are interpreted as
+ Any close-path commands on the input path are interpreted as
straight lines.
- Internally somthing a little more complicated is going on,
- however, a closed path on the input path has no effect on the
- output path, other than causing the automaton to travel in a
- straight line towards the location of the last move-to command on
+ Internally something a little more complicated is going on,
+ however, a closed path on the input path has no effect on the
+ output path, other than causing the automaton to travel in a
+ straight line towards the location of the last move-to command on
the input path.
\item
Although tangent computations for the input path work with the
last point on the preexisting path, no automatic move-to
- operations are issued for the output path.
- If an output path commences with a line-to or curve-to when the
- existing path is empty, an appropriate move-to command should be
+ operations are issued for the output path.
+ If an output path commences with a line-to or curve-to when the
+ existing path is empty, an appropriate move-to command should be
inserted before the decoration commences.
\item
If a decoration uses its own path, the first time this happens the
@@ -628,8 +628,8 @@ Once a decoration has been declared, it can be used.
When the decoration automata ``work on'' their respective input
paths, before the automaton starts, \meta{before code} is
executed. After the decoration automaton has finished, \meta{after
- code} is executed.
-
+ code} is executed.
+
\begin{codeexample}[]
\begin{tikzpicture}[decoration={segment length=5pt}]
\draw [help lines] grid (3,2);
@@ -674,9 +674,9 @@ Once a decoration has been declared, it can be used.
Returns the point corresponding to the end of the current input
path.
\end{command}
- This means that if decorations do not use their own path, it is
- possible to do something with them and and continue from the
- correct place.
+ This means that if decorations do not use their own path, it is
+ possible to do something with them and continue from the
+ correct place.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -708,7 +708,7 @@ Once a decoration has been declared, it can be used.
\end{tikzpicture}
\end{codeexample}
- After the |{decoration}| environment has finished, the following
+ After the |{decoration}| environment has finished, the following
macros are available:
\begin{command}{\pgfdecorateexistingpath}
@@ -727,7 +727,7 @@ Once a decoration has been declared, it can be used.
\begin{command}{\pgfpointdecoratedpathlast}
The final point of the input path.
\end{command}
-
+
\begin{command}{\pgfpointdecorationpathlast}
The final point of the output path.
\end{command}
@@ -735,12 +735,12 @@ Once a decoration has been declared, it can be used.
The following style is executed each time a decoration is used. You
may use it to setup default options for decorations.
\begin{stylekey}{/pgf/every decoration (initially \normalfont empty)}
- This sytle is executed for every decoration.
+ This style is executed for every decoration.
\end{stylekey}
\end{environment}
\begin{plainenvironment}{{pgfdecoration}\marg{name}}
- The plain-\TeX{} version of the |{pgfdecorate}| environment.
+ The plain-\TeX{} version of the |{pgfdecorate}| environment. % TODOsp: `pgfdecorate' right or `pgfdecoration'? really no idea
\end{plainenvironment}
\begin{contextenvironment}{{pgfdecoration}\marg{name}}
@@ -758,7 +758,7 @@ environment).
\pgfdecorate{{name}{\pgfdecoratedpathlength}
{\pgfdecoratebeforecode}{\pgfdecorateaftercode}}
// the path commands.
-\endpgfdecorate
+\endpgfdecorate
\end{codeexample}
\end{command}
@@ -766,21 +766,21 @@ environment).
Decorate the preexisting path with the decoration \meta{name}.
\end{command}
-Both the above commands use the current definitons of the following
+Both the above commands use the current definitions of the following
macros:
\begin{command}{\pgfdecoratebeforecode}
Code executed as \meta{before code}, see the description of
- |\pgfdecorate|.
+ |\pgfdecorate|.
\end{command}
\begin{command}{\pgfdecorateaftercode}
Code executed as \meta{after code}, see the description of
- |\pgfdecorate|.
+ |\pgfdecorate|.
\end{command}
It may sometimes be useful to add an additional transformation
-for each segment of a decoration. The following command allows
+for each segment of a decoration. The following command allows
you to define such a ``last minute transformation.''
\begin{command}{\pgfsetdecorationsegmenttransformation\marg{code}}
@@ -817,11 +817,11 @@ you to define such a ``last minute transformation.''
\label{section-base-meta-decorations}
-A meta-decoration provides an alternative way to decorate a path with
-mutiple decorations. It is, in essence, an automaton that decorates
+A meta-decoration provides an alternative way to decorate a path with
+multiple decorations. It is, in essence, an automaton that decorates
an input path with decoration automatons. In general, however, the end
-effect is still that a path is decorated with other paths, and the input
-path should be thought of as being divided into sub-input-paths, each with
+effect is still that a path is decorated with other paths, and the input
+path should be thought of as being divided into sub-input-paths, each with
their own decoration. Like ordinary decorations, before a
meta-decoration can be used it must be declared.
@@ -833,105 +833,105 @@ meta-decoration can be used it must be declared.
\meta{states} argument contains a description of the meta-decoration
automaton's states and the transitions between them. The
\meta{initial state} is the state in which the automaton starts.
-
- The |\state| command is similar to the one found in
+
+ The |\state| command is similar to the one found in
decoration declarations, and takes the same form:
-
+
\begin{command}{\state\marg{name}\oarg{options}\marg{code}}
Declares the state \meta{name} inside the current meta-decoration
automaton. Unlike decorations, states in meta-decorations are not
executed within a group, which makes the persistent computation
options superfluous. Consider using an initial state with
|width=0pt| to do precalculations that could speed the execution
- of the meta-decoration.
-
+ of the meta-decoration.
+
The \meta{options} are executed with the key path set to
- |/pgf/meta-decorations automaton/|, and the following keys are defined for
- this path:
-
+ |/pgf/meta-decorations automaton/|, and the following keys are defined for
+ this path:
+
\begin{key}{/pgf/meta-decoration automaton/switch if less than=\meta{dimension}| to |\meta{new state}}
This causes \pgfname\ to check whether the
remaining distance to the end of the input path is less than
- \meta{dimension}, and, if so, to immediately switch to the state
- \meta{new state}. When this key is evaluated, the macro
- |\pgfmetadecoratedpathlength| will be defined as the total length of
+ \meta{dimension}, and, if so, to immediately switch to the state
+ \meta{new state}. When this key is evaluated, the macro
+ |\pgfmetadecoratedpathlength| will be defined as the total length of
the decoration path, allowing for values such as
|\pgfmetadecoratedpathlength/8|.
\end{key}
-
+
\begin{key}{/pgf/meta-decoration automaton/width=\meta{dimension}}
As always, this option will cause an immediate switch to the
state |final| if the remaining distance on the input path is less than
- \meta{dimension}.
+ \meta{dimension}.
Otherwise, this option tells \pgfname\ the width of the
``meta-segment'', that is, the length of the sub-input-path
which the decoration automaton specified in \meta{code} will decorate.
\end{key}
-
+
\begin{key}{/pgf/meta-decoration automaton/next state=\meta{new state}}
After the code for a state has been executed, a state switch to
\meta{new state} is performed. If this option is not given, the
next state is the same as the current state.
\end{key}
-
- The code in \meta{code} is quite different from the code in a
+
+ The code in \meta{code} is quite different from the code in a
decoration state. In almost all cases only the following three
- macros will be required:
-
+ macros will be required:
+
\begin{command}{\decoration\marg{name}}
This sets the decoration for the current state to \meta{name}.
If this command is omitted, the |moveto| decoration will be
used.
\end{command}
-
+
\begin{command}{\beforedecoration\marg{before code}}
Defines \marg{before code} as (typically) \pgfname{} commands to be
executed before the decoration is applied to the current segment.
This command can be omitted.
- If you wish to set up some decoration specific parameters
+ If you wish to set up some decoration specific parameters
such as segment length, or segment amplitude, then they
can be set in \meta{before code}.
\end{command}
-
+
\begin{command}{\afterdecoration\marg{after code}}
- Defines \marg{after code} as commands to be executed afer the
+ Defines \marg{after code} as commands to be executed after the
decoration has been applied to the current segment.
This command can be omitted.
\end{command}
-
- There are some macros that may be usedful when creating
+
+ There are some macros that may be useful when creating
meta-decorations (note that they are all macros):
-
+
\begin{command}{\pgfpointmetadecoratedpathfirst}
When the \meta{before code} is executed,
this macro stores the first point on the current
- sub-input-path.
+ sub-input-path.
\end{command}
\begin{command}{\pgfpointmetadecoratedpathlast}
When the \meta{after code} is executed,
this macro stores the last point on the current
- sub-input-path.
+ sub-input-path.
\end{command}
-
+
\begin{command}{\pgfmetadecoratedpathlength}
The entire length of the entire input path.
- \end{command}
-
+ \end{command}
+
\begin{command}{\pgfmetadecoratedcompleteddistance}
The completed distance on the entire input path.
\end{command}
-
+
\begin{command}{\pgfmetadecoratedremainingdistance}
The remaining distance on the entire input path.
\end{command}
-
+
\begin{command}{\pgfmetadecoratedinputsegmentcompleteddistance}
The completed distance on the current input segment of the entire
input path.
\end{command}
-
+
\begin{command}{\pgfmetadecoratedinputsegmentremainingdistance}
The remaining distance on the current input segment of the entire
input path.
@@ -951,12 +951,12 @@ meta-decoration can be used it must be declared.
}
\state{arrow}[
switch if less than=\pgfmetadecorationsegmentlength to final,
- width=\pgfmetadecorationsegmentlength/3,
+ width=\pgfmetadecorationsegmentlength/3,
next state=zigzag]
{
\decoration{curveto}
\beforedecoration
- {
+ {
\pgfmathparse{\pgfmetadecoratedcompleteddistance*\factor}
\pgfsetcolor{red!\pgfmathresult!yellow}
\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}
@@ -975,7 +975,7 @@ meta-decoration can be used it must be declared.
\pgfsetarrowsend{to}
\pgfusepath{stroke}
}
- }
+ }
\state{move}[width=\pgfmetadecorationsegmentlength/2, next state=arrow]{}
\state{final}{}
}
@@ -1001,7 +1001,7 @@ Using meta-decorations is ``simpler'' than using decorations, because
you can only use one meta-decoration per path.
\begin{environment}{{pgfmetadecoration}\marg{name}}
- This environment decorates the input path described in
+ This environment decorates the input path described in
\meta{environment contents}, with the meta-decoration \meta{name}.
\end{environment}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
index 742e9bd8d7b..fc4606b0848 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
@@ -123,7 +123,9 @@ As we see in Figure~\ref{fig1}, the world is flat.
\item A more complex situation arises when a graphic file named
\meta{file name prefix}|.|\meta{suffix} \emph{does} exist. In
this case, this graphic file is included using the
- |\includegraphics| command. Furthermore, the text between
+ |\includegraphics| command%
+ \footnote{Actually, the command key \texttt{/pgf/images/include external} is invoked which calls an appropriate \texttt{\textbackslash includegraphics} command.}.
+ Furthermore, the text between
|\beginpgfgraphicnamed| and |\endpgfgraphicnamed| is ignored.
When the text is ``ignored,'' what actually happens is that all
@@ -266,11 +268,37 @@ way: You input the file |pgfexternal.tex|.
in your main file.
\end{filedescription}
-As a final remark, note that the |baseline| option does not work
-together with pictures written to an external graphic file. The simple
-reason is that there is no way to store this baseline information is
-an external graphic file.
+As a final remark, note that the |baseline| option does not work directly
+with pictures written to an external graphic file. The simple
+reason is that there is no way to store this baseline information in
+an external graphic file. To allow the |baseline| option (or any \TeX\ construction
+with non-zero depth), the baseline information is stored into a separate file.
+This file is named \marg{image file}|.dpth| and contains something like |5pt|.
+
+So, if you need baseline information, you will have to keep the external graphic file
+together with its~|.dpth| file. Furthermore, the short command in |\input pgfexternal.tex|
+is no longer enough because it ignores any baseline information. You will need to use
+|\input pgfexternalwithdepth.tex| instead (it is shown below). It is slightly longer,
+but it can be used in the same way as |pgfexternal.tex|.
+
+\begin{key}{/pgf/images/include external (initially \textbackslash pgfimage\{\#1\})}
+\label{pgf:includeexternalkey}
+\index{External Graphics!Bounding Box Issues}
+ This key constitutes the public interface to exchange the |\includegraphics| command used for the image inclusion.
+
+ Redefining this key allows to provide bounding box or viewport options:
+\begin{codeexample}[code only]
+\pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}}
+\end{codeexample}
+ Do not forget the |.code| here which redefines the command.
+
+ One application could be image externalization and bounding box restrictions:
+ As far as I know, a |.pdf| graphics with restricted bounding box
+ is always cropped (which is not always desired). One solution could be to use |latex| and |dvips|
+ which doesn't have this restriction. Another is to manually provide the |viewport| option as shown above.
+ A possible value for |viewport| can be found in the |.pdf| image, search for |/MediaBox = [ ... ]|.
+\end{key}
\subsection{A Complete Example}
@@ -415,7 +443,7 @@ Output written on survey.pdf (1 page, 10006 bytes).
Transcript written on survey.log.
\end{codeexample}
-To our editor, we send the following files:
+ To our editor, we send the following files:
\begin{itemize}
\item The last |survey.tex| shown above.
\item The graphic file |survey-f1.pdf|.
@@ -427,6 +455,23 @@ To our editor, we send the following files:
(Alternatively, we can also directly add this line to our
|survey.tex| file).
\end{itemize}
+In case we have used the |baseline| option, we also need to include any |.dpth| files and we need to use the file |pgfexternalwithdepth.tex| instead of |pgfexternal.tex|. This file also checks for the existence of |.dpth| files containing baseline information, its contents is
+\begin{codeexample}[code only]
+\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{%
+ \begingroup
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \openin1=#1.dpth
+ \ifeof1 \box1
+ \else
+ \read1 to\pgfincludeexternalgraphicsdp\closein1
+ \dimen0=\pgfincludeexternalgraphicsdp\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
+}
+\end{codeexample}
+Again, we could simply copy these lines to our |survey.tex| file.
+
%%% Local Variables:
%%% mode: latex
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
index b60a49c091d..2267999f3df 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
@@ -35,7 +35,7 @@ inclusion facilities of \pgfname:
package. Thus, in plain \TeX, this does not really help. It might be
a good idea to fix this in the future such that \pgfname\ becomes
independent of \LaTeX, thereby providing a uniform image abstraction
- for all formats.
+ for all formats.
\item
You wish to use masking. This is a feature that is only supported by
\pgfname, though I hope that someone will implement this also for
@@ -62,7 +62,7 @@ option:
In draft mode boxes showing the image name replace the
images. It is checked whether the image files exist, but they are
not read. If either height or width is not given, 1cm is used
- instead.
+ instead.
\end{packageoption}
\subsection{Declaring an Image}
@@ -73,7 +73,7 @@ option:
use |\pgfuseimage{|\meta{image name}|}|. The \meta{filename} may not
have an extension. For \textsc{pdf}, the extensions |.pdf|, |.jpg|,
and |.png| will automatically tried. For PostScript, the extensions
- |.eps|, |.epsi|, and |.ps| will be tried.
+ |.eps|, |.epsi|, and |.ps| will be tried.
The following options are possible:
\begin{itemize}
@@ -97,7 +97,7 @@ option:
\meta{filename}|.|\meta{extension} and if a recent version of
|pdflatex| is used, only the selected page is inserted. For older
versions of |pdflatex| and for |dvips| the complete document is
- inserted and a warning is printed.
+ inserted and a warning is printed.
\item
\declare{|interpolate=|\meta{true or false}} selects whether the
image should ``smoothed'' when zoomed. False by default.
@@ -105,7 +105,7 @@ option:
\declare{|mask=|\meta{mask name}} selects a transparency mask. The
mask must previously be declared using |\pgfdeclaremask| (see
below). This option only has an effect for |pdf|. Not all viewers
- support masking.
+ support masking.
\end{itemize}
\begin{codeexample}[code only]
@@ -145,7 +145,7 @@ option:
original image is used.
The |xxcolor| package sets the alternate extension to the current
- color mixin.
+ color mixin. % TODOsp: `color mixin': meant `color mixing' or the `colormixin' environment?
\begin{codeexample}[]
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
@@ -165,7 +165,7 @@ option:
\end{codeexample}
The following example demonstrates the effect of using
- |\pgfuseimage| inside a color mixin environment.
+ |\pgfuseimage| inside a colormixin environment.
\begin{codeexample}[]
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
@@ -201,7 +201,7 @@ option:
Declares the image under the name |pgflastimage| and
immediately uses it. You can ``save'' the image for later usage by
invoking |\pgfaliasimage| on |pgflastimage|.
-
+
\begin{codeexample}[]
\begin{colormixin}{25!white}
\begin{pgfpicture}
@@ -271,7 +271,7 @@ color(14cm)=(green)}
\end{codeexample}
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex
new file mode 100644
index 00000000000..ec5d715f168
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex
@@ -0,0 +1,92 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Adding libraries to \pgfname: temporary registers}
+
+\label{section-internal-registers}
+
+This section is intended for those who like to write libraries to extend \pgfname. Of course, this requires a good deal of knowledge about \TeX-programming and the structure of the \pgfname\ basic layer. Besides, one will encounter the need of temporary variables and, especially, temporary \TeX\ registers. This section describes how to use a set of pre-allocated temporary registers of the basic layer without needing to allocate more of them.
+
+A part of these internals are already mentioned in section~\ref{section-internal-pointcmds}, but the basic layer provides more temporaries than |\pgf@x| and |\pgf@y|.
+
+\begin{internallist}[dimen register]{\pgf@x,\pgf@y}
+ These registers are used to process point coordinates in the basic layer of \pgfname, see section~\ref{section-internal-pointcmds}. After a |\pgfpoint|$\dotsc$ command, they contain the final $x$ and $y$ coordinate, respectively.
+
+ The values of |\pgf@x| and |\pgf@y| are set \emph{globally} in contrast to other available \pgfname\ registers. You should never assume anything about their value unless the context defines them explicitly.
+
+
+ Please prefer the |\pgf@xa|, |\pgf@xb|, $\dotsc$ registers for temporary dimen registers unless you are writing point coordinate commands.
+\end{internallist}
+
+\begin{internallist}[dimen register]{
+ \pgf@xa,
+ \pgf@xb,
+ \pgf@xc,
+ \pgf@ya,
+ \pgf@yb,
+ \pgf@yc}
+ Temporary registers for \TeX\ dimensions which can be modified freely. Just make sure changes occur only within \TeX\ groups.
+
+ \paragraph{Attention:}
+ \pgfname\ uses these registers to perform path operations. For reasons of efficiency, path commands do not always guard them. As a consequence, the code
+\begin{codeexample}[code only]
+\pgfpointadd{\pgfpoint{\pgf@xa}{\pgf@ya}}{\pgfpoint{\pgf@xb}{\pgf@yb}}
+\end{codeexample}
+\noindent
+may fail: Inside |\pgfpointadd|, the |\pgf@xa| and friend registers might be
+modified. In particular, it might happen that |\pgf@xb| is changed
+before |\pgfpoint{\pgf@xb}{\pgf@yb}| is evaluated. The right thing to do
+would be to first expand everything using |\edef| and process the values afterwards,
+resulting in unnecessary expensive operations. Of course, one can avoid this by simply
+looking into the source code of |\pgfpointadd| to see which registers are used.
+\end{internallist}
+
+\begin{internallist}[dimen register]{\pgfutil@tempdima,\pgfutil@tempdimb}
+ Further multi-purpose temporary dimen registers. For \LaTeX, these registers are already allocated as |\@tempdima| and |\@tempdimb| and are simply |\let| to the |\pgfutil@|$\dotsc$ names.
+\end{internallist}
+
+\begin{internallist}[count register]{
+ \c@pgf@counta,
+ \c@pgf@countb,
+ \c@pgf@countc,
+ \c@pgf@countd}
+ These multiple-purpose count registers are used throughout \pgfname\ to perform integer computations. Feel free to use them as well, just make sure changes are scoped by local \TeX\ groups.
+\end{internallist}
+
+\begin{internallist}[openout handle]{\w@pgf@writea}
+ An |\openout| handle which is used to generate complete output files within locally scoped parts of \pgfname\ (for example, to interact with |gnuplot|). You should always use |\immediate| in front of output operations involving |\w@pgf@writea| and you should always close the file before returning from your code.
+\begin{codeexample}[code only]
+\immediate\openout\w@pgf@writea=myfile.dat
+\immediate\write\w@pgf@writea{...}%
+\immediate\write\w@pgf@writea{...}%
+\immediate\closeout\w@pgf@writea%
+\end{codeexample}
+\end{internallist}
+
+\begin{internallist}[openin handle]{\r@pgf@reada}
+ An |\openin| handle which is used to read files within locally scoped parts of \pgfname, for example to check if a file exists or to read data files. You should always use |\immediate| in front of output operations involving |\w@pgf@writea| and you should always close the file before returning from your code.
+\begin{codeexample}[code only]
+\immediate\openin\r@pgf@reada=myfile.dat
+% do something with \macro
+\ifeof\r@pgf@reada
+ % end of file or it doesn't exist
+\else
+ % loop or whatever
+ \immediate\read\r@pgf@reada to\macro
+ ...
+\fi
+\immediate\closein\r@pgf@reada
+\end{codeexample}
+\end{internallist}
+
+\begin{internallist}[box]{\pgfutil@tempboxa}
+ A box for temporary use inside of local \TeX\ scopes. For \LaTeX, this box is the same as the already pre-allocated |\@tempboxa|.
+\end{internallist}
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
index 201fe734c2c..d77f1312123 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
@@ -18,7 +18,7 @@
\subsection{Overview}
-Matrices are a mechanism for aligning several so-called cell pictures
+Matrices are a mechanism for aligning several so-called cell pictures
horizontally and vertically. The resulting alignment is placed in a
normal node and the command for creating matrices, |\pgfmatrix|, takes
options very similar to the |\pgfnode| command.
@@ -36,7 +36,7 @@ the special command |\pgfmatrixnextcell|, rows are ended using the
command |\pgfmatrixendrow| (the command |\\| is setup to mean the same
as |\pgfmatrixendrow| by default). Each cell contains a \emph{cell
picture}, although cell pictures are not complete pictures as they
-lack layers. However, each cell picture has its own bouding box like a
+lack layers. However, each cell picture has its own bounding box like a
normal picture does. These bounding boxes are important for the
alignment as explained in the following.
@@ -96,7 +96,7 @@ All matrices are typeset using the following command:
path(s) of the resulting node are stroked or filled or whatever.
\medskip
- \textbf{Specifiying the cells and rows.\ }
+ \textbf{Specifying the cells and rows.\ }
Even though this command uses |\halign| internally, there are two
special rules for indicating cells:
\begin{enumerate}
@@ -112,12 +112,12 @@ All matrices are typeset using the following command:
like |{minipage}| redefine |\\|, so it is good to have
|\pgfmatrixendrow| as a ``fallback.''
\item Every row \emph{including the last row} must be ended using
- the command |\\| or |\pgfmatrixendrow|.
+ the command |\\| or |\pgfmatrixendrow|.
\end{enumerate}
Both |\pgfmatrixnextcell| and |\pgfmatrixendrow| (and, thus, also
|\\|) take an optional argument as explained in the
- Section~\ref{section-matrix-spacing}
+ Section~\ref{section-matrix-spacing}
\begin{codeexample}[]
\begin{tikzpicture}
@@ -142,15 +142,15 @@ All matrices are typeset using the following command:
box. The origin of this coordinate system is at the left baseline
end of the matrix box, which corresponds to the |text| anchor. The
position \meta{shift} is then interpreted inside this coordinate
- system and then used for shifting.
+ system and then used for shifting.
This allows you to use the parameter \meta{shift} in the following
way: If you use |text| as the \meta{anchor} and specify
|\pgfpointanchor{inner node}{some anchor}| for the parameter
- \meta{shift}, where |inner node| is a node that
+ \meta{shift}, where |inner node| is a node that
is created in the matrix, then the whole matrix will be shifted such
that |inner node.some anchor| lies at the origin of the whole
- picture.
+ picture.
\medskip
\textbf{Rotations and scaling.\ }
@@ -166,10 +166,10 @@ All matrices are typeset using the following command:
\medskip
\textbf{Callbacks.\ }
- At the beginning and at the end of each cell the special macros
+ At the beginning and at the end of each cell the special macros
|\pgfmatrixbegincode|, |\pgfmatrixendcode| and possibly
|\pgfmatrixemptycode| are called. The effect is explained in
- Section~\ref{section-matrix-callbacks}.
+ Section~\ref{section-matrix-callbacks}.
\medskip
\textbf{Executing extra code.\ }
@@ -180,14 +180,14 @@ All matrices are typeset using the following command:
\begin{enumerate}
\item It can be used to simplify the next cell macro. For example,
saying |\let\&=\pgfmatrixnextcell| allows you to use |\&| instead
- of |\pgfmatrixnextcell|. You can also set the catcode of |&| to
+ of |\pgfmatrixnextcell|. You can also set the catcode of |&| to
active.
\item It can be used to issue an |\aftergroup| command. This allows
you to regain control after the |\pgfmatrix| command. (If you do
not know the |\aftergroup| command, you are probably blessed with
a simple and happy life.)
\end{enumerate}
-
+
\medskip
\textbf{Special considerations concerning macro expansion.\ }
As said before, the matrix is typeset using |\halign|
@@ -200,7 +200,7 @@ All matrices are typeset using the following command:
that the macros inside \meta{matrix cells} expand to these macros
sooner or later.
\item In particular, you can define clever macros that insert
- columns and rows as needed for special effects.
+ columns and rows as needed for special effects.
\end{itemize}
\end{command}
@@ -218,7 +218,7 @@ commands for the column spacing.
\end{command}
\begin{command}{\pgfmatrixnextcell\opt{\oarg{additional sep list}}}
- This command has two puposes: First, it is used to separate
+ This command has two purposes: First, it is used to separate
cells. Second, by providing the optional argument \meta{additional
sep list} you can modify the spacing between the columns that are
separated by this command.
@@ -241,11 +241,11 @@ commands for the column spacing.
argument is missing, only the default separation list is
processed.
\item Both lists may contain dimensions, separated by commas, as
- well as occurences of the keywords |between origins| and
+ well as occurrences of the keywords |between origins| and
|between borders|.
- \item All dimensions occuring in either list are added together to
+ \item All dimensions occurring in either list are added together to
arrive at an dimension $d$.
- \item The last occurence of either of the keywords is located. If
+ \item The last occurrence of either of the keywords is located. If
neither keyword is present, we proceed as if |between borders|
were present.
\end{enumerate}
@@ -264,7 +264,7 @@ commands for the column spacing.
distance between these two lines is exactly $d$.
This mode may only be used between columns \emph{already
- introduced in the first row}.
+ introduced in the first row}.
\end{itemize}
All of the above rules boil down to the following effects:
\begin{itemize}
@@ -281,7 +281,7 @@ commands for the column spacing.
\item You can now use the optional argument of |\pgfmatrixnextcell|
to locally overrule the spacing between two columns. By saying
|\pgfmatrixnextcell[5pt]| you \emph{add} 5pt to the space between
- of the two columns, regadless of the mode.
+ of the two columns, regardless of the mode.
You can also (locally) change the spacing mode for these two
columns. For example, even if the normal spacing mode is
@@ -370,7 +370,7 @@ change the appearance of cells in a very general manner.
\begin{command}{\pgfmatrixemptycode}
This macro is executed for empty cells. This means that \pgfname\
uses some macro magic to determine whether a cell is empty (it
- immediatly ends with |\pgfmatrixemptycode| or |\pgfmatrixendrow|)
+ immediately ends with |\pgfmatrixemptycode| or |\pgfmatrixendrow|)
and, if so, put this macro inside the cell.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -422,15 +422,15 @@ current column in a callback:
\begin{command}{\pgfmatrixcurrentrow}
This counter stores the current row of the current cell of the
- matrix. Do not even think of changing this counter.
+ matrix. Do not even think of changing this counter.
\end{command}
\begin{command}{\pgfmatrixcurrentcolumn}
This counter stores the current column of the current cell of the
- matrix.
+ matrix.
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
index 8251a7e96ce..5df4c13b6bb 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
@@ -17,7 +17,7 @@ This section describes the |shapes| module.
\begin{pgfmodule}{shapes}
This module defines commands both for creating nodes and for
creating shapes. The package is loaded automatically by |pgf|, but
- you can load it manually if you have only included |pgfcore|.
+ you can load it manually if you have only included |pgfcore|.
\end{pgfmodule}
@@ -41,7 +41,7 @@ You create a node by calling the macro |\pgfnode| or the more general
|\pgfmultipartnode|. These macro takes several parameters and draws
the requested shape at a certain position. In addition, it will
``remember'' the node's position within the current
-|{pgfpicture}|. You can then, later on, refer to the
+|{pgfpicture}|. You can then, later on, refer to the
node's position. Coordinate transformations are ``fully supported,''
which means that if you used coordinate transformations to shift or
rotate the shape of a node, the node's position will still be correctly
@@ -150,10 +150,11 @@ the description of |\pgfmultipartnode| for more details.
\subsection{Creating Nodes}
-You create a node using one of the following commands:
+
+\subsubsection{Creating Simple Nodes}
\begin{command}{\pgfnode\marg{shape}\marg{anchor}\marg{label
- text}\marg{name}\marg{path usage command}}
+ text}\marg{name}\marg{path usage command}}
This command creates a new node. The \meta{shape} of the node must
have been declared previously using |\pgfdeclareshape|.
@@ -190,7 +191,7 @@ You create a node using one of the following commands:
anchored, but you do not wish the shape itself to the
transformed. In this case, you should call
|\pgftransformresetnontranslations| prior to calling the |\pgfnode|
- command.
+ command.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -212,6 +213,10 @@ You create a node using one of the following commands:
|\pgfmultipartnode| for details.
\end{command}
+
+
+\subsubsection{Creating Multi-Part Nodes}
+
\begin{command}{\pgfmultipartnode\marg{shape}\marg{anchor}\marg{name}\marg{path
usage command}}
This command is the more general (and less user-friendly) version of
@@ -223,7 +228,7 @@ You create a node using one of the following commands:
have setup one \TeX-box. Suppose the shape has two parts: The |text|
part and the |lower| part. Then, prior to calling
|\pgfmultipartnode|, you must have setup the boxes
- |\pgfnodeparttextbox| and |\pgfnodepartlowerbox|. These boxes may
+ |\pgfnodeparttextbox| and |\pgfnodepartlowerbox|. These boxes may
contain any \TeX-text. The shape code will then compute the
positions of the shape's anchors based on the sizes of the these
shapes. Finally, when the node is drawn, the boxes are placed at the
@@ -253,7 +258,7 @@ You create a node using one of the following commands:
exhausting \TeX's limited number of box registers, you can say
\begin{codeexample}[code only]
\newbox\pgfnodepartlowerbox
-\let\pgfnodepartmethodsbox=\pgfnodepartlowerbox
+\let\pgfnodepartmethodsbox=\pgfnodepartlowerbox
\end{codeexample}
Also, when you have a node part name with spaces like |class name|,
it may be useful to create an alias:
@@ -263,12 +268,27 @@ You create a node using one of the following commands:
\end{codeexample}
\end{command}
+\begin{command}{\pgfcoordinate\marg{name}\marg{coordinate}}
+ This command creates a node of shape |coordinate| at the given
+ \meta{coordinate}. Exactly the same effect can be achieved using
+ first a shift of the coordinate system to \meta{coordinate},
+ followed by creating a node of shape |coordinate| named
+ \meta{name}. However, this command is easier and more natural to use
+ and, more importantly, it is much faster.
+\end{command}
+
\begin{command}{\pgfnodealias\marg{new name}\marg{existing node}}
This command does not actually create a new node. Rather, it allows
you to subsequently access the node \meta{existing node} using the
name \meta{new name}.
\end{command}
+
+\begin{command}{\pgfnoderename\marg{new name}\marg{existing node}}
+ This command renames an existing node.
+\end{command}
+
+
There are a number of values that have an influence on the size of a
node. These values are stored in the following keys.
@@ -277,11 +297,11 @@ node. These values are stored in the following keys.
This key stores the \emph{recommended} minimum width of a
shape. Thus, when a shape is drawn and when the shape's width would
be smaller than \meta{dimension}, the shape's width is enlarged by
- adding some empty space.
+ adding some empty space.
Note that this value is just a recommendation. A shape may choose to
ignore this key.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);
@@ -299,7 +319,7 @@ node. These values are stored in the following keys.
\begin{key}{/pgf/minimum size=\meta{dimension}}
\keyalias{tikz}
- This sytle both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}.
+ This style both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}.
\end{key}
@@ -309,7 +329,7 @@ node. These values are stored in the following keys.
inner separation between the label text and the background path. As
before, this value is just a recommendation and a shape may choose
to ignore this key.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);
@@ -337,9 +357,9 @@ node. These values are stored in the following keys.
This key stores the recommended horizontal separation between the
background path and the ``outer anchors.'' For example, if
\meta{dimension} is |1cm| then the |east| anchor will be 1cm to the
- right of the right border of the background path.
+ right of the right border of the background path.
As before, this value is just a recommendation.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);
@@ -368,6 +388,110 @@ node. These values are stored in the following keys.
\end{key}
+\subsubsection{Deferred Node Positioning}
+
+Normally, when a node is created using a command like |\pgfnode|, the
+node is immediately inserted into the current picture. In particular,
+you have no chance to change the position of a created node after it
+has been create. Using |\pgfpositionnodelater| in concert with
+|\pgfpositionnodenow|, you can create a node whose position is
+determined only at some later time.
+
+\begin{command}{\pgfpositionnodelater\marg{macro name}}
+ This command is not a replacement for |\pgfnode|. Rather, when this
+ command is used in a scope, all subsequent node creations in this
+ scope will be affected in the following way: When a node is
+ created, it is not inserted into the current picture. Instead, it
+ is stored in the box |\pgfpositionnodelaterbox|. Furthermore, the
+ node is not relevant for the picture's bounding box, but a bounding
+ box for the node is computed and stored in the macros
+ |\pgfpositionnodelaterminx| to |\pgfpositionnodelatermaxy|. Then,
+ the \meta{macro name} is called with the following macros setup:
+
+ \begin{command}{\pgfpositionnodelaterbox}
+ A box register number (|0| currently) that stores the node's paths
+ and texts. You should move the contents of this box to a box of
+ your choice inside \meta{macro name}.
+ \end{command}
+
+ \begin{command}{\pgfpositionnodelatername}
+ The name of the just-created-node. This name will be the
+ originally "desired" name of the box plus the fixed prefix
+ |not yet positioned@|. The idea is to ensure that the original
+ name is not inadvertently used before the node is actually
+ positioned. When |\pgfpositionnodenow| is called, it will change
+ the name to the original name.
+ \end{command}
+
+ \begin{command}{\pgfpositionnodelaterminx}
+ The minimal $x$-position of a bounding box of the node. This
+ bounding box refers to the node when it is positioned with the
+ anchor at the origin.
+ \end{command}
+ \begin{command}{\pgfpositionnodelaterminy}
+ \end{command}
+ \begin{command}{\pgfpositionnodelatermaxx}
+ \end{command}
+ \begin{command}{\pgfpositionnodelatermaxy}
+ \end{command}
+
+ Once a late node has been created, you can add arbitrary code in the
+ same picture. Then, at some later point, you call
+ |\pgfpositionnodenow| to finally position the node at a given
+ position. At this point, the above macros must have the exact same
+ values they had when \meta{macro name} was called. Note that the
+ above macros are local to a scope that ends right after the call to
+ \meta{macro name}, so it is your job to copy the values to safety
+ inside \meta{macro name}.
+
+ By setting \meta{macro name} to |\relax| (which is the default), you
+ can switch off the whole mechanism. When a picture is interrupted,
+ this is done automatically.
+\end{command}
+
+
+\begin{command}{\pgfpositionnodenow\marg{coordinate}}
+ This command is used to position a node that has previously been
+ created with |\pgfpositionnodelater|. When |\pgfpositionnodenow| is
+ called, the macros and boxes mentioned in the description of
+ |\pgfpositionnodenow| must be set to the value they had when the
+ \meta{macro name} was called. Provided this is the case, this
+ command will insert the box into the current picture, shifted by
+ \meta{coordinate}. Subsequently, you can refer to the node with its
+ original name as if it had just been created.
+
+ \begin{codeexample}[]
+\newbox\mybox
+
+\def\mysaver{
+ \global\setbox\mybox=\box\pgfpositionnodelaterbox
+ \global\let\myname=\pgfpositionnodelatername
+ \global\let\myminx=\pgfpositionnodelaterminx
+ \global\let\myminy=\pgfpositionnodelaterminy
+ \global\let\mymaxx=\pgfpositionnodelatermaxx
+ \global\let\mymaxy=\pgfpositionnodelatermaxy
+}
+
+\begin{tikzpicture}
+ {
+ \pgfpositionnodelater{\mysaver}
+ \node [fill=blue!20,below,rotate=30] (hi) {Hello world};
+ }
+ \draw [help lines] (0,0) grid (3,2);
+
+ \let\pgfpositionnodelatername=\myname
+ \let\pgfpositionnodelaterminx=\myminx
+ \let\pgfpositionnodelaterminy=\myminy
+ \let\pgfpositionnodelatermaxx=\mymaxx
+ \let\pgfpositionnodelatermaxy=\mymaxy
+ \setbox\pgfpositionnodelaterbox=\box\mybox
+ \pgfpositionnodenow{\pgfqpoint{2cm}{2cm}}
+
+ \draw (hi) -- (0,0);
+\end{tikzpicture}
+ \end{codeexample}
+\end{command}
+
\subsection{Using Anchors}
@@ -435,7 +559,7 @@ following commands:
\pgfpointanchor{x}{east}
\xdef\mycoordinate{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}
}
-
+
\pgfpathcircle{\mycoordinate}{2pt}
\pgfusepath{fill}
\end{pgfpicture}
@@ -453,7 +577,7 @@ following commands:
then |\pgfpointanchor| will return a coordinate that corresponds to
the position of the node's anchor on the page, transformed into the
current coordinate system. For examples and more details see
- Section~\ref{section-cross-pictures-pgf}.
+ Section~\ref{section-cross-pictures-pgf}.
\end{command}
\begin{command}{\pgfpointshapeborder\marg{node}\marg{point}}
@@ -518,7 +642,7 @@ automatically. Rather, you have to proceed as follows:
second run.
\item You have to switch off automatic bounding bound
computations. The reason is that the node in the other picture
- should not influence the size of the bouding box of the current
+ should not influence the size of the bounding box of the current
picture. You should say |\pgfusepath{use as bounding box}| before
using a coordinate in another picture.
\end{enumerate}
@@ -538,7 +662,7 @@ should not attempt to redefine.
\pgfpointanchor{current bounding box}{south east}
\end{codeexample}
returns the lower left corner of the bounding box of the current
- picture.
+ picture.
\end{predefinednode}
\begin{predefinednode}{current path bounding box}
@@ -579,7 +703,7 @@ should not attempt to redefine.
Text absolutely positioned in
the lower left corner.}
}
-\end{pgfpicture}
+\end{pgfpicture}
\end{codeexample}
\end{predefinednode}
@@ -588,7 +712,7 @@ There is also an option that allows you to create new special nodes
quite similar to the above:
\begin{key}{/pgf/local bounding box=\meta{node name}}
\keyalias{tikz}
- This defines a new node \meta{node name} whose size is the bouding
+ This defines a new node \meta{node name} whose size is the bounding
box around all objects in the current scope starting at the position
where this option was given. After the end of the scope, the \meta{node
name} is still available. You can use this option to keep track of
@@ -619,7 +743,7 @@ circumstances) and they need to be constructed reasonably ``fast.''
\pgfname\ must be able to handle pictures with several hundreds of
nodes and documents with thousands of nodes in total. It would not do
if \pgfname\ had to compute and store, say, dozens of anchor positions
-for every node.
+for every node.
\subsubsection{What Must Be Defined For a Shape?}
@@ -630,7 +754,7 @@ In order to define a new shape, you must provide:
a \emph{shape name},
\item
code for computing the \emph{saved anchors} and \emph{saved
- dimensions},
+ dimensions},
\item
code for computing \emph{anchor} positions in terms of the saved anchors,
\item
@@ -648,21 +772,21 @@ In order to define a new shape, you must provide:
Anchors are special places in shape. For example, the |north east|
anchor, which is a normal anchor, lies at the upper right corner of
the |rectangle| shape, as does |\northeast|, which is a saved
-anchor. The difference is the following: \emph{saved anchors are
+anchor. The difference is the following: \emph{saved anchors are
computed and stored for each node, anchors are only computed as
needed.} The user only has access to the normal anchors, but a
normal anchor can just ``copy'' or ``pass through'' the location of a
-saved anchor.
+saved anchor.
The idea behind all this is that a shape can declare a very large
number of normal anchors, but when a node of this shape is created,
these anchors are not actually computed. However, this causes a
problem: When we wish to reference an anchor of a node at some later
-time, we must still able to compute the position of the anchor. For
+time, we must still able to compute the position of the anchor. For
this, we may need a lot of information: What was the transformation
matrix that was in force when the node was created? What was the size
of the text box? What were the values of the different separation
-dimensions? And so on.
+dimensions? And so on.
To solve this problem, \pgfname\ will always compute the locations of
all \emph{saved anchors} and store these positions. Then, when an
@@ -673,17 +797,17 @@ As an example, consider the |rectangle| shape. For this shape two
anchors are saved: The |\northeast| corner and the |\southwest|
corner. A normal anchor like |north west| can now easily be expressed
in terms of these coordinates: Take the $x$-position of the
-|\southwest| point and the $y$-position of the |\northeast| point.
+|\southwest| point and the $y$-position of the |\northeast| point.
The |rectangle| shape currently defines 13 normal anchors, but needs
only two saved anchors. Adding new anchors like a |south south east|
anchor would not increase the memory and computation requirements of
-pictures.
+pictures.
All anchors (both saved and normal) are specified in a local
\emph{shape coordinate space}. This is also true for the background
and foreground paths. The |\pgfnode| macro will automatically apply
appropriate transformations to the coordinates so that the shape is
-shifted to the right anchor or otherwise transformed.
+shifted to the right anchor or otherwise transformed.
\subsubsection{Command for Declaring New Shapes}
@@ -749,12 +873,12 @@ The following command declares a new shape:
The \meta{code} will be executed each time |\pgfnode| (or
|\pgfmultipartnode|) is called to create a node of the shape
- \meta{shape name}. When the \meta{code}
+ \meta{shape name}. When the \meta{code}
is executed, the \TeX-boxes of the node parts will contain the
text labels of the node. Possibly, these box are void. For
example, if there is just a |text| part, the node
|\pgfnodeparttextbox| will be setup when the \meta{code} is
- executed.
+ executed.
The \meta{code} can use the width, height, and depth of the
box(es) to compute the location of the saved anchor. In addition,
@@ -791,7 +915,7 @@ The following command declares a new shape:
origin. Either will be fine, for the final shape this will make no
difference since the shape will be shifted anyway. So, let us
assume that the text label is centered on the origin (this will be
- specified later on using the |text| anchor). We get
+ specified later on using the |text| anchor). We get
the following code for the upper right corner:
\begin{codeexample}[code only]
\savedanchor{\upperrightcorner}{
@@ -802,7 +926,7 @@ The following command declares a new shape:
If we wanted to take, say, the |\pgfshapeminwidth| into account,
we could use the following code:
-
+
\begin{codeexample}[code only]
\savedanchor{\upperrightcorner}{
\pgf@y=.\ht\pgfnodeparttextbox % height of the box
@@ -814,13 +938,13 @@ The following command declares a new shape:
}
\end{codeexample}
Note that we could not have written |.5\pgfshapeminwidth| since
- the minium width is stored in a ``plain text macro,'' not as a
- real dimension. So if |\pgfshapeminwidth| depth were
+ the minimum width is stored in a ``plain text macro,'' not as a
+ real dimension. So if |\pgfshapeminwidth| depth were
2cm, writing |.5\pgfshapeminwidth| would yield the same as |.52cm|.
In the ``real'' |rectangle| shape the code is somewhat more
complex, but you get the basic idea.
- \end{command}
+ \end{command}
\begin{command}{\saveddimen\marg{command}\marg{code}}
This command is similar to |\savedanchor|, only instead of setting
\meta{command} to |\pgfpoint{|$x$|}{|$y$|}|, the \meta{command} is
@@ -828,13 +952,13 @@ The following command declares a new shape:
In the |simple rectangle| shape we might use a saved dimension to
store the depth of the shape box.
-
+
\begin{codeexample}[code only]
\saveddimen{\depth}{
- \pgf@x=\dp\pgfnodeparttextbox
+ \pgf@x=\dp\pgfnodeparttextbox
}
\end{codeexample}
- \end{command}
+ \end{command}
\begin{command}{\savedmacro\marg{command}\marg{code}}
This command is similar to |\saveddimen|, only at some point
in \meta{code}, \meta{command} should be defined appropriately,
@@ -842,11 +966,11 @@ The following command declares a new shape:
In the |regular polygon| shape, a saved macro is used to
store the number of sides of the polygon.
-
+
\begin{codeexample}[code only]
\savedmacro{\sides}{\let\sides\pgfpolygonsides}
\end{codeexample}
- \end{command}
+ \end{command}
\begin{command}{\anchor\marg{name}\marg{code}}
This command declares an anchor named \meta{name}. Unlike for saved
anchors, the \meta{code} will not be executed each time a node is
@@ -870,7 +994,7 @@ The following command declares a new shape:
Let us consider some example for the |simple rectangle|
shape. First, we would like to make the upper right corner
publicly available, for example as |north east|:
-
+
\begin{codeexample}[code only]
\anchor{north east}{\upperrightcorner}
\end{codeexample}
@@ -882,7 +1006,7 @@ The following command declares a new shape:
Next, let us define a |north west| anchor. For this anchor, we can
negate the |\pgf@x| variable:
-
+
\begin{codeexample}[code only]
\anchor{north west}{
\upperrightcorner
@@ -921,18 +1045,51 @@ The following command declares a new shape:
\end{codeexample}
to center the text label on the origin in the shape coordinate
space. Note that we could \emph{not} have written the following:
-
+
\begin{codeexample}[code only]
\anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}
\end{codeexample}
Do you see why this is wrong? The problem is that the box
|\pgfnodeparttextbox| will most likely not have the correct size
when the anchor is computed. After all, the anchor position might
- be recomputed at a time when several other nodes have been created.
+ be recomputed at a time when several other nodes have been created.
If a shape has several node parts, we would have to define an
- anchor for each part.
- \end{command}
+ anchor for each part.
+ \end{command}
+
+ \begin{command}{\deferredanchor\marg{name}\marg{code}}
+ This command declares an anchor named \meta{name}. It works like
+ |\anchor|. However, unlike for
+ anchors declared by |\anchor|, \meta{name} will \emph{not} be
+ expanded during the shape declaration (i.e.\ not during
+ |\pgfdeclareshape|). Rather, the \meta{name} is expanded when the
+ \emph{node} is actually used (with |\pgfnode| or more likely with
+ |\node|). This may be useful if the anchor name is context
+ dependent (depending, for example, on the value of a key).
+
+\begin{codeexample}[code only]
+\makeatletter
+\def\foo{foo}
+\pgfdeclareshape{simple shape}{%
+ \savedanchor{\center}{%
+ \pgfpointorigin}
+ \anchor{center}{\center}
+ \savedanchor{\anchorfoo}{%
+ \pgf@x=1cm
+ \pgf@y=0cm}
+ \deferredanchor{anchor \foo}{\anchorfoo}}
+
+\begin{tikzpicture}
+ \node[simple shape] (Test1) at (0,0) {};
+ \fill (Test1.anchor foo) circle (2pt) node[below] {anchor foo anchor};
+ %
+ \def\foo{bar}
+ \node[simple shape] (Test2) at (2,2) {};
+ \fill (Test2.anchor bar) circle (2pt) node[below] {anchor bar anchor};
+\end{tikzpicture}
+\end{codeexample}
+ \end{command}
\begin{command}{\anchorborder\marg{code}}
A \emph{border anchor} is an anchor point on the border of the
shape. What exactly is considered as the ``border'' of the shape
@@ -963,7 +1120,7 @@ The following command declares a new shape:
\pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\upperrightcorner}
}
\end{codeexample}
- \end{command}
+ \end{command}
\begin{command}{\backgroundpath\marg{code}}
This command specifies the path that ``makes up'' the background
of the shape. Note that the shape cannot prescribe what is going
@@ -984,17 +1141,17 @@ The following command declares a new shape:
\pgfpathrectanglecorners
{\upperrightcorner}
{\pgfpointscale{-1}{\upperrightcorner}}
-}
+}
\end{codeexample}
As the name suggests, the background path is used ``behind'' the
text labels. Thus, this path is used first, then the text labels are
drawn, possibly obscuring part of the path.
- \end{command}
+ \end{command}
\begin{command}{\foregroundpath\marg{code}}
This command works like |\backgroundpath|, only it is invoked
after the text labels have been drawn. This means that this path can
possibly obscure (part of) the text labels.
- \end{command}
+ \end{command}
\begin{command}{\behindbackgroundpath\marg{code}}
Unlike the previous two commands, \meta{code} should not only
construct a path, it should also use this path in whatever way is
@@ -1006,19 +1163,19 @@ The following command declares a new shape:
path.
Note that the \meta{code} is protected with a |{pgfscope}|.
- \end{command}
+ \end{command}
\begin{command}{\beforebackgroundpath\marg{code}}
This command works like |\behindbackgroundpath|, only the
\meta{code} is executed after the background path has been used,
but before the texts label are drawn.
- \end{command}
+ \end{command}
\begin{command}{\behindforegroundpath\marg{code}}
The \meta{code} is executed after the text labels have been drawn,
but before the foreground path is used.
- \end{command}
+ \end{command}
\begin{command}{\beforeforegroundpath\marg{code}}
This \meta{code} is executed at the very end.
- \end{command}
+ \end{command}
\begin{command}{\inheritsavedanchors|[from=|\marg{another shape name}|]|}
This command allows you to inherit the code for saved anchors from
\meta{another shape name}. The idea is that if you wish to create
@@ -1032,32 +1189,32 @@ The following command declares a new shape:
always have to inherit all saved anchors from another
shape. However, you can inherit the saved anchors of more than one
shape by calling this command several times.
- \end{command}
+ \end{command}
\begin{command}{\inheritbehindbackgroundpath|[from=|\marg{another shape name}|]|}
This command can be used to inherit the code used for the
- drawings behind the background path from \meta{another shape name}.
- \end{command}
+ drawings behind the background path from \meta{another shape name}.
+ \end{command}
\begin{command}{\inheritbackgroundpath|[from=|\marg{another shape name}|]|}
Inherits the background path code from \meta{another shape name}.
- \end{command}
+ \end{command}
\begin{command}{\inheritbeforebackgroundpath|[from=|\marg{another shape name}|]|}
Inherits the before background path code from \meta{another shape name}.
- \end{command}
+ \end{command}
\begin{command}{\inheritbehindforegroundpath|[from=|\marg{another shape name}|]|}
Inherits the behind foreground path code from \meta{another shape name}.
- \end{command}
+ \end{command}
\begin{command}{\inheritforegroundpath|[from=|\marg{another shape name}|]|}
Inherits the foreground path code from \meta{another shape name}.
- \end{command}
+ \end{command}
\begin{command}{\inheritbeforeforegroundpath|[from=|\marg{another shape name}|]|}
Inherits the before foreground path code from \meta{another shape name}.
- \end{command}
+ \end{command}
\begin{command}{\inheritanchor|[from=|\marg{another shape name}|]|\marg{name}}
Inherits the code of one specific anchor named \meta{name} from
\meta{another shape name}. Thus, unlike saved anchors, which must
be inherited collectively, normal anchors can and must be
inherited individually.
- \end{command}
+ \end{command}
\begin{command}{\inheritanchorborder|[from=|\marg{another shape name}|]|}
Inherits the border anchor code from \meta{another shape name}.
\end{command}
@@ -1101,16 +1258,16 @@ The following command declares a new shape:
\node[fill=examplefill,draw,ellipse,double]
at ([shift=(-80:3cm)]x) (y) {Use Case};
- \draw[dashed] (x) -- (y);
+ \draw[dashed] (x) -- (y);
\end{tikzpicture}
\end{codeexample}
-
+
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
index e113ec72d3a..5284f22bb36 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
@@ -31,7 +31,7 @@ path (in red) consisting of two parts, one open, one closed:
(ab) node[below right] {straight segment}
(b) node[right] {end first segment}
(c) node[right] {end part 1}
- (x) node[above right] {part 2 (closed)};
+ (x) node[above right] {part 2 (closed)};
\end{tikzpicture}
\end{codeexample}
@@ -68,7 +68,7 @@ see Section~\ref{section-soft-paths}).
The most basic operation is the move-to operation. It must be given at
the beginning of paths, though some path construction command (like
|\pgfpathrectangle|) generate move-tos implicitly. A move-to operation
-can also be used to start a new part of a path.
+can also be used to start a new part of a path.
\begin{command}{\pgfpathmoveto\marg{coordinate}}
This command expects a \pgfname-coordinate like |\pgfpointorigin| as
@@ -103,7 +103,7 @@ can also be used to start a new part of a path.
to \meta{coordinate} before using it.
The command will update the bounding box of the current path and
- picture, if necessary.
+ picture, if necessary.
\end{command}
@@ -115,7 +115,7 @@ can also be used to start a new part of a path.
of path without any other path construction command given before (in
particular without a move-to operation), the \TeX\ file may compile
without an error message, but a viewer application may display an
- error message when trying to render the picture.
+ error message when trying to render the picture.
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -129,11 +129,11 @@ can also be used to start a new part of a path.
to \meta{coordinate} before using it.
The command will update the bounding box of the current path and
- picture, if necessary.
+ picture, if necessary.
\end{command}
-\subsection{The Curve-To Path Operation}
+\subsection{The Curve-To Path Operations}
\begin{command}{\pgfpathcurveto\marg{support 1}\marg{support 2}\marg{coordinate}}
This command extends the current path with a Bézier curve from the
@@ -161,9 +161,59 @@ can also be used to start a new part of a path.
large enough such that it encompasses all of the support points and
the \meta{coordinate}. This will guarantee that the curve is
completely inside the bounding box, but the bounding box will
- typically be quite a bit too large. It is not clear (to me) how this
+ typically be quite a bit too large. It is not clear (to me) how this
can be avoided without resorting to ``some serious math'' in order
- to calculate a precise bounding box.
+ to calculate a precise bounding box.
+\end{command}
+
+\begin{command}{\pgfpathquadraticcurveto\marg{support}\marg{coordinate}}
+ This command works like |\pgfpathcurveto|, only it uses a quadratic
+ Bézier curve rather than a cubic one. This means that only one
+ support point is needed.
+\begin{codeexample}[]
+\begin{pgfpicture}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathquadraticcurveto
+ {\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{0cm}}
+ \pgfsetfillcolor{examplefill}
+ \pgfusepath{fill,stroke}
+\end{pgfpicture}
+\end{codeexample}
+ Internally, the quadratic curve is converted into a cubic
+ curve. The only noticeable effect of this is that the points used for
+ computing the bounding box are the control points of the converted
+ curve rather than \meta{support}. The main effect of this is that
+ the bounding box will be a bit tighter than might be expected. In
+ particular, \meta{support} will not always be part of the bounding
+ box.
+\end{command}
+
+
+There exist two commands to draw only part of a cubic Bézier curve:
+
+\begin{command}{\pgfpathcurvebetweentime\marg{time $t_1$}\marg{time $t_2$}\marg{point p}\marg{point $s_1$}\marg{point $s_2$}\marg{point q}}
+
+ This command draws the part of the curve described by $p$, $s_1$,
+ $s_2$ and $q$ between the times $t_1$ and $t_2$. A time value of 0
+ indicates the point $p$ and a time value of 1 indicates point $q$.
+ This command includes a moveto operation to the first point.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [thin] (0,0) .. controls (0,2) and (3,0) .. (3,2);
+ \pgfpathcurvebetweentime{0.25}{0.9}{\pgfpointxy{0}{0}}{\pgfpointxy{0}{2}}
+ {\pgfpointxy{3}{0}}{\pgfpointxy{3}{2}}
+ \pgfsetstrokecolor{red}
+ \pgfsetstrokeopacity{0.5}
+ \pgfsetlinewidth{2pt}
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfpathcurvebetweentimecontinue\marg{time $t_1$}\marg{time $t_2$}\marg{point p}\marg{point $s_1$}\marg{point $s_2$}\marg{point q}}
+ This command works like |\pgfpathcurvebetweentime|, except that a
+ moveto operation is \emph{not} made to the first point.
\end{command}
@@ -175,7 +225,7 @@ can also be used to start a new part of a path.
\emph{is} a difference between closing a path and using the line-to
operation to add a straight line to the start of the current
path. The difference is demonstrated by the upper corners of the triangles
- in the following example:
+ in the following example:
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -213,7 +263,7 @@ circles to a path are described.
counterclockwise, otherwise clockwise). This curve is now moved such
that the point where the curve starts is the previous last point of the
path. Note that this command will \emph{not} start a new part of the
- path, which is important for example for filling purposes.
+ path, which is important for example for filling purposes.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -279,15 +329,130 @@ circles to a path are described.
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\draw (0,0) -- (2cm,5mm) (0,0) -- (0cm,1cm);
-
+
\pgfpathmoveto{\pgfpoint{2cm}{5mm}}
\pgfpatharcaxes{0}{90}{\pgfpoint{2cm}{5mm}}{\pgfpoint{0cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\end{codeexample}
-\end{command}
+\end{command}
+\begin{command}{\pgfpatharcto\marg{x-radius}\marg{y-radius}\marg{rotation}
+ \marg{large arc flag}\marg{counterclockwise flag}\\\marg{target point}}
+ This command (which directly corresponds to the arc-path command of
+ \textsc{svg}) is used to add an arc to the path that starts at the
+ current point and ends at \meta{target point}. This arc is part of
+ an ellipse that is determined in the following way: Imagine an
+ ellipse with radii \meta{x-radius} and \meta{y-radius} that is
+ rotated around its center by \meta{rotation} degrees. When you move
+ this ellipse around in the plane, there will be exactly two
+ positions such that the two current point and the target point lie
+ on the border of the ellipse (excluding pathological cases). The
+ flags \meta{large arc flag} and \meta{clockwise flag} are then used to
+ decide which of these ellipses should be picked and which arc on the
+ picked ellipsis should be used.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[help lines] (0,0) grid (3,2);
+
+ \pgfpathmoveto{\pgfpoint{0mm}{20mm}}
+ \pgfpatharcto{3cm}{1cm}{0}{0}{0}{\pgfpoint{3cm}{1cm}}
+ \pgfusepath{draw}
+\end{tikzpicture}
+\end{codeexample}
+ Both flags are considered to be false exactly if they evaluate to
+ |0|, otherwise they are true. If the \meta{large arc flag} is true,
+ then the angle spanned by the arc will be greater than $180^\circ$,
+ otherwise it will be less than $180^\circ$. The \meta{clockwise
+ flag} is used to determine which of the two ellipses should be
+ used: if the flag is true, then the arc goes from the current point
+ to the target point in a counterclockwise direction, otherwise in a
+ clockwise fashion.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \pgfsetlinewidth{2pt}
+ % Flags 0 0: red
+ \pgfsetstrokecolor{red}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharcto{20pt}{10pt}{0}{0}{0}{\pgfpoint{20pt}{10pt}}
+ \pgfusepath{stroke}
+ % Flags 0 1: blue
+ \pgfsetstrokecolor{blue}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharcto{20pt}{10pt}{0}{0}{1}{\pgfpoint{20pt}{10pt}}
+ \pgfusepath{stroke}
+ % Flags 1 0: orange
+ \pgfsetstrokecolor{orange}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharcto{20pt}{10pt}{0}{1}{0}{\pgfpoint{20pt}{10pt}}
+ \pgfusepath{stroke}
+ % Flags 1 1: black
+ \pgfsetstrokecolor{black}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpatharcto{20pt}{10pt}{0}{1}{1}{\pgfpoint{20pt}{10pt}}
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+ \emph{Warning:} The internal computations necessary for this command
+ are numerically very unstable. In particular, the arc will not
+ always really end at the \meta{target coordinate}, but may be off by
+ up to several points. A more precise positioning is currently
+ infeasible due to \TeX's numerical weaknesses. The only case that
+ works quite nicely is when the resulting angle is a multiple
+ of~$90^\circ$.
+\end{command}
+
+\begin{command}{\pgfpatharctoprecomputed\marg{center point}\marg{start angle}\marg{end angle}\marg{end point}\\\marg{x-radius}\marg{y-radius}\marg{ratio x-radius/y-radius}\marg{ratio y-radius/x-radius}}
+ A specialized arc operation which is fast and numerically stable, provided a lot of information is given in advance.
+
+ In contrast to |\pgfpatharc|, it explicitly interpolates start- and end points.
+
+ In contrast to |\pgfpatharcto|, this routine is numerically stable and quite fast since it relies on a lot of available information.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[help lines] (0,0) grid (3,2);
+
+ \def\cx{1.5cm}% center x
+ \def\cy{1cm}% center y
+ \def\startangle{0}%
+ \def\endangle{270}%
+ \def\a{1.5cm}% xradius
+ \def\b{0.5cm}% yradius
+ \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult
+ \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult
+ %
+ % start point:
+ \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}%
+ \pgfpatharctoprecomputed
+ {\pgfpoint{\cx}{\cy}}
+ {\startangle}
+ {\endangle}
+ {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}% end point
+ {\a}
+ {\b}
+ {\abratio}
+ {\baratio}
+ \pgfusepath{draw}
+\end{tikzpicture}
+\end{codeexample}
+
+ \begin{command}{\pgfpatharctomaxstepsize}
+ The quality of arc approximation taken by |\pgfpatharctoprecomputed| by means of Bezier splines is % TODOsp: Bezier --> Bézier?
+ controlled by a mesh width, which is initially
+
+ |\def\pgfpatharctoprecomputed{45}|.
+
+ The mesh width is provided in (full!) degrees. The smaller the mesh
+ width, the more precise the arc approximation.
+
+ Use an empty value to disable spline approximation (uses a single
+ cubic polynomial for the complete arc).
+
+ The value must be an integer!
+ \end{command}
+\end{command}
+
\begin{command}{\pgfpathellipse\marg{center}\marg{first
axis}\marg{second axis}}
The effect of this command is to append an ellipse to the current
@@ -296,7 +461,7 @@ circles to a path are described.
\meta{second axis} are the axis \emph{vectors}. The same effect as
this command can also be achieved using an appropriate sequence of
move-to, arc, and close operations, but this command is easier and
- faster.
+ faster.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -305,7 +470,7 @@ circles to a path are described.
{\pgfpoint{1.5cm}{0cm}}
{\pgfpoint{0cm}{1cm}}
\pgfusepath{draw}
- \color{red}
+ \color{red}
\pgfpathellipse{\pgfpoint{1cm}{0cm}}
{\pgfpoint{1cm}{1cm}}
{\pgfpoint{-0.5cm}{0.5cm}}
@@ -321,12 +486,12 @@ circles to a path are described.
of the two axis vectors.
The command will update the bounding box of the current path and
- picture, if necessary.
+ picture, if necessary.
\end{command}
-\begin{command}{\pgfpathcirlce\marg{center}\marg{radius}}
+\begin{command}{\pgfpathcircle\marg{center}\marg{radius}}
A shorthand for |\pgfpathellipse| applied to \meta{center} and the
- two axis vectors $(\meta{radius},0)$ and $(0,\meta{radius})$.
+ two axis vectors $(\meta{radius},0)$ and $(0,\meta{radius})$.
\end{command}
@@ -379,7 +544,7 @@ start a new part of the path.
number of parts are added to the path, each part consisting of a
single horizontal or vertical straight line segment.
- Conceptually, the origin is part of the grid and the grid is clipped
+ Conceptually, the origin is part of the grid and the grid is clipped
to the rectangle specified by the \meta{lower left} and
the \meta{upper right} corner. However, no clipping occurs (this
command just adds parts to the current path). Rather, the points
@@ -411,7 +576,7 @@ start a new part of the path.
\end{codeexample}
The command will apply coordinate transformations and update the
bounding boxes tightly. As for ellipses, the transformations are
- applied to the ``conceptually finished'' grid.
+ applied to the ``conceptually finished'' grid.
\begin{codeexample}[]
\begin{pgfpicture}
\pgftransformrotate{10}
@@ -491,7 +656,7 @@ cosine curves in intervals that are multiples of $\pi/2$.
\end{tikzpicture}
\end{codeexample}
The command will apply coordinate transformations and update the
- bounding boxes.
+ bounding boxes.
\end{command}
\begin{command}{\pgfpathcosine\marg{vector}}
@@ -512,10 +677,11 @@ cosine curves in intervals that are multiples of $\pi/2$.
\end{pgfpicture}
\end{codeexample}
The command will apply coordinate transformations and update the
- bounding boxes.
+ bounding boxes.
\end{command}
+
\subsection{Plot Path Operations}
There exist several commands for appending
@@ -583,7 +749,7 @@ following two commands.
More or less ``all'' corners will be rounded, even the corner
generated by a |\pgfpathclose| command. (The author is a bit proud
of this feature.)
-
+
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
@@ -603,7 +769,7 @@ following two commands.
Note that the rounding will produce strange and undesirable effects
if the lines at the corners are too short. In this case the
shortening may cause the lines to ``suddenly extend over the other
- end'' which is rarely desirable.
+ end'' which is rarely desirable.
\end{command}
@@ -617,7 +783,13 @@ following two commands.
The path construction commands keep track of two bounding boxes: One
for the current path, which is reset whenever the path is used and
-thereby flushed, and a bounding box for the current |{pgfpicture}|.
+thereby flushed, and a bounding box for the current |{pgfpicture}|.
+
+\begin{command}{\pgfresetboundingbox}
+ Resets the picture's bounding box. The picture will simply forget any previous bounding box updates and start collecting from scratch.
+
+ You can use this together with |\pgfusepath{use as bounding box}| to replace the bounding box by the one of a particular path (ignoring subsequent paths).
+\end{command}
The bounding boxes are not accessible by ``normal'' macros. Rather,
two sets of four dimension variables are used for this, all of which
@@ -690,4 +862,3 @@ will set this if to false, as will certain other commands.
\begin{command}{\pgf@relevantforpicturesizetrue}
Causes updating of the picture's bounding box.
\end{command}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
index 4bf133174fd..cfb74f5b51b 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
@@ -22,7 +22,7 @@ tiling pattern and it is explained in the following how this is done.
A tiling pattern can be imagined as a rectangular tile (hence the
name) on which a small picture is painted. There is not a single tile,
-but (conceptually) an infinite number of tiles, all showing the same
+but (conceptually) an infinite number of tiles, all showing the same
picture, and these tiles are arranged horizontally and vertically to
fill the plane. When you use a tiling pattern to fill a path, what
happens is that the path clips out a ``window'' through which we see
@@ -31,7 +31,7 @@ part of this infinite plane.
Patterns come in two versions: \emph{inherently colored patterns} and
\emph{form-only patterns}. (These are often called ``color patterns''
and ``uncolored patterns,'' but these names are misleading since
-uncolored patterns do have a color and the color changes. As I said,
+uncolored patterns do have a color and the color changes. As I said,
the name is misleading\dots) An inherently colored pattern is just a
colored tile like, say, a red star with a black outline. A form-only
pattern can be imagined as a tile that is a kind of rubber stamp. When
@@ -52,7 +52,10 @@ it anymore. In particular, it is not possible to enlarge it or change
the line width. Such flexibility would require that the repeating of
the pattern were not done by the graphic language, but on the
\pgfname\ level. This would make patterns orders of magnitude slower
-to produce and to render.
+to produce and to render. However, \pgfname{} does provide a
+more-or-less successful emulation of ``mutable'' patterns, although
+internally, a new (fixed) instance of a pattern is declared when
+the parameters of a pattern change.
Second, the phase of patterns is not well-defined, that is, it is not
clear where origin of the ``first'' tile is. To be more precise,
@@ -73,12 +76,14 @@ Before a pattern can be used, it must be declared. The following
command is used for this:
\begin{command}{\pgfdeclarepatternformonly%
- \marg{name}%
- \marg{lower left}%
- \marg{upper right}%
- \marg{tile size}%
- \marg{code}}
- This command declares a new form-only pattern. The \marg{name} is a
+ \opt{\oarg{variables}}%
+ \marg{name}%
+ \marg{bottom left}%
+ \marg{top right}%
+ \marg{tile size}%
+ \marg{code}}
+
+ This command declares a new form-only pattern. The \marg{name} is a
name for later reference. The two parameters \marg{lower left} and
\marg{upper right} must describe a bounding box that is large enough
to encompass the complete tile.
@@ -94,7 +99,7 @@ command is used for this:
The \meta{code} should be \pgfname\ code than can be protocolled. It
should not contain any color code.
-
+
\begin{codeexample}[]
\pgfdeclarepatternformonly{stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
@@ -110,14 +115,72 @@ command is used for this:
\pgfusepath{fill}
}
\begin{tikzpicture}
- \filldraw[pattern=stars] (0,0) rectangle (1.5,2);
+ \filldraw[pattern=stars] (0,0) rectangle (1.5,2);
\filldraw[pattern=stars,pattern color=red]
- (1.5,0) rectangle (3,2);
+ (1.5,0) rectangle (3,2);
+\end{tikzpicture}
+\end{codeexample}
+
+ The optional argument \meta{variables} consists of a comma
+ separated list of macros, registers or keys, representing the
+ parameters of the pattern that may vary. If a variable is a key,
+ then the full path name must be used (specifically, it must start
+ with |/|).
+ As an example, a list might look like the following:
+ |\mymacro,\mydimen,/pgf/my key|. Note that macros and keys should
+ be ``simple''. They should only store values in themselves.
+
+ The effect of \meta{variables}, is the following:
+ Normally, when this argument is empty, once a pattern has been
+ declared, it becomes ``frozen''. This means that it is not possible
+ to enlarge the pattern or change the line width later on.
+ By specifying \meta{variables} no pattern is actually created.
+ Instead, the arguments are stored away
+ (so the macros, registers or keys do not have to be defined in advance).
+
+ When the fill patten is set, \pgfname{} checks if the pattern has
+ already been created with the \meta{variables} set to their current
+ values (\pgfname{} is usually ``smart enough'' to distinguish between
+ macros, registers and keys). If so, this already-declared-pattern
+ is used as the fill pattern.
+ If not, a new instance of the pattern (which will have a
+ unique internal name) is declared using the current values of
+ \meta{variables}. These values are then saved and the fill pattern
+ set accordingly.
+
+ The following shows an example of a pattern which varies
+ according to the values of the macro |\size|, the key |/tikz/radius|,
+ and the \TeX{} dimension |\thickness|.
+
+\begin{codeexample}[]
+\pgfdeclarepatternformonly[/tikz/radius,\thickness,\size]{rings}
+{\pgfpoint{-0.5*\size}{-0.5*\size}}
+{\pgfpoint{0.5*\size}{0.5*\size}}
+{\pgfpoint{\size}{\size}}
+{
+ \pgfsetlinewidth{\thickness}
+ \pgfpathcircle\pgfpointorigin{\pgfkeysvalueof{/tikz/radius}}
+ \pgfusepath{stroke}
+}
+\newdimen\thickness
+\tikzset{
+ radius/.initial=4pt,
+ size/.store in=\size, size=20pt,
+ thickness/.code={\thickness=#1},
+ thickness=0.75pt
+}
+\begin{tikzpicture}[rings/.style={pattern=rings}]
+ \filldraw [rings, radius=2pt, size=6pt] (0,0) rectangle +(1.5,2);
+ \filldraw [rings, radius=2pt, size=8pt] (2,0) rectangle +(1.5,2);
+ \filldraw [rings, radius=6pt, thickness=2pt] (0,2.5) rectangle +(1.5,2);
+ \filldraw [rings, radius=8pt, thickness=4pt] (2,2.5) rectangle +(1.5,2);
\end{tikzpicture}
\end{codeexample}
\end{command}
+
\begin{command}{\pgfdeclarepatterninherentlycolored
+ \opt{\oarg{variables}}
\marg{name}
\marg{lower left}
\marg{upper right}
@@ -126,8 +189,8 @@ command is used for this:
This command works like |\pgfdeclarepatternuncolored|, only the
pattern will have an inherent color. To set the color, you should
use \pgfname's color commands, not the |\color| command, since this
- fill not be protocolled.
-
+ fill is not protocolled.
+
\begin{codeexample}[]
\pgfdeclarepatterninherentlycolored{green stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
@@ -144,12 +207,14 @@ command is used for this:
\pgfusepath{stroke,fill}
}
\begin{tikzpicture}
- \filldraw[pattern=green stars] (0,0) rectangle (3,2);
+ \filldraw[pattern=green stars] (0,0) rectangle (3,2);
\end{tikzpicture}
\end{codeexample}
\end{command}
+
+
\subsection{Setting a Pattern}
Once a pattern has been declared, it can be used.
@@ -163,17 +228,17 @@ Once a pattern has been declared, it can be used.
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillpattern{stars}{red}
- \filldraw (0,0) rectangle (1.5,2);
+ \filldraw (0,0) rectangle (1.5,2);
\pgfsetfillpattern{green stars}{red}
- \filldraw (1.5,0) rectangle (3,2);
+ \filldraw (1.5,0) rectangle (3,2);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
index 0ce8c0df587..89b51dffbad 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
@@ -18,7 +18,7 @@ This section describes the |plot| module.
This module provides a set of commands that are intended to make it
reasonably easy to plot functions using \pgfname. It is loaded
automatically by |pgf|, but you can load it manually if you have
- only included |pgfcore|.
+ only included |pgfcore|.
\end{pgfmodule}
@@ -32,7 +32,7 @@ for whatever reason -- you wish to use \pgfname\ for generating a plot.
\pgfname\ (conceptually) uses a two-stage process for generating
plots. First, a \emph{plot stream} must be produced. This stream
-consists (more or less) of a large number of coordinates. Second a
+consists (more or less) of a large number of coordinates. Second a
\emph{plot handler} is applied to the stream. A plot handler ``does
something'' with the stream. The standard handler will issue
line-to operations to the coordinates in the stream. However, a
@@ -118,7 +118,7 @@ file and converts it into a plot stream.
\begin{codeexample}[code only]
2 -5 some text
\end{codeexample}
- is turned into
+ is turned into
\begin{codeexample}[code only]
\pgfplotstreampoint{\pgfpointxy{2}{-5}}
\end{codeexample}
@@ -128,7 +128,7 @@ file and converts it into a plot stream.
either of them is empty and, hence, ignored.
When the file has been read completely, |\pgfplotstreamend| is
- called.
+ called.
\end{command}
@@ -158,10 +158,10 @@ Currently, there is no command that can decide automatically whether
the xy-coordinate system should be used or whether the xyz-system
should be used. However, it would not be terribly difficult to write a
``smart file reader'' that parses coordinate files a bit more
-intelligently.
+intelligently.
-\begin{command}{\pgfplotfunction\marg{variable}\marg{sample list}\marg{point}}
+\begin{command}{\pgfplotfunction\marg{variable}\marg{sample list}\marg{point}}
This command will produce coordinates by iterating the
\meta{variable} over all values in \meta{sample list}, which should
be a list in the |\foreach| syntax. For each value of
@@ -172,7 +172,7 @@ intelligently.
\begin{tikzpicture}[x=3.8cm/360]
\pgfplothandlerlineto
\pgfplotfunction{\x}{0,5,...,360}{\pgfpointxy{\x}{sin(\x)+sin(3*\x)}}
- \pgfusepath{stroke}
+ \pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
@@ -180,11 +180,11 @@ intelligently.
\begin{tikzpicture}[y=3cm/360]
\pgfplothandlerlineto
\pgfplotfunction{\y}{0,5,...,360}{\pgfpointxyz{sin(2*\y)}{\y}{cos(2*\y)}}
- \pgfusepath{stroke}
+ \pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
- Be warnded that if the expressions that need to evaluated for each
+ Be warned that if the expressions that need to evaluated for each
point are complex, then this command can be very slow.
\end{command}
@@ -217,7 +217,7 @@ set terminal table; set output "#1.table"; set format "%.5f"
Assuming that the call succeeded, the next step is to invoke
|\pgfplotxyfile| on the file \meta{prefix}|.table|; which is exactly
the file that has just been created by |gnuplot|.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,-1) grid (4,1);
@@ -284,7 +284,7 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\end{command}
\begin{command}{\pgfsetmovetofirstplotpoint}
- Specifies that the line-to plot handler (and also some other plot
+ Specifies that the line-to plot handler (and also some other plot
handlers) should issue a move-to command for the
first point of the plot instead of a line-to. This will start a new
part of the current path, which is not always, but often,
@@ -311,6 +311,11 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\end{codeexample}
\end{command}
+\begin{command}{\pgfplothandlerpolygon}
+ This handler works like the line-to plot handler, only the line is
+ closed at the end using |\pgfpathclose|, resulting in a polygon.
+\end{command}
+
\begin{command}{\pgfplothandlerdiscard}
This handler will simply throw away the stream.
\end{command}
@@ -322,7 +327,7 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
commands that were issued on the stream. You can then install
another handler and invoke \meta{macro} to ``replay'' the stream
(possibly many times).
-
+
\begin{codeexample}[]
\begin{pgfpicture}
\pgfplothandlerrecord{\mystream}
@@ -338,10 +343,10 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\mystream
\pgfusepath{stroke}
\end{pgfpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
index ae7e3e142b2..931a6a7bcf9 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
@@ -38,7 +38,7 @@ coordinate.
\pgfpathcircle{\pgfpoint{2cm}{5pt}} {2pt}
\pgfpathcircle{\pgfpoint{0pt}{.5in}}{2pt}
\pgfusepath{fill}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -69,7 +69,7 @@ coordinate.
\foreach \angle in {0,10,...,90}
{\pgfpathcircle{\pgfpointpolar{\angle}{1cm/2cm}}{2pt}}
\pgfusepath{fill}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -94,19 +94,19 @@ $y$-vector do not necessarily point ``horizontally'' and
\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
\begin{command}{\pgfsetxvec\marg{point}}
Sets that current $x$-vector for usage in the $xyz$-coordinate
- system.
+ system.
\example
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
-
+
\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}
@@ -116,7 +116,7 @@ $y$-vector do not necessarily point ``horizontally'' and
\pgfpathmoveto{\pgfpointxy{1}{0}}
\pgfpathlineto{\pgfpointxy{2}{2}}
\pgfusepath{stroke}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -131,7 +131,7 @@ $y$-vector do not necessarily point ``horizontally'' and
\meta{radius} is now a factor to be interpreted in the
$xy$-coordinate system. This means that a degree of |0| is the same
as the $x$-vector of the $xy$-coordinate system times \meta{radius}
- and a degree of |90| is the $y$-vecotr times \meta{radius}. As for
+ and a degree of |90| is the $y$-vector times \meta{radius}. As for
|\pgfpointpolar|, a \meta{radius} can also be a pair separated by a
slash. In this case, the $x$- and $y$-vectors are multiplied by
different factors.
@@ -163,7 +163,7 @@ three dimensional graphics.
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetarrowsend{to}
-
+
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointxyz{0}{0}{1}}
\pgfusepath{stroke}
@@ -214,7 +214,7 @@ using spherical and cylindrical coordinates.
\pgfsetfillcolor{lightgray}
\foreach \latitude in {-90,-75,...,30}
- {
+ {
\foreach \longitude in {0,20,...,360}
{
\pgfpathmoveto{\pgfpointspherical{\longitude}{\latitude}{1}}
@@ -245,7 +245,7 @@ coordinates.
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointadd{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt}
- \pgfusepath{fill}
+ \pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -256,7 +256,7 @@ coordinates.
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointscale{1.5}{\pgfpoint{1cm}{0cm}}}{2pt}
- \pgfusepath{fill}
+ \pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -267,7 +267,7 @@ coordinates.
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\pgfpathcircle{\pgfpointdiff{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt}
- \pgfusepath{fill}
+ \pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -293,9 +293,9 @@ coordinates.
\pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt}
\pgfpathcircle{\pgfpointscale{20}
{\pgfpointnormalised{\pgfpoint{2cm}{1cm}}}}{2pt}
- \pgfusepath{fill}
+ \pgfusepath{fill}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
@@ -331,7 +331,7 @@ on Bézier curves.
\foreach \t in {0,0.25,...,1.25}
{\pgftext[at=
\pgfpointlineattime{\t}{\pgfpointorigin}{\pgfpoint{2cm}{2cm}}]{\t}}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -350,12 +350,12 @@ on Bézier curves.
\foreach \d in {0pt,20pt,40pt,70pt}
{\pgftext[at=
\pgfpointlineatdistance{\d}{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}]{\d}}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
\begin{command}{\pgfpointcurveattime\marg{time $t$}\marg{point
- $p$}\marg{point $s_1$}\marg{point $s_2$}\marg{point $q$}}
+ $p$}\marg{point $s_1$}\marg{point $s_2$}\marg{point $q$}}
Yields a point that is on the Bézier curve from $p$ to $q$ with the
support points $s_1$ and $s_2$. The time $t$ is used to determine
the location, where $t=0$ yields $p$ and $t=1$ yields $q$.
@@ -372,7 +372,7 @@ on Bézier curves.
{\pgfpoint{0cm}{2cm}}
{\pgfpoint{0cm}{2cm}}
{\pgfpoint{3cm}{2cm}}]{\t}}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -407,7 +407,7 @@ mechanism to determine border points of shapes.
\pgfpathcircle{\pgfpointborderrectangle
{\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfusepath{fill}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -432,7 +432,7 @@ mechanism to determine border points of shapes.
\pgfpathcircle{\pgfpointborderellipse
{\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt}
\pgfusepath{fill}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -456,7 +456,7 @@ mechanism to determine border points of shapes.
{\pgfpointxy{1}{2}}{\pgfpointxy{2}{0}}}
{2pt}
\pgfusepath{stroke}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
@@ -481,15 +481,92 @@ mechanism to determine border points of shapes.
{1cm}{0.8cm}{1}}
{2pt}
\pgfusepath{stroke}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{command}
+\subsubsection{Points on the Intersection of Two Paths}
+
+
+\begin{pgflibrary}{intersections}
+ This library defines the below command and allows you to calculate
+ the intersections of two arbitrary paths. However, due to the low accuracy of
+ \TeX, the paths should not be ``too complicated''.
+ In particular, you should not try to intersect paths consisting
+ lots of very small segments such as plots or decorated paths.
+\end{pgflibrary}
+
+\begin{command}{\pgfintersectionofpaths\marg{path 1}\marg{path 2}}
+ This command finds the intersection points on the paths
+ \meta{path 1} and \meta{path 2}. The number of intersection points
+ (``solutions'') that are found will be stored, and each point
+ can be accessed afterward. The code for \meta{path 1} and
+ \meta{path 2} is executed within a \TeX{} group and so can contain
+ transformations (which will be in addition to any existing
+ transformations). The code should not use the path in any way,
+ unless the path is saved first and restored afterward.
+ \pgfname{} will regard solutions as ``a bit
+ special'', in that the points returned will be ``absolute'' and
+ unaffected by any further transformations.
+
+\begin{codeexample}[]
+\begin{pgfpicture}
+\pgfintersectionofpaths
+{
+ \pgfpathellipse{\pgfpointxy{0}{0}}{\pgfpointxy{1}{0}}{\pgfpointxy{0}{2}}
+ \pgfgetpath\temppath
+ \pgfusepath{stroke}
+ \pgfsetpath\temppath
+}
+{
+ \pgftransformrotate{-30}
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpointxy{2}{2}}
+ \pgfgetpath\temppath
+ \pgfusepath{stroke}
+ \pgfsetpath\temppath
+}
+\foreach \s in {1,...,\pgfintersectionsolutions}
+ {\pgfpathcircle{\pgfpointintersectionsolution{\s}}{2pt}}
+\pgfusepath{stroke}
+\end{pgfpicture}
+\end{codeexample}
+
+ \begin{command}{\pgfintersectionsolutions}
+ After using the |\pgfintersectionofpaths| command, this \TeX-macro
+ will indicate the number of solutions found.
+ \end{command}
+
+ \begin{command}{\pgfpointintersectionsolution\marg{number}}
+ After using the |\pgfintersectionofpaths| command, this command
+ will return the point for solution \meta{number} or the origin
+ if this solution was not found.
+ By default, the intersections are simply returned in the order that
+ the intersection algorithm finds them. Unfortunately, this is not
+ necessarily a ``helpful'' ordering. However the following two
+ commands can be used to order the solutions more helpfully.
+ \end{command}
+
+\let\ifpgfintersectionsortbyfirstpath=\relax
+ \begin{command}{\pgfintersectionsortbyfirstpath}
+ Using this command will mean the solutions will be sorted along
+ \meta{path 1}.
+ \end{command}
+
+\let\ifpgfintersectionsortbysecondpath=\relax
+ \begin{command}{\pgfintersectionsortbysecondpath}
+ Using this command will mean the solutions will be sorted along
+ \meta{path 2}.
+ \end{command}
+
+\end{command}
+
+
+
\subsection{Extracting Coordinates}
There are two commands that can be used to ``extract'' the $x$- or
-$y$-coordinate of a coordinate.
+$y$-coordinate of a coordinate.
\begin{command}{\pgfextractx\marg{dimension}\marg{point}}
Sets the \TeX-\meta{dimension} to the $x$-coordinate of the point.
@@ -505,18 +582,31 @@ $y$-coordinate of a coordinate.
Like |\pgfextractx|, except for the $y$-coordinate.
\end{command}
+\begin{command}{\pgfgetlastxy\marg{macro for $x$}\marg{macro for $y$}}
+ Stores the most recently used $(x,y)$ coordinates into two macros.
+\begin{codeexample}[]
+\pgfpoint{2cm}{4cm}
+\pgfgetlastxy{\macrox}{\macroy}
+Macro $x$ is `\macrox' and macro $y$ is `\macroy'.
+\end{codeexample}
+ Since $(x,y)$ coordinates are usually assigned globally, it is safe to use this command after path operations.
+\end{command}
\subsection{Internals of How Point Commands Work}
+\label{section-internal-pointcmds}
+
As a normal user of \pgfname\ you do not need to read this section. It
is relevant only if you need to understand how the point commands work
-internally.
+internally.
When a command like |\pgfpoint{1cm}{2pt}| is called, all that happens
is that the two \TeX-dimension variables |\pgf@x| and |\pgf@y| are set
-to |1cm| and |2pt|, respectively. A command like |\pgfpathmoveto| that
+to |1cm| and |2pt|, respectively. These variables belong to the set of
+internal \pgfname\ registers, see section~\ref{section-internal-registers}
+for details. A command like |\pgfpathmoveto| that
takes a coordinate as parameter will just execute this parameter and
then use the values of |\pgf@x| and |\pgf@y| as the coordinates to
which it will move the pen on the current path.
@@ -534,7 +624,7 @@ command like |\pgfpoint| in a \TeX-scope and then make the changes of
\global\pgf@y=\pgf@y % make the change of \pgf@y persist past the scope
}
% \pgf@x and \pgf@y are now set correctly, all other variables are
-% unchanged
+% unchanged
\end{codeexample}
\makeatletter
@@ -564,7 +654,7 @@ the code of the command |\pgfpointadd|:
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
index fbc3bdae870..f43e9d29de8 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
@@ -17,7 +17,7 @@ only if you either have a very large number of commands that need to
be processed or if you expect your commands to be executed very often.
-\subsection{Quick Coordiante Commands}
+\subsection{Quick Coordinate Commands}
\begin{command}{\pgfqpoint\marg{x}\marg{y}}
This command does the same as |\pgfpoint|, but \meta{x} and \meta{y}
@@ -25,6 +25,19 @@ be processed or if you expect your commands to be executed very often.
|2cm+1pt| are not allowed.
\end{command}
+\begin{command}{\pgfqpointxy\marg{$s_x$}\marg{$s_y$}}
+ This command does the same as |\pgfpointxy|, but \meta{$s_x$} and \meta{$s_y$}
+ must be simple numbers without unit, like |1.234| or |5.0|. Mathematical expressions or units are not allows.
+\end{command}
+
+\begin{command}{\pgfqpointxyz\marg{$s_x$}\marg{$s_y$}\marg{$s_z$}}
+ As |\pgfqpointxy|, but for three-dimensional coordinates. Any argument needs to be a number without unit.
+\end{command}
+
+\begin{command}{\pgfqpointscale\marg{factor}\marg{coordinate}}
+ As |\pgfpointscale|, but \marg{factor} must be a simple number without unit, as for the other ``quick'' commands.
+\end{command}
+
\subsection{Quick Path Construction Commands}
The difference between the quick and the normal path commands is that
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
index 03e1f13aeb5..ceb90cb8adf 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
@@ -49,7 +49,7 @@ The \pgfname\ system consists of several layers:
\end{description}
Each layer will automatically load the necessary files of the layers below
-it.
+it.
In addition to the packages of these layers, there are also some
library packages. These packages provide additional definitions of
@@ -109,7 +109,7 @@ apply. In essence, the following scoping mechanisms are available:
Unfortunately, this is not always the case. \emph{Some} graphic
parameters only persist till the end of the current \TeX\ group. For
- example, when you use |\pgfsetarrows| to set the arrow tip
+ example, when you use |\pgfsetarrows| to set the arrow tip
inside a \TeX\ group, the effect lasts only till the end of the
current \TeX\ group.
\item
@@ -128,14 +128,14 @@ apply. In essence, the following scoping mechanisms are available:
constructed and used in the same |{pgfscope}|. However, we might
wish to have different coordinate transformations apply to different
points on the path. In this case, we can use \TeX\ groups to keep
- the effect local, but we could not use |{pgfscope}|.
+ the effect local, but we could not use |{pgfscope}|.
\item
The |\pgftext| command can be used to create a scope in which \TeX\
``escapes back'' to normal \TeX\ mode. The text passed to the
|\pgftext| is ``heavily guarded'' against having any effect on the
scope in which it is used. For example, it is possibly to use
another |{pgfpicture}| environment inside the argument of
- |\pgftext|.
+ |\pgftext|.
\end{enumerate}
@@ -169,7 +169,7 @@ To use \pgfname, include the following package:
\pgfname, but not any modules. That is, it will load all of the
commands described in the current part of this manual, but it will
not load frontends like \tikzname. It will also load the system
- layer. To load additional modules, use the |\usepgfmodule| command
+ layer. To load additional modules, use the |\usepgfmodule| command
explained below.
\end{package}
@@ -177,20 +177,20 @@ The following package is just a convenience.
\begin{package}{pgf}
This package loads the |pgfcore| and the two modules |shapes| and
- |plot|.
+ |plot|.
In \LaTeX, the package takes two options:
\begin{packageoption}{draft}
When this option is set, all images will be replaced by empty
rectangles. This can speedup compilation.
\end{packageoption}
-
+
\begin{packageoption}{version=\meta{version}}
Indicates that the commands of version \meta{version} need to be
defined. If you set \meta{version} to |0.65|, then a large bunch of
``compatibility commands'' are loaded. If you set \meta{version} to
|0.96|, then these compatibility commands will not be loaded.
-
+
If this option is not given at all, then the commands of all
versions are defined.
\end{packageoption}
@@ -206,7 +206,7 @@ The following package is just a convenience.
be separated by commas. Instead of curly braces, you can also
use square brackets, which is something Con\TeX t users will
like. If you try to load a module a second time, nothing will
- happen.
+ happen.
\example |\usepgfmodule{matrix,shapes}|
@@ -225,12 +225,12 @@ The following modules are available for use with |pgfcore|:
commands are explained in Section~\ref{section-plots}.
\item The |shapes| module provides commands for drawing shapes and
nodes. These commands are explained in
- Section~\ref{section-shapes}.
+ Section~\ref{section-shapes}.
\item The |decorations| module provides commands for adding
decorations to paths. These commands are explained in
- Section~\ref{section-base-decorations}.
+ Section~\ref{section-base-decorations}.
\item The |matrix| module provides the |\pgfmatrix| command. The
- commands are documented in Section~\ref{section-base-matrices}.
+ commands are documented in Section~\ref{section-base-matrices}.
\end{itemize}
@@ -248,15 +248,15 @@ defines the whole code for handling decorations.
Use this command to load further libraries. The list of libraries
should contain the names of libraries separated by commas. Instead
of curly braces, you can also use square brackets. If you try to
- load a library a second time, nothing will happen.
+ load a library a second time, nothing will happen.
\example |\usepgflibrary{arrows}|
- This command causes the the file
+ This command causes the file
|pgflibrary|\meta{library}|.code.tex| to be loaded for each \meta{library} in
the \meta{list of libraries}. This means that in order to write your
own library file, place a file of the appropriate name somewhere
- where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t
+ where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t
users can then use your library.
You should also consider adding a \tikzname\ library that simply
@@ -280,7 +280,7 @@ environment.
\begin{environment}{{pgfpicture}}
This environment will insert a \TeX\ box containing the graphic drawn by
- the \meta{environment contents} at the current position.
+ the \meta{environment contents} at the current position.
\medskip
\textbf{The size of the bounding box.}
@@ -320,7 +320,7 @@ Hello \begin{pgfpicture}
graphic. For this reason, the following two sets of code lines have
the same effect, despite the fact that the second graphic uses
``higher'' coordinates than the first:
-
+
\begin{codeexample}[]
Rectangles \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
@@ -332,7 +332,7 @@ Rectangles \begin{pgfpicture}
\end{codeexample}
You can change the baseline using the |\pgfsetbaseline| command, see
- below.
+ below.
\begin{codeexample}[]
Rectangles \begin{pgfpicture}
@@ -357,7 +357,7 @@ Rectangles \begin{pgfpicture}
\medskip
\textbf{Remembering a picture position for later reference.}
- After a picture has been typset, its position on the page is
+ After a picture has been typeset, its position on the page is
normally forgotten by \pgfname\ and also by \TeX. This means that is
not possible to reference a node in this picture later on. In
particular, it is normally impossible to draw lines between nodes in
@@ -405,7 +405,7 @@ Rectangles \begin{pgfpicture}
two runs of \TeX.) The position is not directly accessible. Rather,
the nodes mechanism will use this position if you access a node from
another picture. See Sections~\ref{section-cross-pictures-pgf}
- and~\ref{section-cross-picture-tikz} for more details.
+ and~\ref{section-cross-picture-tikz} for more details.
\end{command}
}
@@ -500,7 +500,7 @@ using the following environment:
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
-
+
\begin{codeexample}[]
\begin{pgfpicture}
\begin{pgfscope}
@@ -608,7 +608,7 @@ user.
This environment temporarily interrupts the computation of the
bounding box and sets up a new bounding box. At the beginning of the
environment the old bounding box is saved and an empty bounding box
- is installed. After the environment the orginal bounding box is
+ is installed. After the environment the original bounding box is
reinstalled as if nothing has happened.
\end{environment}
@@ -658,15 +658,15 @@ a shading into a |{pgfpicture}|.
following keys are defined for this path:
\begin{key}{/pgf/text/left}
The key causes the text box to be placed such that its left
- border is on the origin.
+ border is on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[left] {lovely}}
\end{codeexample}
\end{key}
\begin{key}{/pgf/text/right}
- Thie key causes the text box to be placed such that its right
- border is on the origin.
+ The key causes the text box to be placed such that its right
+ border is on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[right] {lovely}}
@@ -711,7 +711,7 @@ a shading into a |{pgfpicture}|.
\end{key}
\begin{key}{/pgf/text/at=\meta{point}}
Translates the origin (that is, the point where the text is
- shown) to \meta{point}.
+ shown) to \meta{point}.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}}
@@ -735,7 +735,5 @@ a shading into a |{pgfpicture}|.
\pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}}
\end{codeexample}
\end{key}
-
-\end{command}
-
+\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
index c3af156d25a..d38f6bf3759 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
@@ -50,10 +50,10 @@ should be red, which has red-green-blue (rgb) components (1,0,0). At
Instead of |rgb|, you can currently also specify |gray| as
color model, in which case only one value is needed, or |color|,
in which case you must provide the name of a color in parentheses. In
-a color specification the individual specifications must
+a color specification the individual specifications must
be separated using a semicolon, which may be followed by a whitespace
(like a space or a newline). Individual specifications must be given
-in increasing order.
+in increasing order.
\subsection{Declaring Shadings}
@@ -80,12 +80,12 @@ in increasing order.
change. By specifying a \meta{color list} you can specify
that the shading should be recalculated whenever one of the colors
listed in the list changes (this includes effects like color
- mixins). Thus, when you specify a \meta{color list},
+ mixins). Thus, when you specify a \meta{color list}, % TODOsp: mixins --> mixings? (ff) (or is here really the object meant?)
whenever the shading is used, \pgfname\ first converts the colors in the
list to \textsc{rgb} triples using the current values of the
colors and taking any mixins and blends into account. If the
resulting \textsc{rgb} triples have not yet been used, a new
- shading is internally created and used. Note that if the
+ shading is internally created and used. Note that if the
option \meta{color list} is used, then no shading is created until
the first use of |\pgfuseshading|. In particular, the colors
mentioned in the shading need not be defined when the declaration is
@@ -96,7 +96,7 @@ in increasing order.
is recalculated. Thus even colors not mentioned in the list will be
used with their current values, not with the values they had upon
declaration.
-
+
\begin{codeexample}[]
\pgfdeclarehorizontalshading[mycolor]{myshadingB}
{1cm}{rgb(0cm)=(1,0,0); color(2cm)=(mycolor)}
@@ -133,13 +133,13 @@ in increasing order.
will be the color specified for 0cm and the color of the border of
the circle will be the color for the maximum dimension given in
the \meta{color specified}. This maximum will also be the radius of
- the circle. If the \meta{center point} is not at the
+ the circle. If the \meta{center point} is not at the
origin, the whole shading inside the circle (whose size remains
exactly the same) will be distorted such that the given center now
has the color specified for 0cm. The effect of \meta{color list} is
- the same as for horizontal shadings.
+ the same as for horizontal shadings.
-\begin{codeexample}[]
+\begin{codeexample}[]
\pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}%
{rgb(0cm)=(0.9,0,0);
rgb(0.7cm)=(0.7,0,0);
@@ -162,10 +162,10 @@ in increasing order.
This command creates a \emph{functional shading}. For such a
shading, the color of each point is calculated by calling a function
that gets the coordinates of the point as input and yields the
- color as an output. Note that the function is evaluated by the
+ color as an output. Note that the function is evaluated by the
\emph{renderer}, not by \pgfname\ or \TeX or someone else at
compile-time. This means that the evaluation of this function has to
- be done \emph{extremely quickly} and the funciton should be
+ be done \emph{extremely quickly} and the function should be
\emph{very simple}. For this reason, only a very restricted set of
operations are possible in the function and functions should be
kept small. Any errors in the function will only be noticed by the
@@ -175,8 +175,8 @@ in increasing order.
simplified form of a subset of the PostScript language. This subset
will be understood by the PDF-renderer (yes, PDF-renderers do
have a basic understanding of PostScript) and also by PostScript
- renders. This subset is detailed in Seciton 3.9.4 of the
- PDF-specification (version 1.7). In essence, the specificaiton
+ renders. This subset is detailed in Section~3.9.4 of the
+ PDF-specification (version 1.7). In essence, the specification
states that these functions may contain ``expressions involving
integers, real numbers, and boolean values only. There are no
composite data structures such as strings or arrays, no procedures,
@@ -196,7 +196,7 @@ in increasing order.
coordinates of the point for which the color should be computed. The
coordinates are dimensionless and given in big points, so for the
coordinate $(50bp, 72.27pt)$ the top two stack elements would be
- \texttt{50.0} and \texttt{72.0}. Ohterwise, the (virtual) stack is
+ \texttt{50.0} and \texttt{72.0}. Otherwise, the (virtual) stack is
empty (or should be treated as if it were empty). The function
should then replace these two values by three values, representing
the red, green, and blue color of the point. The numbers should be
@@ -208,11 +208,11 @@ in increasing order.
which should be a \pgfname-point expression like
|\pgfpoint{100bp}{100bp}|. A renderer may choose to evaluate the
function at less points, but, in principle, the function will be
- evaluated for each pixel independently.
+ evaluated for each pixel independently.
Because of the rather difficult PostScript syntax, use this macro
only \emph{if you know what you are doing} (or if you are
- advanterous, of course).
+ advantageous, of course).
As for other shadings, the optional \meta{color list} is used to
determine whether a shading needs to be recalculated when a color
@@ -220,16 +220,7 @@ in increasing order.
The \meta{init code} is executed each time a shading is
(re)calculated. Typically, it will contain code to extract
- coordinates from colors (see below).
-
- Inside the PostScript function \meta{type 4 function} you cannot use
- colors directly. Rather, you must push the color components on the
- stack. For this, it is useful to call |\pgfshadecolorrgb| in the
- \meta{init code}. The macro takes a color name as input and stores
- the color's red/green/blue components real numbers between 0.0 and
- 1.0 separated by spaces (which is exactly what you need if you want
- to push it on a stack) in a macro. You can then use this macro in
- the argument \meta{type 4 function}.
+ coordinates from colors.
\begin{codeexample}[]
\pgfdeclarefunctionalshading{twospots}
@@ -239,9 +230,9 @@ in increasing order.
% Compute distance from (40bp,45bp), with x doubled
45 sub dup mul exch
40 sub dup mul 0.5 mul add sqrt
- % expontial decay
+ % exponential decay
dup mul neg 1.0005 exch exp 1.0 exch sub
- % Compute distance form (70bp,70bp) from stored coordiante, scaled
+ % Compute distance form (70bp,70bp) from stored coordinate, scaled
3 1 roll
70 sub dup mul .5 mul exch
70 sub dup mul add sqrt
@@ -253,18 +244,33 @@ in increasing order.
\pgfuseshading{twospots}
\end{codeexample}
+ Inside the PostScript function \meta{type 4 function} you cannot use
+ colors directly. Rather, you must push the color components on the
+ stack. For this, it is useful to call |\pgfshadecolorrgb| in the
+ \meta{init code}:
+
+\begin{command}{\pgfshadecolortorgb\marg{color name}\marg{macro}}
+ This command takes \meta{color name} as input and stores
+ the color's red/green/blue components real numbers between 0.0 and
+ 1.0 separated by spaces (which is exactly what you need if you want
+ to push it on a stack) in \meta{macro}. This macro can then be used
+ inside the
+ \meta{type 4 function} argument for |\pgfdeclarefunctionalshading|.
+
+
\begin{codeexample}[]
\pgfdeclarefunctionalshading[mycol]{sweep}{\pgfpoint{-1cm}{-1cm}}
{\pgfpoint{1cm}{1cm}}{\pgfshadecolortorgb{mycol}{\myrgb}}{
2 copy % whirl
- atan
+ % Calculate "safe" atan of position
+ 2 copy abs exch abs add 0.0001 ge { atan } { pop } ifelse
3 1 roll
dup mul exch
dup mul add sqrt
30 mul
add
sin
- 1 add 2 div
+ 1 add 2 div
dup
\myrgb % push mycol
5 4 roll % multiply all components by calculated value
@@ -282,6 +288,51 @@ in increasing order.
\colorlet{mycol}{red}%
\pgfuseshading{sweep}
\end{codeexample}
+
+
+In addition, three macros suffixed with |red|, |green| and |blue|
+are defined, which store the individual components of
+\meta{color name}. These can also
+be used in the \meta{type 4 function} argument.
+
+\begin{codeexample}[]
+\pgfshadecolortorgb{orange}{\mycol}
+|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue
+\end{codeexample}
+\end{command}
+
+\begin{codeexample}[]
+\pgfdeclarefunctionalshading[col1,col2,col3,col4]{bilinear interpolation}
+{\pgfpointorigin}{\pgfpoint{100bp}{100bp}}
+{
+\pgfshadecolortorgb{col1}{\first}\pgfshadecolortorgb{col2}{\second}
+\pgfshadecolortorgb{col3}{\third}\pgfshadecolortorgb{col4}{\fourth}
+}{
+ 100 div exch 100 div 2 copy % Calculate y/100 x/100.
+ neg 1 add exch neg 1 add % Calculate 1-y/100 1-x/100.
+ 3 1 roll 2 copy exch 5 2 roll 6 copy 6 copy % Set up stack.
+ \firstred mul exch \secondred mul add mul % Process red component.
+ 4 1 roll
+ \thirdred mul exch \fourthred mul add mul
+ add
+ 13 1 roll
+ \firstgreen mul exch \secondgreen mul add mul % Process green component.
+ 4 1 roll
+ \thirdgreen mul exch \fourthgreen mul add mul
+ add
+ 7 1 roll
+ \firstblue mul exch \secondblue mul add mul % Process blue component.
+ 4 1 roll
+ \thirdblue mul exch \fourthblue mul add mul
+ add
+}
+
+\colorlet{col1}{blue}
+\colorlet{col2}{yellow}
+\colorlet{col3}{red}
+\colorlet{col4}{green}
+\pgfuseshading{bilinear interpolation}
+\end{codeexample}
\end{command}
@@ -292,7 +343,7 @@ in increasing order.
Inserts a previously declared shading into the text. If you wish to
use it in a |pgfpicture| environment, you should put a |\pgfbox|
around it.
-
+
\begin{codeexample}[]
\begin{pgfpicture}
\pgfdeclareverticalshading{myshadingD}
@@ -318,16 +369,16 @@ in increasing order.
the bounding box of the current path. This bounding box is computed
automatically when a path is computed; however, it can sometimes be
(quite a bit) too large, especially when complicated curves are
- involved.
+ involved.
Inside the scope, the low-level transformation matrix is modified.
The center of the shading is translated (moved) such that it lies on
the center of the bounding box of the path. The low-level coordinate
- system is also scaled such that the shading ``covers'' the shading (the
+ system is also scaled such that the shading ``covers'' the shading (the
details are a bit more complex, see below). Then, the coordinate
- system is rotated by \meta{angle}. Finally, if the macro
+ system is rotated by \meta{angle}. Finally, if the macro
|\pgfsetadditionalshadetransform| has been used, an additional
- transformation is applied.
+ transformation is applied.
After everything has been set up, the shading is inserted. Due to
the transformations and clippings, the effect will be that the
@@ -341,9 +392,9 @@ in increasing order.
rectangle itself.
For these reasons, things work slightly differently ``in reality.''
- The shading is scaled and translated such that the
+ The shading is scaled and translated such that
the point $(50\mathrm{bp},50\mathrm{bp})$, which is the middle of
- the shading, is at the middle of the path and such that the the
+ the shading, is at the middle of the path and such that the
point $(25\mathrm{bp},25\mathrm{bp})$ is at the lower left corner of
the path and that $(75\mathrm{bp},75\mathrm{bp})$ is at upper
right corner.
@@ -354,9 +405,9 @@ in increasing order.
shading. Here is an example that demonstrates this effect:
\begin{codeexample}[]
-\pgfdeclareverticalshading{myshadingE}{100bp}
+\pgfdeclareverticalshading{myshadingE}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
-\pgfuseshading{myshadingE}
+\pgfuseshading{myshadingE}
\hskip 1cm
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
@@ -380,10 +431,10 @@ in increasing order.
place, then the rotation is done.
The following graphics show which part of the shading are actually
- shown:
+ shown:
\begin{codeexample}[]
-\pgfdeclareverticalshading{myshadingF}{100bp}
+\pgfdeclareverticalshading{myshadingF}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
\begin{tikzpicture}
\draw (50bp,50bp) node {\pgfuseshading{myshadingF}};
@@ -403,7 +454,7 @@ in increasing order.
\end{scope}
\end{tikzpicture}
\end{codeexample}
-
+
An advantage of this approach is that when you rotate a radial
shading, no distortion is introduced:
@@ -430,9 +481,9 @@ in increasing order.
and if the path is not a square, but an elongated rectangle, the
``desired'' effect results: The shading will exactly vary between
the colors at the 25bp and 75bp boundaries. Here is an example:
-
+
\begin{codeexample}[]
-\pgfdeclareverticalshading{myshadingG}{100bp}
+\pgfdeclareverticalshading{myshadingG}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
\begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
@@ -462,17 +513,17 @@ in increasing order.
\end{codeexample}
Note that rainbow shadings are \emph{way} to colorful in almost all
- applications.
+ applications.
\end{command}
\begin{command}{\pgfsetadditionalshadetransform\marg{transformation}}
This command allows you to specify an additional transformation
that should be applied to shadings when the |\pgfshadepath|
command is used. The \meta{transformation} should be
- transformation code like |\pgftransformrotate{20}|.
+ transformation code like |\pgftransformrotate{20}|.
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
index 738158f2348..44774b573b3 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
@@ -453,6 +453,15 @@ transformation matrices.
saved using |\pgfgettransform|.
\end{command}
+\begin{command}{\pgfgettransformentries\marg{macro for a}\marg{macro for b}\marg{macro for c}\marg{macro for d}\marg{macro for shift x}\marg{macro for shift y}}
+ This command is similar to |\pgfgettransform| except that it stores the current coordinate transformation matrix in a set of six macros.
+
+ The matrix can later on be reinstalled using |\pgfsettransformentries|. Furthermore, all these macros (or just a few of them) can be used as arguments for |\pgftransformcm|.
+\end{command}
+
+\begin{command}{\pgfsettransformentries\marg{a}\marg{b}\marg{c}\marg{d}\marg{shiftx}\marg{shifty}}
+ Reinstalls a coordinate transformation matrix that was previously saved using the storage command |\pgfgettransformentries|. This command can also be used to replace any previously existing coordinate transformation matrix (it is thus equivalent to |\pgftransformreset| followed by |\pgftransformcm|).
+\end{command}
\subsection{Canvas Transformations}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
index ad6c465cef6..a286fcfcd34 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
@@ -14,7 +14,7 @@
For an introduction to the notion of transparency, fadings, and
-transparency groups, please consult Section~\ref{section-tikz-transparency}.
+transparency groups, please consult Section~\ref{section-tikz-transparency}.
\subsection{Specifying a Uniform Opacity}
@@ -26,7 +26,7 @@ Specifying a stroke and/or fill opacity is quite easy.
a number between |0| and |1|, where |1| means ``fully opaque'' and
|0| means ``fully transparent.'' A value like |0.5| will cause paths
to be stroked in a semitransparent way.
-
+
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetlinewidth{5mm}
@@ -44,8 +44,8 @@ Specifying a stroke and/or fill opacity is quite easy.
Sets the opacity of filling operations. As for stroking, the
\meta{value} should be a number between |0| and~|1|.
- The ``filling transparency'' will also be used for text and images.
-
+ The ``filling transparency'' will also be used for text and images.
+
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
@@ -79,7 +79,7 @@ general: You ``paint'' the fading using any of the standard graphics
commands. In more detail: You create a normal picture, which may even
contain text, image, and shadings. Then, you create a fading based on
this picture. For this, the \emph{luminosity} of each pixel of the
-picture is analysed (the brighter the pixel, the higher the luminosity
+picture is analyzed (the brighter the pixel, the higher the luminosity
-- a black pixel has luminosity $0$, a white pixel has luminosity $1$,
a gray pixel has some intermediate value as does a red pixel). Then,
when the fading is used, the luminosity of the pixel determines the
@@ -101,7 +101,7 @@ transparent.
Let's start with an easy example. Our first fading picture is just
some text:
\begin{codeexample}[]
-\pgfdeclarefading{fading1}{\color{white}Ti\emph{k}Z}
+\pgfdeclarefading{fading1}{\color{white}Ti\emph{k}Z}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
@@ -122,7 +122,7 @@ transparent.
|pgftransparent| is defined to be the same as |black|. This allows
one to write |pgftransparent| for completely transparent parts of a
fading picture and |pgftransparent!0| for the opaque parts and
- things liek |pgftransparent!20| for parts that are 20\%
+ things like |pgftransparent!20| for parts that are 20\%
transparent.
Furthermore, the color |pgftransparent!0| (which is the same as
@@ -134,11 +134,11 @@ transparent.
we go from left to right. For this, we put a shading inside the
fading picture that has the color |pgftransparent!0| at the
left-hand side and the color |pgftransparent!100| at the right-hand
- side.
+ side.
\begin{codeexample}[]
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
- right color=pgftransparent!100] (0,0) rectangle (2,2);}
+ right color=pgftransparent!100] (0,0) rectangle (2,2);}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
@@ -191,7 +191,7 @@ are two different commands for using fadings:
\begin{codeexample}[]
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
- right color=pgftransparent!100] (0,0) rectangle (2,2);}
+ right color=pgftransparent!100] (0,0) rectangle (2,2);}
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
\fill [black!30] (0,0) arc (180:0:1);
@@ -216,12 +216,12 @@ are two different commands for using fadings:
\begin{enumerate}
\item
If the current path is empty, the command has the same effect as
- |\pgfsetfading|.
+ |\pgfsetfading|.
\item
Otherwise it is assumed that the fading has a size of 100bp times
- 100bp.
+ 100bp.
\item
- The fading is resized and shiften (using appropriate
+ The fading is resized and shifted (using appropriate
transformations) such that the position
$(25\mathrm{bp},25\mathrm{bp})$ lies at the lower-left corner of
the current path and the position $(75\mathrm{bp},75\mathrm{bp})$
@@ -244,7 +244,7 @@ are two different commands for using fadings:
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}
\pgfsetfadingforcurrentpath{fading}{}
\pgfusepath{discard}
-
+
\fill [red] (0,0) rectangle (2,1);
\pgfpathrectangle{\pgfpoint{0cm}{1cm}}{\pgfpoint{2cm}{1cm}}
@@ -272,9 +272,9 @@ Transparency groups are declared using the following commands.
\meta{environment contents} you stroke a pixel three times in
black, it is just black. Stroking it white afterwards yields a
white pixel, and so on.
- \item When the group is finished, it is painted as a whole. The
+ \item When the group is finished, it is painted as a whole. The
\emph{fill} transparency settings are now applied to the resulting
- picutre. For instance, the pixel that has been painted three times
+ picture. For instance, the pixel that has been painted three times
in black and once in white is just white at the end, so this white
color will be blended with whatever is ``behind'' the group on the
page.
@@ -289,12 +289,13 @@ Transparency groups are declared using the following commands.
since the picture's bounding box contains everything
anyway. However, if you have switched off the picture size tracking
or if you are using canvas transformations, you may have to make
- sure that the bounding box is big enough. The trick is to locallly
+ sure that the bounding box is big enough. The trick is to locally
create a picture that is ``large enough'' and then insert this
picture into the main picture while ignoring the size. The following
example shows how this is done:
-
+
+{\tikzexternaldisable
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
@@ -307,10 +308,11 @@ Transparency groups are declared using the following commands.
\node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white]
{Smoking};
\endpgftransparencygroup
- \end{tikzpicture}
+ \end{tikzpicture}
};
\end{tikzpicture}
\end{codeexample}
+}%
\begin{plainenvironment}{{pgftransparencygroup}}
@@ -325,7 +327,7 @@ Transparency groups are declared using the following commands.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
index e6a6621dbde..a9483064435 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
@@ -74,14 +74,14 @@ The files in the |generic/pgf| directory do the actual work.
When using the plain \TeX\ format, you say |\input{pgf.tex}| or
|\input{tikz.tex}|. Then, instead of |\begin{pgfpicture}| and
- |\end{pgfpicture}| you use |\pgfpicture| and |\endpgfpicture|.
+ |\end{pgfpicture}| you use |\pgfpicture| and |\endpgfpicture|.
Unlike for the \LaTeX\ format, \pgfname\ is not as good at discerning
the appropriate configuration for the plain \TeX\ format. In
particular, it can only automatically determine the correct output
format if you use |pdftex| or |tex| plus |dvips|. For all other output
formats you need to set the macro |\pgfsysdriver| to the correct
-value. See the description of using output formats later on.
+value. See the description of using output formats later on.
\pgfname\ was originally written for use with \LaTeX\ and this shows
in a number of places. Nevertheless, the plain \TeX\ support is
@@ -94,14 +94,15 @@ also just include the correct |tikz.code.tex| file.
\subsubsection{Using the Con\TeX t Format}
-When using the Con\TeX t format, you say |\usemodule[pgf]| or
-|\usemodule[tikz]|. As for the plain \TeX\ format you also have
-to replace the start- and end-of-environment tags as follows: Instead
-of |\begin{pgfpicture}| and |\end{pgfpicture}| you use
-|\startpgfpicture| and |\stoppgfpicture|; similarly, instead of
-|\begin{tikzpicture}| and |\end{tikzpicture}| you use must now use
-|\starttikzpicture| and |\stoptikzpicture|; and so on for other
-environments.
+When using the Con\TeX t format\footnote{Note that \pgfname/\tikzname{}
+ is not supported by recent Con\TeX t versions (like mark IV, the
+ Lua\TeX-aware part of Con\TeX t).}, you say |\usemodule[pgf]| or
+|\usemodule[tikz]|. As for the plain \TeX\ format you also have to
+replace the start- and end-of-environment tags as follows: Instead of
+|\begin{pgfpicture}| and |\end{pgfpicture}| you use |\startpgfpicture|
+and |\stoppgfpicture|; similarly, instead of |\begin{tikzpicture}| and
+ |\end{tikzpicture}| you use must now use |\starttikzpicture| and
+|\stoptikzpicture|; and so on for other environments.
The Con\TeX t support is very similar to the plain \TeX\ support, so
the same restrictions apply: You may have to set the output
@@ -128,7 +129,7 @@ typeset. Producing the output is (conceptually) a two-stage process:
\begin{enumerate}
\item
\TeX\ typesets your text and graphics. The result of this
- typesetting is mainly a long list of letter--coordinate pairs, plus
+ typesetting is mainly a long list of letter--coordinate pairs, plus
(possibly) some ``special'' commands. This long list of pairs
is written to something called a |.dvi|-file.
\item
@@ -145,7 +146,7 @@ its output. The |dvips| program takes this output and produces a
converted using, say, |ps2pdf|, whose name is supposed to mean
``PostScript to PDF.'' Another example of programs using this
process is the combination of |tex| and |dvipdfm|. The |dvipdfm|
-program takes a |.dvi|-file as
+program takes a |.dvi|-file as
input and translates the letter--coordinate pairs therein into
\pdf-commands, resulting in a |.pdf| file directly. Finally, the
|tex4ht| is also a program that takes a |.dvi|-file and produces an
@@ -165,7 +166,7 @@ commands.
One of the main jobs of \pgfname\ is to ``abstract way'' the
difference in the syntax of the different programs. However, this
means that support for each program has to be ``programmed,'' which is
-a time-consuming and complicated process.
+a time-consuming and complicated process.
\subsubsection{Selecting the Backend Driver}
@@ -205,7 +206,7 @@ exactly the same.
This driver has the ``complete'' functionality. This means,
everything \pgfname\ ``can do at all'' is implemented in this
- driver.
+ driver.
\end{filedescription}
\begin{filedescription}{pgfsys-dvipdfm.def}
@@ -245,7 +246,7 @@ exactly the same.
\textsc{pdf} output, depending on the command line
parameters. However, whether you produce Postscript or
\textsc{pdf} output does not change anything with respect to the
- driver.
+ driver.
This driver supports most of \pgfname's features, except for
the following restrictions:
@@ -262,7 +263,7 @@ exactly the same.
Opacity is not supported.
\item
Remembering of pictures (inter-picture connections) is not
- supported.
+ supported.
\end{enumerate}
\end{filedescription}
@@ -286,11 +287,11 @@ conversion program like |ps2pdf| or the Acrobat Distiller.
\item
In plain \TeX\ mode it does not support image inclusion.
\item
- Shading is fully implemented, but the results will not be
- as good as with a driver producing |.pdf| as output.
+ Shading is fully implemented, but the results will not be
+ as good as with a driver producing |.pdf| as output.
\item
Opacity works only in conjunction with newer versions of
- GhostScript.
+ Ghostscript.
\item
For remembering of pictures (inter-picture connections) you need
to use a recent version of |pdftex| running in DVI-mode.
@@ -299,10 +300,10 @@ conversion program like |ps2pdf| or the Acrobat Distiller.
\begin{filedescription}{pgfsys-textures.def}
This is a driver file for use with the \textsc{textures} program. It
- includes |pgfsys-common-postscript.def|.
+ includes |pgfsys-common-postscript.def|.
This driver has exactly the same restrictions as the driver for
- |dvips|.
+ |dvips|.
\end{filedescription}
You can also use the |vtex| program together with |pgfsys-vtex.def| to
@@ -323,32 +324,22 @@ graphic in your text.
|pgfsys-common-svg.def|.
When using this driver you should be aware of the following
- restrictions:
+ restrictions:
\begin{enumerate}
\item
In \LaTeX\ mode it uses |graphicx| for the graphics
- inclusion.
+ inclusion.
\item
In plain \TeX\ mode it does not support image inclusion.
\item
Remembering of pictures (inter-picture connections) is not
- supported.
+ supported.
\item
Text inside |pgfpicture|s is not supported very well. The reason
is that the \textsc{svg} specification currently does not support
- text very well and it is also not possible to correctly ``escape
- back'' to \textsc{html}. All these problems will hopefully
- disappear in the future, but currently only two kinds of text work
- reasonably well: First, plain text without math mode, special
- characters or anything else special. Second, \emph{very} simple
- mathematical text that contains subscripts or superscripts. Even
- then, variables are not correctly set in italics and, in general,
- text simple does not look very nice.
- \item
- If you use text that contains anything special, even something as
- simple as |$\alpha$|, this may corrupt the graphic since |text4ht|
- does not always produce valid \textsc{xml} code. So, once more,
- \emph{stick to very simple node text inside graphics.} Sorry.
+ text very well and, although it is possible to ``escape
+ back'' to \textsc{html}, |Tikz| has then to guess what size the text
+ rendered by the browser would have.
\item
Unlike for other output formats, the bounding box of a picture
``really crops'' the picture.
@@ -368,6 +359,74 @@ graphic in your text.
imaging model and the processing model of PostScript/\pdf\ and
\textsc{svg} are not quite the same; but they are ``close enough''
for \pgfname's purposes.
+
+ Because text is not supported very well in the
+ \textsc{svg} standard, you may wish to use the following options to
+ modify the way text is handled:
+
+ \begin{key}{/tikz/tex4ht node/escape=\meta{boolean} (default |false|)}
+ Selects the rendering method for a text node with the tex4ht driver.
+
+ When this key is set to |false|, text is translated into
+ \textsc{svg} text, which is somewhat limited: simple
+ characters (letters, numerals, punctuation, $\sum$, $\int$, \ldots),
+ subscripts and superscripts (but not subsubscripts) will display but
+ everything else will be filtered out, ignored or will produce
+ invalid \textsc{html} code (in the worst case). This means that two
+ kind of texts render reasonably well:
+ \begin{enumerate}
+ \item First, plain text without math mode, special characters or
+ anything else special.
+ \item Second, \emph{very} simple mathematical text that contains
+ subscripts or superscripts. Even then, variables are not correctly
+ set in italics and, in general, text simple does not look very
+ nice.
+ \end{enumerate}
+ If you use text that contains anything special, even something as
+ simple as |$\alpha$|, this may corrupt the graphic.
+
+\begin{codeexample}[code only]
+\tikz \node[draw,tex4ht node/escape=false] {Example : $(a+b)^2=a^2+2ab+b^2$};
+\end{codeexample}
+
+ When you write |node[tex4ht node/escape=true] {|\meta{text}|}|,
+ \tikzname\ escapes back to \textsc{html} to render the
+ \meta{text}. This method produces valid \textsc{html} code in most
+ cases and the support for complicated text nodes is much better since
+ code that renders well outside a |{tikzpicture}|, should also
+ render well inside a text node. Another advantage is that inside
+ text nodes with fixed width, \textsc{html} will produce line
+ breaks for long lines. On the other hand, you need a browser with
+ good \textsc{svg} support to display the picture. Also, the text
+ will display differently, depending on your browsers, the fonts
+ you have on your system and your settings. Finally,
+ \tikzname\ has to guess the size of the text rendered by the
+ browser to scale it and prevent it from sticking from the
+ node. When it fails, the text will be either cropped or too small.
+\begin{codeexample}[code only]
+\tikz \node[draw,tex4ht node/escape=true]
+ {Example : $\int_0^\infty\frac{1}{1+t^2}dt=\frac{\pi}{2}$};
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/tex4ht node/css=\meta{filename} (default |\string\jobname|)}
+ This option allows you to tell the browser what \textsc{css} file
+ it should use to style the display of the node (only with
+ |tex4ht node/escape=true|).
+ \end{key}
+
+ \begin{key}{/tikz/tex4ht node/class=\meta{class name} (default foreignobject)}
+ This option allows you to give a class name to the node, allowing
+ it to be styled by a \textsc{css} file (only with
+ |tex4ht node/escape=true|).
+ \end{key}
+
+ \begin{key}{/tikz/tex4ht node/id=\meta{id name} (default
+ |\string\jobname\ picture number-node number|)}
+ This option allows you to give a unique id to the node, allowing
+ it to be styled by a \textsc{css} file (only with
+ |tex4ht node/escape=true|).
+ \end{key}
\end{filedescription}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex
new file mode 100644
index 00000000000..bb7b9eb0400
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex
@@ -0,0 +1,800 @@
+% Copyright 2010 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Axes}
+\label{section-dv-axes}
+
+\subsection{Overview}
+
+To be written...
+
+
+\subsection{Concepts}
+
+\subsubsection{Axes}
+
+\subsubsection{Mayor, Minor, and Subminor Ticks}
+
+\subsubsection{Tick Placement Strategies}
+\label{section-dv-concept-tick-placement-strategies}
+
+Consider the following problem: The data visualization engine
+determines that in a
+plot the $x$-values vary between $17.4$ and $34.5$. In this case, we
+certainly do not want, say, ten ticks at exactly ten evenly spaced
+positions starting with $17.4$ and ending with $34.5$, because this
+would yield ticks at positions like $32.6$. Ticks should be placed at
+``nice'' positions like $20$, $25$, and $30$.
+
+Determining which positions are ``nice'' is somewhat difficult. In the
+above example, the positions $20$, $25$, and $30$ are certainly nice,
+but only three ticks may be a bit few of them. Better might be the
+tick positions $17.5$, $20$, $22.5$, through to $32.5$. However, users
+might prefer even numbers over fractions like $2.5$ as the stepping.
+
+A \emph{tick placement strategy} is a method of automatically deciding
+which positions are \emph{good} for placing ticks. The data
+visualization engine comes with a number of predefined strategies, see
+Section~\ref{section-dv-tick-placement-strategies}, but you can also
+define new ones yourself. When the data visualization is requested to
+automatically determine
+``good'' positions for the placement of ticks on an axis, it uses one
+of several possible \emph{basic strategies}. These strategies differ
+dramatically in which tick positions they will choose: For a range of
+values between $5$ and $1000$, a |linear steps| strategy might place
+ticks at positions $100$, $200$, through to $1000$, while an
+|exponential steps| strategy would prefer the tick positions $10$,
+$100$ and $1000$. The exact number and values of the tick positions
+chosen by either strategy can be fine-tuned using additional options
+like |step| or |about|.
+
+Here is an example of the different stepping chosen when one varies
+the tick placement strategy:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [1:11];
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+\qquad
+\begin{tikzpicture}
+ \datavisualization [scientific axes, visualize as smooth line,
+ y axis={exponential steps},
+ x axis={ticks={quarter about strategy}},
+ ]
+ data [format=function] {
+ var x : interval [1:11];
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsubsection{Grids}
+
+\subsection{Usage}
+
+
+\subsection{Reference: Standard Axis Systems}
+
+In this section the axis system commonly used in data visualizations
+are described.
+
+\subsubsection{Scientific Axis Systems}
+
+\begin{key}{/tikz/data visualization/scientific axes}
+ This key installs a two-dimensional coordinate system based on the
+ attributes |/data point/x| and |/data point/y|.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [0:100];
+ func y = sqrt(\value x);
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ This axis system is usually a good choice to depict ``arbitrary two
+ dimensional data.'' Because the axes are automatically scaled, you
+ do not need to worry about how large or small the values will
+ be. The name |scientific axes| is intended to indicate that this
+ axis system is often used in scientific publications.
+
+ Note, however, that this axis system will always distort the
+ relative magnitudes of the units on the two axis. If you wish the
+ units on both axes to be equal, consider directly specifying the
+ unit length ``by hand'':
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [visualize as smooth line,
+ scientific axes,
+ all axes={unit length=1cm per 10 units, ticks={few}}]
+ data [format=function] {
+ var x : interval [0:100];
+ func y = sqrt(\value x);
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ The |scientific axes| have the following properties:
+ \begin{itemize}
+ \item The |x|-values are surveyed and the $x$-axis is then scaled
+ and shifted so that it has the length specified by the following key.
+ \begin{key}{/tikz/data visualization/scientific
+ axes/width=\meta{dimension} (initially 5cm)}
+ \end{key}
+ The minimum value is at the left end of the axis and at the canvas
+ origin. The maximum value is at the right end of the axis.
+ \item The |y|-values are surveyed and the $y$-axis is then scaled so
+ that is has the length specified by the following key.
+ \begin{key}{/tikz/data visualization/scientific
+ axes/height=\meta{dimension}}
+ By default, the |height| is the golden ratio times the |width|.
+ \end{key}
+ The minimum value is at the bottom of the axis and at the canvas
+ origin. The maximum value is at the top of the axis.
+ \item Lines (forming a frame) are depicted at the minimum and
+ maximum values of the axes in 50\% black.
+ \item Ticks are drawn `` on the outside'' of the frame so that they
+ interfere as little as possible with the data.
+ \item Tick labels and axis labels (if present) are drawn left and
+ below.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/data visualization/scientific inner axes}
+ This axis system works like |scientific axes|, only the ticks are on
+ the ``inside'' of the frame.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific inner axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-12:12];
+ func y = \value x*\value x*\value x;
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ This axis system is also common in publications, but the ticks tend
+ to interfere with marks if they are near to the border as can be
+ seen in the following example:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific inner axes, scientific axes/width=3.2cm,
+ visualize as scatter/.list={a,b}]
+ data [a] {
+ x, y
+ 0, 0
+ 1, 1
+ 0.5, 0.5
+ 2, 1
+ }
+ data [b] {
+ x, y
+ 0.05, 0
+ 1.5, 1
+ 0.5, 0.75
+ 2, 0.5
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
+
+\begin{key}{/tikz/data visualization/scientific clean axes}
+ This axis system is another version of |scientific axes|. However, the
+ axes and the ticks are completely removed from the actual data,
+ making this axis system especially useful for scatter plots, but
+ also for most other scientific plots.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific clean axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-12:12];
+ func y = \value x*\value x*\value x;
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ The distance of the axes from the actual plot is given by the
+ padding of the axes.
+\end{key}
+
+
+For all scientific axis systems, different label placement strategies
+can be specified. They are discussed in the following.
+
+
+\begin{key}{/tikz/data visualization/scientific axes standard labels}
+ As the name suggests, this is the standard placement strategy. The
+ label of the $x$-axis is placed below the center of the $x$-axis,
+ the label of the $y$-axis is rotated by $90^\circ$ and placed left
+ of the center of the $y$-axis.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific clean axes,
+ visualize as smooth line,
+ scientific axes standard labels,
+ x axis={label=degree $d$, ticks={tick unit=${}^\circ$}},
+ y axis={label=$\sin d$}]
+ data [format=function] {
+ var x : interval [-10:10] samples 10;
+ func y = sin(\value x);
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/data visualization/scientific axes upright labels}
+ Works like |scientific axes standard labels|, only the label of the
+ $y$-axis is not rotated.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific clean axes,
+ visualize as smooth line,
+ scientific axes upright labels,
+ x axis={label=degree $d$, ticks={tick unit=${}^\circ$}},
+ y axis={label=$\cos d$,
+ ticks={style={/pgf/number format/.cd,precision=4,fixed zerofill}}}]
+ data [format=function] {
+ var x : interval [-10:10] samples 10;
+ func y = cos(\value x);
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+\begin{key}{/tikz/data visualization/scientific axes end labels}
+ Places the labels at the end of the $x$- and the $y$-axis, similar
+ to the axis labels of a school book axis system.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [scientific clean axes,
+ visualize as smooth line,
+ scientific axes end labels,
+ x axis={label=degree $d$, ticks={tick unit=${}^\circ$}},
+ y axis={label=$\tan d$}]
+ data [format=function] {
+ var x : interval [-10:10] samples 10;
+ func y = tan(\value x);
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+
+
+
+\subsubsection{School Book Axis Systems}
+
+\begin{key}{/tikz/data visualization/school book axes}
+ This axis system is intended to ``look like'' the coordinate systems
+ often used in school books: The axes are drawn in such a way that
+ they intersect to origin. Furthermore, no automatic
+ scaling is done to ensure that the lengths of units are the same in
+ all directions.
+
+ This axis system must be used with care -- it is nearly always
+ necessary to specify the desired unit length by hand using the
+ option |unit length|. If the magnitudes of the units on the two axes
+ differ, different unit lengths typically need to be specified for
+ the different axes.
+
+ Finally, if the data is ``far removed'' from the origin, this
+ axis system will also ``look bad.''
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-1.3:1.3];
+ func y = \value x*\value x*\value x;
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ The stepping of the ticks is one unit by default. Using keys like
+ |ticks=some| may help to give better steppings.
+\end{key}
+
+
+\begin{key}{/tikz/data visualization/school book axes standard labels}
+ This key makes the label of the $x$-axis appear at the right end of
+ this axis and it makes the label of the $y$-axis appear at the top
+ of the $y$-axis.
+
+ Currently, this is the only supported placement strategy for the
+ school book axis system.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes,
+ visualize as smooth line,
+ school book axes standard labels,
+ clean ticks,
+ x axis={label=$x$},
+ y axis={label=$f(x)$}]
+ data [format=function] {
+ var x : interval [-1:1];
+ func y = \value x*\value x + 1;
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+
+
+
+\subsubsection{Advanced: Underlying Cartesian Axis Systems}
+
+The axis systems described in the following are typically not used
+directly by the user. The systems setup \emph{directions} for several
+axes in some sensible way, but they do not actually draw anything on
+these axes. For instance, the |xy Cartesian| creates two axes called
+|x axis| and |y axis| and makes the $x$-axis point right and the
+$y$-axis point up. In contrast, an axis system like |scientific axes|
+uses the axis system |xy Cartesian| internally and then proceeds to
+setup a lot of keys so that the axis lines are drawn,
+ticks and grid lines are drawn, and labels are placed at the correct
+positions.
+
+\begin{key}{/tikz/data visualization/xy Cartesian}
+ This axis system creates two axes called |x axis| and |y axis| that
+ point right and up, respectively. By default, one unit is mapped to
+ one cm.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [xy Cartesian, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-1.25:1.25];
+ func y = \value x*\value x*\value x;
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+
+ \begin{key}{/tikz/data visualization/xy axes=\meta{options}}
+ This key applies the \meta{options} both to the |x axis| and the
+ |y axis|.
+ \end{key}
+
+\end{key}
+
+
+\begin{key}{/tikz/data visualization/xyz Cartesian cabinet}
+ This axis system works like |xy Cartesian|, only it
+ \emph{additionally} creates an axis called |z axis| that points left
+ and down. For this axis, one unit corresponds to $\frac{1}{2}\sin
+ 45^\circ\mathrm{cm}$. This is also known as a cabinet projection.
+
+ \begin{key}{/tikz/data visualization/xyz axes=\meta{options}}
+ This key applies the \meta{options} both to the |x axis| and the
+ |y axis|.
+ \end{key}
+
+\end{key}
+
+
+\begin{key}{/tikz/data visualization/uv Cartesian}
+ This axis system works like |xy Cartesian|, but it introduces two
+ axes called |u axis| and |v axis| rather than the |x axis| and the
+ |y axis|. The idea is that in addition to a ``major''
+ $xy$-coordinate system this is also a ``smaller'' or ``minor''
+ coordinate system in use for depicting, say, small vectors with
+ respect to this second coordinate system.
+
+ \begin{key}{/tikz/data visualization/uv axes=\meta{options}}
+ Applies the \meta{options} to both the |u axis| and the |y axis|.
+ \end{key}
+
+\end{key}
+
+\begin{key}{/tikz/data visualization/uvw Cartesian cabinet}
+ Like |xyz Cartesian cabinet|, but for the $uvw$-system.
+
+ \begin{key}{/tikz/data visualization/uvw axes=\meta{options}}
+ Like |xyz axes|.
+ \end{key}
+\end{key}
+
+
+
+\subsection{Reference: Tick Placement Strategies}
+\label{section-dv-tick-placement-strategies}
+
+As described in \ref{section-dv-concept-tick-placement-strategies},
+it is not a trivial task for the data visualization engine to
+correctly automatically determine good positions for the placement of
+ticks on axes. When the values on an axis range between, say, $17.4$
+and $34.5$, it is somewhat unclear where ticks should be placed.
+
+
+\subsubsection{Predefined Strategies}
+
+The following strategies are always available:
+
+\begin{key}{/tikz/data visualization/axis options/linear steps}
+ This strategy placed ticks at positions that are evenly spaced by
+ the current value of |step|.
+
+ In detail, the following happens: Let $a$ be the minimum value of the
+ data values along the axis and let $b$ be the maximum. Let the
+ current \emph{stepping} be $s$ (the stepping is set using the |step|
+ option, see below) and let the current \emph{phasing} be $p$ (set
+ using the |phase|) option. Then ticks are placed all positions
+ $i\cdot s + p$ that lie in the interval $[a,b]$, where $i$ ranges
+ over all integers.
+
+ The tick positions computed in the way described above are
+ \emph{mayor} step positions. In addition to these, if the key
+ |minor steps between steps| is set to some number $n$, then $n$ many
+ minor ticks are introduced between each two mayor ticks (and also
+ before and after the last mayor tick, provided the values still lie
+ in the interval $[a,b]$). Note that is $n$ is $1$, then one minor tick
+ will be added in the middle between any two mayor ticks. Use a value
+ of $9$ (not $10$) to partition the interval between two mayor ticks
+ into ten equally sized minor intervals.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization
+ [scientific inner axes, scientific axes/width=3cm,
+ x axis={ticks={step=3, minor steps between steps=2}},
+ y axis={ticks={step=.36}},
+ visualize as scatter]
+ data {
+ x, y
+ 17, 30
+ 34, 32
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/data visualization/axis options/exponential steps}
+ This strategy produces ticks at positions that are appropriate for
+ logarithmic plots. It is automatically selected when you use the
+ |logarithmic| option with an axis.
+
+ In detail, the following happens: As for |linear steps| let numbers
+ $a$, $b$, $s$, and $p$ be given. Then, mayor ticks are placed at all
+ positions $10^{i\cdot s+p}$ that lie in the interval $[a,b]$ for $i
+ \in \mathbb Z$.
+
+ The minor steps are added in the same way as for |linear steps|. In
+ particular, they interpolate \emph{linearly} between mayor steps.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization
+ [scientific axes,
+ x axis={logarithmic, length=2cm, ticks={step=1.5}},
+ y axis={logarithmic, ticks={step=1, minor steps between steps=9}},
+ visualize as scatter]
+ data {
+ x, y
+ 1, 10
+ 1000, 1000000
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+
+
+\subsubsection{Choosing a Stepping Explicitly}
+
+The following options are used to configure tick placement strategies
+like |linear steps|. Unlike the basic choice of a placement strategy,
+which is an axis option, the following should be passed to the option
+|ticks| or |grid| only.. So, you would write
+things like |x axis={ticks={step=2}}|, but |x axis=linear steps|.
+
+\begin{key}{/tikz/data visualization/step=\meta{value} (initially 1)}
+ The value of this key is used to determine the spacing of the major
+ ticks. The key is used by the |linear steps| and |exponential steps|
+ strategies described above, see the explanations there.
+\end{key}
+
+\begin{key}{/tikz/data visualization/minor steps between
+ steps=\meta{number} (default 9)}
+ As for |step|, see the explanation of |linear steps|.
+\end{key}
+
+\begin{key}{/tikz/data visualization/phase=\meta{value} (initially 0)}
+ As for |step|, see the explanation of |linear steps|.
+\end{key}
+
+
+
+\subsubsection{Choosing a Stepping Automatically}
+
+The |step| option gives you ``total control'' over the stepping of
+ticks on an axis, but you often do not know the correct stepping in
+advance. In this case, you may prefer to have a good value for |step|
+being computed for you automatically.
+
+Like the |step| key, these options are passed to the |ticks|
+option. So, for instance, you would write |x axis={ticks={about=4}}|
+to request about four ticks to be placed on the $x$-axis.
+
+
+\begin{key}{/tikz/data visualization/about=\meta{number}}
+ This key asks the data visualization to place \emph{about}
+ \meta{number} many ticks on an axis. It is not guaranteed that
+ \emph{exactly} \meta{number} many ticks will be used, rather the
+ actual number will be the closest number of ticks to \meta{number}
+ so that their stepping is still ``good''. For instance, when you say
+ |about=10|, it may happen that exactly |10|, but perhaps even |13| ticks are
+ actually selected, provided that these numbers of ticks lead to good
+ stepping values like |5| or |2.5| rather than numbers like |3.4| or
+ |7|. The method that is used to determine which steppings a deemed to
+ be ``good'' depends on the current tick placement strategy.
+
+ \medskip
+ \textbf{Linear steps.}
+ Let us start with |linear steps|: First, the difference between the
+ maximum value $v_{\max}$ and the minimum value $v_{\min}$ on the
+ axis is computed; let us call it $r$ for ``range.'' Then, $r$ is
+ divided by \meta{number},
+ yielding a target stepping~$s$. If $s$ is a number like $1$ or $5$
+ or $10$, then this number could be used directly as the new value of
+ |step|. However, $s$ will typically something strange like $0.02345$
+ or $345223.76$, so $s$ must be replaced by a better value like $0.02$
+ in the first case and perhaps $250000$ in the second case.
+
+ In order to determine which number is to be used, $s$ is rewritten
+ in the form $m \cdot 10^k$ with $1 \le m < 10$ and $k \in \mathbb
+ Z$. For instance, $0.02345$ would be rewritten as $2.345 \cdot
+ 10^{-2}$ and $345223.76$ as $3.4522376 \cdot 10^5$. The next step
+ is to replace the still not-so-good number $m$ like $2.345$ or
+ $3.452237$ by a ``good'' value $m'$. For this, the current value of
+ the |about strategy| is used:
+ \begin{key}{/tikz/data visualization/about strategy=\meta{list}}
+ The \meta{list} is a comma-separated sequence of pairs
+ \meta{threshold}/\meta{value} like for instance |1.5/1.0| or
+ |2.3/2.0|. When a good value $m'$ is sought for a given $m$, we
+ iterate over the list and find the first pair
+ \meta{threshold}/\meta{value} where \meta{threshold}
+ exceeds~$m$. Then $m'$ is set to \meta{value}. For instance, if
+ \meta{list} is |1.5/1.0,2.3/2.0,4/2.5,7/5,11/10|, which is the
+ default, then for $m=3.141$ we would get $m'=2.5$ since $4 >
+ 3.141$, but $2.3 \le 3.141$. For $m=6.3$ we would get $m'=5$.
+ \end{key}
+ Once $m'$ has been determined, the stepping is set to $s' = m'
+ \cdot 10^k$.
+
+ % Define an axis type
+ \tikzdatavisualizationset{
+ one dimensional axis/.style={
+ new Cartesian axis=axis,
+ axis={
+ attribute=main,
+ unit vector={(0pt,1pt)},
+ visualize axis={style=->},
+ visualize ticks={major={tick text at low},direction axis=perpendicular},
+ length=3cm
+ },
+ new Cartesian axis=perpendicular,
+ perpendicular={
+ attribute=perp,
+ unit vector={(1pt,0pt)},
+ include values=0,
+ include values=1
+ }
+ }
+ }
+
+ \def\showstrategy#1{
+
+ % Show the effect for the different strategies
+ \medskip
+ \begin{tikzpicture}
+ \foreach \max/\about [count=\c] in {10/5,20/5,30/5,40/5,50/5,60/5,70/5,80/5,90/5,100/5,100/3,100/10}
+ {
+ \begin{scope}[xshift=\c pt*30]
+ \datavisualization [#1,
+ one dimensional axis,
+ axis={
+ ticks={about=\about},
+ include values=0,
+ include values=\max
+ }
+ ];
+
+ \node at (0,-5mm) [anchor=mid] {\texttt{\about}};
+ \end{scope}
+ }
+
+ \node at (30pt,-5mm) [anchor=mid east] {\texttt{about=\ \ }};
+ \end{tikzpicture}
+}
+
+ The net effect of all this is that for the default strategy, the
+ only valid stepping are the values $1$, $2$, $2.5$ and $5$ and every
+ value obtainable by multiplying one of these values by a power of
+ ten. The following example shows the effects of, first, setting
+ |about=5| (corresponding to the |some| option) and then having axes
+ where the minimum value is always |0| and where the maximum value
+ ranges from |10| to |100| and, second, setting |about| to the values
+ from |3| (corresponding to the |few| option) and to |10|
+ (corresponding to the |many| option) while having the
+ minimum at |0| and the maximum at |100|:
+
+ \showstrategy{standard about strategy}
+
+ \medskip
+ \textbf{Exponential steps.}
+ For |exponential steps| the strategy for determining a good stepping
+ value is similar to |linear steps|, but with the following
+ differences:
+ \begin{itemize}
+ \item Naturally, since the stepping value refers to the exponent,
+ the whole computation of a good stepping value needs to be done
+ ``in the exponent.'' Mathematically spoken, instead of considering
+ the difference $r = v_{\max} - v_{\min}$, we consider the difference $r =
+ \log v_{\max} - \log v_{\min}$. With this difference, we still
+ compute $s = r / \meta{number}$ and let $s = m \cdot 10^k$ with $1
+ \le m < 10$.
+ \item It makes no longer sense to use values like $2.5$ for $m'$
+ since this would yield a fractional exponent. Indeed, the only
+ sensible values for $m'$ seem to be $1$, $3$, $6$, and
+ $10$. Because of this, the |about strategy| is ignored and one of
+ these values or a multiple of one of them by a power of ten is
+ used.
+ \end{itemize}
+
+ The following example shows the chosen steppings for a maximum
+ varying from $10^1$ to $10^5$ and from $10^{10}$ to $10^{50}$ as
+ well as for $10^{100}$ for |about=3|:
+
+ \medskip
+ \begin{tikzpicture}
+ \foreach \max [count=\c] in {1,...,5,10,20,...,50,100}
+ {
+ \begin{scope}[xshift=\c pt*40]
+ \datavisualization [
+ one dimensional axis,
+ axis={
+ logarithmic,
+ ticks={about=3},
+ include values=1,
+ include values=1e\max
+ }
+ ];
+ \end{scope}
+ }
+ \end{tikzpicture}
+
+
+ \medskip
+ \textbf{Alternative strategies.}
+
+ In addition to the standard |about strategy|, there are some
+ additional strategies that you might wish to use instead:
+
+ \begin{key}{/tikz/data visualization/standard about
+ strategy}
+ Permissible values for $m'$ are: $1$, $2$, $2.5$, and~$5$. This
+ strategy is the default strategy.
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/euro about strategy}
+ Permissible values for $m'$ are: $1$, $2$, and~$5$. These are the
+ same values as for the Euro coins, hence the
+ name.
+
+ \showstrategy{euro about strategy}
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/half about strategy}
+ Permissible values for $m'$: $1$ and $5$. Use this
+ strategy if only powers of $10$ or halves thereof seem logical.
+
+ \showstrategy{half about strategy}
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/quarter about strategy}
+ Permissible values for $m'$ are: $1$, $2.5$, and $5$.
+
+ \showstrategy{quarter about strategy}
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/int about strategy}
+ Permissible values for $m'$ are: $1$, $2$, $3$, $4$, and $5$.
+
+ \showstrategy{int about strategy}
+ \end{key}
+\end{key}
+
+\begin{key}{/tikz/data visualization/many}
+ This is an abbreviation for |about=10|.
+\end{key}
+
+\begin{key}{/tikz/data visualization/some}
+ This is an abbreviation for |about=5|.
+\end{key}
+
+\begin{key}{/tikz/data visualization/few}
+ This is an abbreviation for |about=3|.
+\end{key}
+
+\begin{key}{/tikz/data visualization/none}
+ Switches off the automatic step computation. Unless you use |step=|
+ explicitly to set a stepping, no ticks will be (automatically)
+ added.
+\end{key}
+
+
+
+
+\subsubsection{Advanced: Defining New Placing Strategies}
+
+\begin{key}{/tikz/data visualization/axis options/tick placement strategy=\meta{macro}}
+ This key can be used to install a so-called \emph{tick placement
+ strategy}. Whenever |visualize ticks| is used to request some
+ ticks to be visualized, it is checked whether some automatic ticks
+ should be created. This is the case when the following key is set:
+ \begin{key}{/tikz/data visualization/compute step=\meta{code}}
+ The \meta{code} should compute a suitable value for the stepping
+ to be used by the \meta{macro} in the tick placement strategy.
+
+ For instance, the |step| key sets |compute step| to
+ |\def\tikz@lib@dv@step{#1}|. Thus, when you say |step=5|, then the
+ desired stepping of |5| is communicated to the \meta{macro} via the
+ macro |\tikz@lib@dv@step|.
+ \end{key}
+
+ Provided |compute step| is set to some nonempty value, upon
+ visualization of ticks the \meta{macro} is executed. Typically,
+ \meta{macro} will first call the \meta{code} stored in the key
+ |compute step|. Then, it should implement some strategy then uses
+ the value of the computed or desired stepping to create appropriate
+ |at| commands. To be precise, it should set the keys |major|,
+ |minor|, and/or |subminor| with some appropriate |at| values.
+
+ Inside the call of \meta{macro}, the macro |\tikzdvaxis| will have
+ been set to the name of the axis for which default ticks need to be
+ computed. This allows you to access the minimum and the maximum
+ value stored in the |scaling mapper| of that axis.
+ \begin{codeexample}[]
+\def\silly{
+ \tikzdatavisualizationset{major={at={2,3,5,7,11,13}}}
+}
+\begin{tikzpicture}
+ \datavisualization [
+ scientific axes, visualize as scatter,
+ x axis={tick placement strategy=\silly}
+ ]
+ data {
+ x, y
+ 0, 0
+ 15, 15
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\subsection{Advanced: Creating New Axes}
+
+\subsection{Advanced: Creating New Axis Systems}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex
new file mode 100644
index 00000000000..ef7f0be25f1
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex
@@ -0,0 +1,22 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{The Data Visualization Backend}
+\label{section-dv-backend}
+
+\subsection{Overview}
+
+The present section explains the mechanisms behind the data
+visualization engine.
+
+\subsection{The Rendering Pipeline}
+
+\subsection{Usage}
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex
new file mode 100644
index 00000000000..fa6ea38fcbb
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex
@@ -0,0 +1,94 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+A first example:
+
+\begin{codeexample}[]
+\begin{tikzpicture}[baseline]
+ \datavisualization [
+ school book axes,
+ visualize as smooth line,
+ clean ticks,
+ all axes={grid={step=1,minor steps between steps=1}},
+ x axis={
+ ticks={some,
+ major={
+ also at={(0.5*pi) as $\pi/2$},
+ also at={(pi) as $\pi$},
+ options at=3 as [no tick text]
+ }
+ },
+ label=$x$
+ },
+ y axis={
+ label=$y$,
+ }
+ ]
+ data [format=function] {
+ var x : interval [-0.5*pi:4] samples 50;
+ func y = sin(\value x r);
+ };
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}[baseline]
+ \datavisualization [
+ scientific clean axes,
+ visualize as line,
+ all axes={padding=4pt},
+ x axis={logarithmic,
+ ticks={many, tick unit={ms},
+ node style={rotate=45,anchor=north east}},
+ label={time},
+ grid=many},
+ y axis={ticks={some},label={distance}},
+ ]
+ data {
+ x, y, z
+ 0.001, 0, 0
+ 2000, 2.23, 2
+ 20670, 1, 3
+ 501, -2, 0
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[baseline,mark=*]
+ \datavisualization [
+ scientific inner axes,
+ all axes={padding=4pt},
+ euro about strategy,
+ visualize as scatter,
+ x axis={attribute=x2},
+ y axis={attribute=y2}
+ ]
+ data [separator=\space] {
+x y x1 y1 x2 y2 x3 y3
+10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58
+8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76
+13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71
+9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84
+11.0 8.33 11.0 9.26 11.0 7.81 8.0 8.47
+14.0 9.96 14.0 8.10 14.0 8.84 8.0 7.04
+6.0 7.24 6.0 6.13 6.0 6.08 8.0 5.25
+4.0 4.26 4.0 3.10 4.0 5.39 19.0 12.50
+12.0 10.84 12.0 9.13 12.0 8.15 8.0 5.56
+7.0 4.82 7.0 7.26 7.0 6.42 8.0 7.91
+5.0 5.68 5.0 4.74 5.0 5.73 8.0 6.89
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex
new file mode 100644
index 00000000000..2afb9568a2b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex
@@ -0,0 +1,536 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Providing Data for a Data Visualization}
+\label{section-dv-formats}
+
+\subsection{Overview}
+
+The data visualization system needs a stream of data points as
+input. These data points can be directly generated by repeatedly
+calling the |\pgfdatapoint| command, but usually data is available in
+some special (text) format and one would like to visualize this
+data. The present section explains how data in some specific format
+can be fed to the data visualization system.
+
+This section starts with an explanation of the main concepts. Then,
+the standard formats are listed in the reference section. It is also
+possible to define new formats, but this an advanced concept which
+requires an understanding of some of the internals of the parsing mechanism,
+explained in Section~\ref{section-dv-parsing}, and the usage of a
+rather low-level command, explained in Section~\ref{section-dv-declaring-formats}.
+
+
+\subsection{Concepts}
+
+For the purposes of this section, let call a \emph{data format} some
+standardized way of writing down a list of data points. A simple
+example of a data format is the \textsc{csv} format (the acronym
+stands for \emph{comma separated values}), where each line contains a
+data point, specified by values separated by commas. A different
+format is the \emph{key--value format}, where data points are
+specified by lists of key--value pairs. A far more complex format is
+the \textsc{pdb}-format used by the protein database to describe
+molecules.
+
+The data visualization system does not use any specific
+format. Instead, whenever data is read by the data visualization
+system, you must specify a format parser (or it is chosen
+automatically for you). It is the job of the parser to read (parse)
+the data lines and to turn them into data points, that is, to setup
+appropriate subkeys of |/data point/|.
+
+To give a concrete example, suppose a file contains the following
+lines:
+\begin{codeexample}[code only]
+x, y, z
+0, 0, 0
+1, 1, 0
+1, 1, 0.5
+0, 1, 0.5
+\end{codeexample}
+This file is in the \textsc{csv}-format. This format can be read by
+the |table| parser (which is called thus, rather than ``|csv|,'' since
+it can also read files in which the columns are separated by, say, a
+semicolon or a space). The |table| format will then read the data and
+for each line of the data, except for the headline of course, it will
+produce one data point. For instance, for the last data point the key
+|/data point/x| will be set to |0|, the key |/data point/y| will be
+set to |1|, and the key |/data point/z| will be set to |0.5|.
+
+All parsers are basically line-oriented. This means that, normally,
+each line in the input data should contain one data point. This rule
+may not always apply, for instance empty lines are typically ignored
+and sometimes a data point may span several lines, but deviating from
+this ``one data point per line'' rule makes parsers harder to
+program.
+
+
+\subsection{Reference: Build-In Formats}
+
+The following format is the default format, when no |format=...| is
+specified.
+
+\begin{dataformat}{table}
+ This format is used to parse data that is formatted in the following
+ manner: Basically, each line consists of \emph{values} that are
+ separated by a \emph{separator} like a comma or a space. The values
+ are stored in different \emph{attributes}, that is, subkeys of
+ |/data point| like |/data point/x|. In order to decide which
+ attribute is chosen for a give value, the headline is
+ important. This is the first non-empty line of a table. It is
+ formatted in the same way as normal data lines (value separated by
+ the separator), but the meaning of the values is different: The
+ first value in the headline is the name of the attribute where the
+ first values in the following lines should go each time. Similarly,
+ the second value in the headline is the name of the attribute for
+ the second values in the following lines, and so on.
+
+ A simple example is the following:
+\begin{codeexample}[code only]
+angle, radius
+0, 1
+45, 2
+90, 3
+135, 4
+\end{codeexample}
+ The headline states that the values in the first column should be
+ stored in the |angle| attribute (|/data point/angle| to be precise)
+ and that the values in the second column should be stored in the
+ |radius| attribute. There are four data points in this data set.
+
+ The format will tolerate too few or too many values in a line. If
+ there are less values in a line than in the headline, the last
+ attributes will simply be empty. If there are more values in a line
+ than in the headline, the values are stored in attributes called
+ |/data point/attribute |\meta{column number}, where the first value
+ of a line gets \meta{column number} equal to |1| and so on.
+
+ The |table| format can be configured using the following options:
+ \begin{key}{/pgf/data/separator=\meta{character} (initially ,)}
+ Use this key to change which character is used to separate values
+ in the headline and in the data lines. To set the separator to a
+ space, either set this key to an empty value or say
+ |separator=\space|. Note that you must surround a comma by curly
+ braces if you which to (re)set the separator character to a space.
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as line]
+ data [separator=\space] {
+ x y
+ 0 0
+ 1 1
+ 2 1
+ 3 0
+ }
+ data [separator=;] {
+ x; y; z
+ 3; 1; 0
+ 2; 2; 0
+ };
+\end{tikzpicture}
+ \end{codeexample}
+ \end{key}
+ \begin{key}{/pgf/data/headline=\meta{headline}}
+ When this key is set to a non-empty value, the value of
+ \meta{headline} is used as the headline and the first line of the
+ data is treated as a normal line rather than as a headline.
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as line]
+ data [headline={x, y}] {
+ 0, 0
+ 1, 1
+ 2, 1
+ 3, 0
+ };
+\end{tikzpicture}
+ \end{codeexample}
+ \end{key}
+\end{dataformat}
+
+
+\begin{dataformat}{key value pairs}
+ Each line of the data is simply passed to the |\pgfkeys| command
+ with the path set to |/data point/|. This means that each data line
+ will typically consist of comma-separated assignments of the form
+ \meta{attribute}|=|\meta{value}.
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as line]
+ data [format=key value pairs] {
+ x=0, y=0
+ x=1, y=1
+ x=2, y=1
+ x=3, y=0
+ };
+\end{tikzpicture}
+ \end{codeexample}
+\end{dataformat}
+
+\begin{dataformat}{TeX code}
+ This format will simply execute each line of the data, each of which
+ should contain some normal TeX code. Note that at the end of each
+ line control returns to the format handler, so for instance the
+ arguments of a command may not be spread over several
+ lines. However, not each line needs to produce a data point.
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as line]
+ data [format=TeX code] {
+ \pgfkeys{/data point/.cd,x=0, y=0} \pgfdatapoint
+ \pgfkeys{/data point/.cd,x=1, y=1} \pgfdatapoint
+ \pgfkeys{/data point/x=2} \pgfdatapoint
+ \pgfkeyssetvalue{/data point/x}{3}
+ \pgfkeyssetvalue{/data point/y}{0} \pgfdatapoint
+ };
+\end{tikzpicture}
+ \end{codeexample}
+\end{dataformat}
+
+
+\subsection{Reference: Advanced Formats}
+
+\begin{tikzlibrary}{datavisualization.formats.functions}
+ This library defines the formats described in the following, which
+ allow you to specify the data points indirectly, namely via a
+ to-be-evaluated function.
+
+ \begin{dataformat}{function}
+ This format allows you to specify a function that is then
+ evaluated in order to create the desired data points. In other
+ words, the data lines do not contain the data itself, but rather
+ a functional description of the data.
+
+ The format used to specify the function works as follows: Each
+ nonempty line of the data should contain at least one of either a
+ \emph{variable declaration} or a \emph{function declaration}. A
+ variable declaration signals that a certain attribute will range
+ over a given interval. The function declarations will then, later,
+ be evaluated for values inside this interval. The syntax for a
+ variable declaration is as follows:
+ \begin{quote}
+ |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}|]|
+ \opt{|samples |\meta{number}} \opt{|step |\meta{step}}|;|
+ \end{quote}
+ The |samples| and |step| options cannot be given both at the same
+ time. If both are missing, |samples| is used with the value stored
+ in the following key:
+ \begin{key}{/pgf/data/samples=\meta{number} (initially 25)}
+ Sets the number of samples to be used when no sample number is
+ specified.
+ \end{key}
+ The meaning of a declaration like the above is the following: The
+ attribute named \meta{variable}, that is, the key
+ |/data point/|\meta{variable}, will range over the interval
+ $[\meta{low},\meta{high}]$. If the number of |samples| is given
+ (directly or indirectly), the interval is evenly divided into
+ \meta{number} many points and the attribute is set to each of
+ these values. Similarly, when a \meta{step} is specified, this
+ stepping is used to increase \meta{low} iteratively up to the
+ largest value that is still less or equal to \meta{high}.
+
+ You can specify more than one variable. In this case, each
+ variable is varied independently of the other variables. For
+ instance, if you declare an $x$-variable to range over the
+ interval $[0,1]$ in $25$ steps and you also declare a $y$-variable
+ to range over the same interval, you get a total of $625$ value
+ pairs.
+
+ The variable declarations specify which (input) variables will
+ take which values. It is the job of the \emph{function
+ declarations} to specify how some additional attributes are to
+ be computed. The syntax of a function declaration is as follows:
+ \begin{quote}
+ |func |\declare{\meta{attribute}}| = |\meta{expression}|;|
+ \end{quote}
+ The meaning of such a declaration is the following: For each
+ setting of the input variables (the variables specified using the
+ |var| declaration), evaluate the \meta{expression} using the
+ standard mathematical parser of \tikzname. The resulting value is
+ then stored in |/data point/|\meta{attribute}.
+
+ Inside \meta{expression} you can reference data point attributes
+ using the following command, which is only defined inside such an
+ expression:
+ \begin{command}{\value\marg{variable}}
+ This expands to the current value of the key |/data point/|\meta{variable}.
+ \end{command}
+
+ There can be multiple function declarations in a single data
+ specification. In this case, all of these functions will be
+ evaluated for each setting of input variables.
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-1.5:1.5];
+
+ func y = \value x * \value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as smooth line,
+ all axes={ticks={few},unit length=3mm}]
+ data [format=function] {
+ var t : interval [0:2*pi];
+
+ func x = \value t * cos(\value t r);
+ func y = \value t * sin(\value t r);
+ };
+\end{tikzpicture}
+ \end{codeexample}
+ \end{dataformat}
+
+\end{tikzlibrary}
+
+
+
+\subsection{Advanced: The Data Parsing Process}
+
+\label{section-dv-parsing}
+
+Whenever data is fed to the data visualization system, it will be
+handled by the |\pgfdata| command, declared in the |datavisualization|
+module. The command is both used to parse data stored in external
+sources (that is, in external files or which is produced on the fly by
+calling an external command) as well as data given inline. A data
+format does not need to know whether data comes from a file or is
+given inline, the |\pgfdata| command will take care of this.
+
+Since \TeX\ will always read files in a line-wise fashion, data is
+always fed to data format parsers in such a fashion. Thus, even it
+would make more sense for a format to ignore line-breaks, the parser
+must still handle data given line-by-line.
+
+Let us now have a look at how |\pgfdata| works.
+
+\begin{command}{\pgfdata\opt{\oarg{options}\marg{inline data}}}
+ This command is used to feed data to the visualization
+ pipeline. This command can only be used when a data visualization
+ object has been properly setup, see
+ Section~\ref{section-dv-main-setup}.
+
+ \medskip
+ \textbf{Basic options.}
+ The |\pgfdata| command may be followed by \meta{options}, which are
+ executed with the path |/pgf/data/|. Depending
+ on these options, the \meta{options} may either be followed by
+ \meta{inline data} or, alternatively, no \meta{inline data} is
+ present and the data is read from an external source.
+
+ The first important option is \meta{source}, which governs which of these
+ two alternatives applies:
+ \begin{key}{/pgf/data/source=\meta{filename} (initially \normalfont empty)}
+ If you set the |source| attribute to a non-empty \meta{filename},
+ the data will be read from this file. In this case, no
+ \meta{inline data} may be present, not even empty curly braces
+ should be provided. If |source| is empty, the data must directly
+ follow as \meta{inline data}.
+\begin{codeexample}[code only]
+% Data is read from two external files:
+\pgfdata[format=table,source=file1.csv]
+\pgfdata[format=table,source=file2.csv]
+\end{codeexample}
+\begin{codeexample}[code only]
+% Data is given inline:
+\pgfdata[format=table]
+{
+ x, y
+ 1, 2
+ 2, 3
+}
+\end{codeexample}
+ \end{key}
+ The second important key is |format|, which is used to specify the
+ data format:
+ \begin{key}{/pgf/data/format=\meta{format} (initially table)}
+ Use this key to locally set the format used for parsing the
+ data. The \meta{format} must be a format that has been previously
+ declared using the |\pgfdeclaredataformat| command. See the
+ reference section for a list of the predefined formats.
+ \end{key}
+ In case all your data is in a certain format, you may wish to
+ generally set the above key somewhere at the beginning of your
+ file. Alternatively, you can use the following style to setup the
+ |format| key and possibly further keys concerning the data format:
+ \begin{stylekey}{/pgf/every data}
+ This style is executed by |\pgfdata| before the \meta{options} are
+ parsed.
+
+ Note that the path of this key is just |/pgf/|, not
+ |/pgf/data/|. Also note that \tikzname\ internally sets the value
+ of this key up in such a way that the keys |/tikz/every data| and
+ also |/tikz/data visualization/every data| are executed. The
+ bottom line of this is that when using \tikzname, you should not
+ set this key directly, set |/tikz/every data| instead.
+ \end{stylekey}
+
+ \medskip
+ \textbf{Gathering of the data.}
+ Once the data format and the source have been decided upon, the data
+ is ``gathered.'' During this phase the data is not actually parsed
+ in detail, but just gathered so that it can later be parsed during
+ the visualization. There are two different ways in which the data is
+ gathered:
+ \begin{itemize}
+ \item In case you have specified an external source, the data
+ visualization object is told (by means of invoking the |add data|
+ method) that it should (later) read data from the file specified
+ by the |source| key using the format specified
+ by the |format| key. The file is not read at this point, but only
+ later during the actual visualization.
+ \item Otherwise, namely when data is given inline, depending on
+ which format is used, some catcodes get changed. This is necessary
+ since \TeX's special characters are often not-so-special in a
+ certain format.
+
+ Independently of the format, the end-of-line character
+ (carriage return) is made an active character.
+
+ Finally, the \meta{inline data} is then read as a normal argument
+ and the data visualization object is told that later on it should
+ parse this data using the given format parser. Note that in this
+ case the data visualization object must store the whole data
+ internally.
+ \end{itemize}
+ In both cases the ``data visualization object'' is the object stored
+ in the |/pgf/data visualization/obj| key.
+
+ \medskip
+ \textbf{Parsing of the data.}
+ During the actual data visualization, all code that has been added
+ to the data visualization object by means of the |add data| method
+ is executed several times. It is the job of this code to call the
+ |\pgfdatapoint| method for all data points present in the data.
+
+ When the |\pgfdata| method calls |add data|, the code that is passed
+ to the data visualization object is just a call to internal macros
+ of |\pgfdata|, which are able to parse the data stored in an
+ external file or in the inlined data. Independently of where the
+ data is stored, these macros always do the following:
+ \begin{enumerate}
+ \item The catcodes are setup according to what the data
+ format requires.
+ \item Format-specific startup code gets called, which can initialize
+ internal
+ variables of the parsing process. (The catcode changes are not
+ part of the startup code since in order to read inline data
+ |\pgfdata| must be able to setup to temporarily setup the catcodes
+ needed later on by the parsers, but since no reading is to be
+ done, no startup code should be called at this point.)
+ \item For each line of the data a format-specific code handler,
+ which depends on the
+ data format, is called. This handler gets the current line as
+ input and should call |\pgfdatapoint| once for each data point
+ that is encoded by this line (a line might define multiple data
+ points or none at all). Empty lines are handled by special
+ format-specific code.
+ \item At the end, format-specific end code is executed.
+ \end{enumerate}
+ For an example of how this works, see the description of the
+ |\pgfdeclaredataformat| command.
+\end{command}
+
+
+\subsection{Advanced: Defining New Formats}
+\label{section-dv-declaring-formats}
+
+In order to define a new data format you can use the following
+command, which is basic layer command defined in the module
+|datavisualization|:
+
+\begin{command}{\pgfdeclaredataformat\marg{format name}\marg{catcode
+ code}\marg{startup code}\marg{line arguments}\\\marg{line
+ code}\marg{empty line code}\marg{end code}}
+ This command defines a new data format called \meta{format name},
+ which can subsequently be used in the |\pgfdata| command. (The
+ \tikzname's |data| maps directly to |\pgfdata|, so the following
+ applies to \tikzname\ as well.)
+
+ As explained in the description of the |\pgfdata| command, when data
+ is being parsed that is formatted according to \meta{format name},
+ the following happens:
+ \begin{enumerate}
+ \item The \meta{catcode code} is executed. This code should just
+ contain catcode changes. The \meta{catcode code} will also be
+ executed when inline data is read.
+ \item Next, the \meta{startup code} is executed.
+ \item Next, for each non-empty line of the data, the line is passed
+ to a macro whose argument list is given by \meta{line
+ arguments} and whose body is given by \meta{line code}. The idea
+ is that you can use \TeX's powerful pattern matching capabilities
+ to parse the non-empty lines. See also the below example.
+ \item Empty lines are not processed by the \meta{line code}, but
+ rather by the \meta{empty line code}. Typically, empty lines can
+ simply be ignored and in this case you can let this parameter be
+ empty.
+ \item At the end of the data, the \meta{end code} is executed.
+ \end{enumerate}
+
+ As an example, let us now define a simple data format for reading
+ files formatted in the following manner: Each line should contain a
+ coordinate pair as in |(1.2,3.2)|, so two numbers separated by a
+ comma and surrounded by parentheses. To make things more
+ interesting, suppose that the hash mark symbol can be used to
+ indicate comments. Here is an example of some data given in this
+ format:
+\begin{codeexample}[code only]
+# This is some data formatted according to the "coordinates" format
+(0,0)
+(0.5,0.25)
+(1,1)
+(1.5,2.25)
+(2,4)
+\end{codeexample}
+
+ A format parser for this format could be defined as follows:
+\begin{codeexample}[code only]
+\pgfdeclaredataformat{coordinates}
+% First comes the catcode argument. We turn the hash mark into a comment character.
+{\catcode`\#=14\relax}
+% Second comes the startup code. Since we do not need to setup things, we can leave
+% it empty. Note that we could also set it to something like \begingroup, provided we
+% put an \endgroup in the end code
+{}
+% Now comes the arguments for non-empty lines. Well, these should be of the form
+% (#1,#2), so we specify that:
+{(#1,#2)}
+% Now we must do something with a line of this form. We store the #1 argument in
+% /data point/x and #2 in /data point/y. Then we call \pgfdatapoint to create a data point.
+{
+ \pgfkeyssetvalue{/data point/x}{#1}
+ \pgfkeyssetvalue{/data point/y}{#2}
+ \pgfdatapoint
+}
+% We ignore empty lines:
+{}
+% And we also have no end-of-line code.
+{}
+\end{codeexample}
+This format could now be used as follows:
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ \datavisualization[school book axes, visualize as smooth line]
+ data [format=coordinates] {
+ # This is some data formatted according
+ # to the "coordinates" format
+ (0,0)
+ (0.5,0.25)
+ (1,1)
+ (1.5,2.25)
+ (2,4)
+ };
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex
new file mode 100644
index 00000000000..b480f2ed589
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex
@@ -0,0 +1,159 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Introduction to Data Visualization}
+
+\emph{Data visualization} is the process of converting \emph{data
+ points,} which typically consist of multiple numerical values, into
+a graphical representation. Examples include the well-known function
+plots, but pie charts, bar diagrams, box plots, or vector fields are
+also examples of data visualizations.
+
+The data visualization subsystem of \pgfname\ takes a general, open
+approach to data visualization. Like everything else in \pgfname,
+there is a powerful, but not-so-easy-to-use basic layer in the data
+visualization system and a less flexible, but much simpler-to-use
+frontend layer. The present section gives an overview of the
+basic ideas behind the data visualization system.
+
+
+\subsection{Concept: Data Points}
+
+\label{section-dv-intro-data-points}
+
+The most important input for a data visualization is always raw
+data. This data is typically present in different formats and the data
+visualization subsystem provides methods for reading such formats and
+also for defining new input formats. However, independently of the
+input format, we may ask what kind of data the data visualization
+subsystem should be able to process. For two-dimensional plots we
+need lists of pairs of real numbers. For a bar plot we usually need a
+list of numbers, possibly together with some colors and labels. For a
+surface plot we need a matrix of triples of real numbers. For a vector
+field we need even more complex data.
+
+The data visualization subsystem makes no assumption concerning which
+kind of data is being processed. Instead, the whole
+``rendering pipeline'' is centered around a concept called the
+\emph{data point}. Conceptually, a data point is an arbitrarily
+complex record that represents one piece of data that should be
+visualized. Data points are \emph{not} just coordinates in the plane
+or the numerical values that need to be visualized. Rather, they
+represent the basic units of the data that needs to be visualized.
+
+Consider the following example: In an experiment we drive a car along
+a road and have different measurement instruments installed. We
+measure the position of the car, the time, the speed, the direction
+the car is heading, the acceleration, and perhaps some further
+values. A data point would consist of a record consisting of a
+timestamp together with the current position of the car (presumably
+two or three numbers), the speed vector (another two or three
+numbers), the acceleration (another two or three numbers), and perhaps
+the label text of the current experiment.
+
+Data points should be ``information rich.'' They might even contain
+more information than what will actually be visualized. It is the job
+of the rendering pipeline to pick out the information relevant to one
+particular data visualization -- another visualization of the same
+data might pick different aspects of the data points, thereby
+hopefully allowing new insights into the data.
+
+Technically, there is no special data structure for data
+points. Rather, when a special macro called |\pgfdatapoint| is called,
+the ``totality'' of all currently set keys with the |/data point/|
+prefix in the current scope forms the data point. This is both a very
+general approach and quite fast since no extra data structures need to
+be created.
+
+
+\subsection{Concept: Visualization Pipeline}
+
+The \emph{visualization pipeline} is a series of actions that are
+performed on the to-be-visualized data. The
+data is presented to the visualization pipeline in the form of a long
+stream of complex data points. The visualization pipeline makes
+several passes over this stream of data points. During the first
+pass(es), called the \emph{survey phase(s)}, information is gathered
+about the data points such as minimal and maximal values, which can be
+useful for automatic fitting of the data into a given area. In the
+main pass over the data, called the \emph{visualization phase}, the
+data points are actually visualized, for instance in the form of lines
+or points.
+
+Like as for data points, the visualized pipeline makes no assumptions
+concerning what kind of visualization is desired. Indeed, one could even use
+it to produce a plain-text table. This flexibility is achieved by
+extensive use of objects and signals: When a data visualization
+starts, a number of signals (see Section~\ref{section-signals} for an
+introduction to signals) are initialized. Then, numerous
+``visualization objects'' are created that listen to these
+signals. These objects are all involved in processing the data
+points. For instance, the job of an |interval mapper| object is to
+map one attribute of a data point, such as a car's velocity, to
+another, such as the $y$-axis of a plot. For each data point the
+different signals are raised in a certain order and the different
+visualization objects now have a chance of preparing the data point
+for the actual visualization. Continuing the above example, there
+might be a second |interval mapper| that takes the computed
+$y$-position and applies a logarithm to it, because a log-plot was
+requested. Then another mapper, this time a |polar mapper| might be
+used to map everything to polar coordinates. Following this, a
+|plot mark visualizer| might actually draw something at the computed
+position.
+
+The whole idea behind the rendering pipeline is that new kinds of data
+visualizations can be implemented, ideally, just by adding one or two
+new objects to the visualization pipeline. Furthermore, different
+kinds of plots can be combined in novel ways in this manner, which is
+usually very hard to do. For instance, the visualization pipeline
+makes it easy to create, say, polar-semilog-box-plots. At first sight,
+such new kinds of plots may seem frivolous, but data visualization
+is all about gaining insights into the data from as many different
+angles as possible.
+
+Naturally, creating new classes and objects for the rendering pipeline
+is not trivial, so most users will just use the existing classes,
+which should, thus, be as flexible as possible. But even when one only
+intends to use existing classes, it is still tricky to setup the
+pipeline correctly since the ordering is obviously important and since
+things like axes and ticks need to be configured and taken care
+of. For this reason, the frontend libraries provide
+preconfigured rendering pipelines so that one can simply say that a
+data visualization should look like a |line plot| with
+|school book axes| or with |scientific axes|, which selects a certain
+visualization pipeline that is appropriate for this kind of plot:
+\begin{codeexample}[]
+\begin{tikzpicture}[scale=.7]
+ \datavisualization [school book axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-2:2];
+ func y = \value x*\value x + 1;
+ };
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}[scale=.7]
+ \datavisualization [scientific axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-2:2];
+ func y = \value x*\value x + 1;
+ };
+\end{tikzpicture}
+\end{codeexample}
+One must still configure such a plot (choose styles and themes
+and also specify which attributes of a data point should be used), but
+on the whole the plot is quite simple to specify.
+
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex
new file mode 100644
index 00000000000..a2743a9fb57
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex
@@ -0,0 +1,721 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Creating Data Visualizations}
+\label{section-dv-main}
+\label{section-dv-main-setup}
+
+\subsection{Overview}
+
+The present section explains how a data visualization is created in
+\tikzname. For this, you need to include the |datavisualization|
+library and then use the command |\datavisualization| whose syntax is
+explained in the rest of the present section. This command is part of
+the following library:
+
+\begin{tikzlibrary}{datavisualization}
+ This library must be loaded if you wish to use the
+ |\datavisualization| command. It defines all styles needed to create
+ basic data visualizations; additional, more specialized libraries
+ need to be loaded for more advanced features.
+\end{tikzlibrary}
+
+
+In order to visualize, you basically need to do three things:
+\begin{enumerate}
+\item You need to select what kind of plot you would like to have (a
+ ``school book plot'' or a ``scientific 2d plot'' or a ``scientific
+ spherical plot'' etc.). This is done by passing an option to the
+ |\datavisualization| command that selects this kind of plot.
+\item You need to provide data points, which is done using the |data|
+ command.
+\item Additionally, you can add options that give you more
+ fine-grained control over the way the visualization will look. You
+ can configure the number of ticks and grid lines, where the labels
+ are placed, the colors, or the fonts. Indeed, since the
+ data visualization engine internally uses \tikzname-styles, you can
+ have extremely fine-grained control over how a plot will look like.
+\end{enumerate}
+
+The syntax of the |\datavisualization| command is designed in such a
+way that if you only need to provide very few options to create plots
+that ``look good by default''.
+
+This section is structured as follows: First, the philosophy behind
+concepts like ``data points,'' ``axes,'' or ``visualizers'' is
+explained. Each of these concepts is further detailed in later
+section. Then, the syntax of the |\datavisualization| command is
+covered. The reference sections explain which predefined plot kinds
+are available.
+
+
+\subsection{Concept: Data Points and Data Formats}
+
+As explained in Section~\ref{section-dv-intro-data-points}, data
+points are the basic entities that are processed by the data
+visualization engine. In order to specify data points, you use the
+|data| command, whose syntax is explained in more detail in
+Section~\ref{section-dv-data-syntax}. The |data| command allows you to
+either specify points ``inline,'' directly inside your \TeX-file; or
+you can specify the name of file that contains the data points.
+
+\medskip
+\textbf{Specifying data points.}
+Data points can be formatted in different ways. For instance, in the so
+called \emph{comma separated values} format, there is one line for
+each data point and the different attributes of a data point are
+separated by commas. Another common format is to specify data points
+using the so called \emph{key-value} format, where on each line the
+different attributes of a data point are set using a comma-separated
+list of strings of the form |attribute=value|.
+
+Here are two examples, where similar data is given in different
+formats:
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as smooth line]
+ data {
+ x, y
+ -1.5, 2.25
+ -1, 1
+ -.5, .25
+ 0, 0
+ .5, .25
+ 1, 1
+ 1.5, 2.25
+ };
+\end{tikzpicture}
+ \end{codeexample}
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as smooth line]
+ data [format=function] {
+ var x : interval [-1.5:1.5] samples 7;
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+
+In the first example, no format needed to be specified explicitly
+since the default format is the one used for the data following the
+|data| keyword: A list of comma-separated values, where each line
+represents a data point.
+
+\medskip
+\textbf{Number accuracy.}
+Data visualizations typically demand a much higher accuracy and range
+of values than \TeX\ provides: \TeX\ numbers are limited to 13 bits
+for the integer part and 16 bits for the fractional part. Because of
+this, the data visualization engine does not use \pgfname's standard
+representation of numbers and \TeX\ dimensions and is does not use the
+standard parser when reading numbers in a data point. Instead, the
+|fpu| library, described in Section~\ref{section-library-fpu}, is used
+to handle numbers.
+
+This use of the |fpu| library has several effects that users of the data
+visualization system should be aware of:
+\begin{enumerate}
+\item You can use numbers like |100000000000000| or |0.00000000001| in
+ a data points.
+\item Since the |fpu| library does not support advanced parsing, you
+ currently \emph{cannot} write things like |3+2| in a data point
+ number. This will result in an error
+\item However, there is a loop-hole: If a ``number'' in a data point
+ starts with a parenthesis, the value between the parentheses
+ \emph{is} parsed using the normal parser:
+ \begin{itemize}
+ \item |100000| is allowed.
+ \item |2+3| yields an error.
+ \item |(2+3)| is allowed and evaluates to |5|.
+ \item |(100000)| yields an error since $100000$ is beyond the normal
+ parser's precision.
+ \end{itemize}
+ The bottom line is that any normal calculations should be set inside
+ round parentheses, while large numbers should not be surrounded by
+ parentheses. Hopefully, in the future, these restrictions will be
+ lifted.
+\end{enumerate}
+
+
+Section~\ref{section-dv-formats} gives an
+in-depth coverage of the available data formats and explains how new
+data formats can be defined.
+
+
+
+
+\subsection{Concept: Axes, Ticks, and Grids}
+
+Most plots have two or three axes: A horizontal axis usually called
+the $x$-axis, a vertical axis called the $y$-axis, and possibly some
+axis pointing in a sloped direction called the $z$-axis. Axes are
+usually drawn as lines with \emph{ticks} indicating interesting
+positions on the axes. The data visualization engine gives you
+detailed control over where these ticks are rendered and how many of
+them are used. Great care is taken to ensure that the position of
+ticks are chosen well by default.
+
+From the point of view of the data visualization engine, axes are a
+somewhat more general concept than ``just'' lines that point ``along''
+some dimension: The data visualization engine uses axes to visualize
+any change of an attribute by varying the position of data points in the
+plane. For instance, in a polar plot, there is an ``axis'' for the
+angle and another ``axis'' for the distance if the point from the
+center. Clearly these axes vary the position of data points in the
+plane according to some attribute of the data points; but just as
+clearly they do not point in any ``direction.''
+
+A great benefit of this approach is that the powerful methods for
+specifying and automatic inference of ``good'' positions for ticks or
+grid lines apply to all sorts of situations. For instance, you can use
+it to automatically put ticks and grid lines at well-chosen angles of
+a polar plot.
+
+Typically, you will not need to specify axes explicitly. Rather,
+predefined styles take care of this for you:
+
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [
+ scientific axes,
+ x axis={length=3cm, ticks=few},
+ visualize as smooth line
+ ]
+ data [format=function] {
+ var x : interval [-1.5:1.5] samples 7;
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [
+ scientific clean axes,
+ x axis={length=3cm, ticks=few},
+ all axes={grid},
+ visualize as smooth line
+ ]
+ data [format=function] {
+ var x : interval [-1.5:1.5] samples 7;
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+
+Section~\ref{section-dv-axes} explains in more detail how axes, ticks,
+and grid lines can be chosen and configured.
+
+
+\subsection{Concept: Visualizers}
+
+Data points and axes specify \emph{what} is visualized and
+\emph{where}. A \emph{visualizer} specifies \emph{how} they are
+visualized. One of the most common visualizers is a \emph{line
+ visualizer} which connects the positions of the data points in the
+plane using a line. Another common visualizer is the \emph{scatter
+ plot visualizer} where small marks are drawn at the positions of the
+data points. More advanced visualizers include, say, box plot
+visualizers or pie chart visualizers.
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [
+ scientific clean axes,
+ x axis={length=3cm, ticks=few},
+ visualize as smooth line
+ ]
+ data [format=function] {
+ var x : interval [-1.5:1.5] samples 7;
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [
+ scientific clean axes,
+ x axis={length=3cm, ticks=few},
+ visualize as scatter
+ ]
+ data [format=function] {
+ var x : interval [-1.5:1.5] samples 7;
+ func y = \value x*\value x;
+ };
+\end{tikzpicture}
+ \end{codeexample}
+
+Section~\ref{section-dv-visualizers} provides more information on
+visualizers as well as reference lists.
+
+
+\subsection{Concept: Style Sheets and Legends}
+
+A single data visualizations may use more than one visualizer. For
+instance, if you wish to create a plot containing several lines, a
+separate visualizer is used for each line. In this case, two problems
+arise:
+
+\begin{enumerate}
+\item You may wish to make it easy for the reader to differentiate
+ between the different visualizers. For instance, one line should be
+ black, another should be red, and another blue. Alternatively, you
+ might wish one line to be solid, another to be dashed, and a third
+ to be dotted.
+
+ Specifying such styles is trickier than one might expect; experience
+ shows that many plots use ill-chosen and inconsistent
+ styling. For this reason, the data visualization introduces the
+ notion of \emph{style sheets} for visualizers and comes with some
+ well-designed predefined style sheets.
+\item You may wish to add information concerning what the different
+ visualizers represent. This is typically done using a legend, but it
+ is even better to add labels directly inside the visualization. Both
+ approaches are supported.
+\end{enumerate}
+
+An example where three functions are plotted and a legend is added is
+shown below. Two style sheets are used so that \emph{both} the
+coloring and the dashing is varied.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[baseline]
+ \datavisualization [ scientific clean axes,
+ y axis=grid,
+ visualize as smooth line/.list={sin,cos,tan},
+ visualizer style sheet=strong colors,
+ visualizer style sheet=vary dashing,
+ sin={label in legend={text=$\sin x$}},
+ cos={label in legend={text=$\cos x$}},
+ tan={label in legend={text=$\tan x$}},
+ data/format=function ]
+ data [sin] {
+ var x : interval [-0.5*pi:4];
+ func y = sin(\value x r);
+ }
+ data [cos] {
+ var x : interval [-0.5*pi:4];
+ func y = cos(\value x r);
+ }
+ data [tan] {
+ var x : interval [-0.3*pi:.3*pi];
+ func y = tan(\value x r);
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+Section~\ref{section-dv-style-sheets} details style sheets and
+legends.
+
+
+\subsection{Usage}
+\label{section-dv-data-syntax}
+
+Inside a \tikzname\ picture you can use the |\datavisualization|
+command to create a data visualization. You can use this command
+several times in a picture to create pictures containing multiple data
+visualizations.
+
+\begin{command}{\datavisualization\opt{\oarg{data visualization
+ options}}\meta{data specification}|;|}
+ This command is available only inside a |{tikzpicture}| environment.
+
+ The \meta{data visualization options} are used to configure the data visualization,
+ that is, how the data is to be depicted. The options are executed
+ with the path prefix |/tikz/data visualization|. This means that
+ normal \tikzname\ options like |thin| or |red| cannot be used
+ here. Rather, a large number of options specific to data
+ visualizations are available.
+
+ As a minimum, you should specify at least two options: First, you
+ should use an option that selects an axis system that is appropriate
+ for your plot. Typical possible keys are |school book axes| or
+ |scientific axes|, detailed information on them can be found in
+ Section~\ref{section-dv-axes}.
+
+ Second, you use an option to select
+ \emph{how} the data should be visualized. This is done using a key
+ like |visualize as line| which will, as the name suggests, visualize
+ the data by connecting data points in the plane using a
+ line. Similarly, |visualize as smooth cycle| will try to fit a smooth
+ cycle through the data points. Detailed information on possible
+ visualizers can be found in Section~\ref{section-dv-visualizers}.
+
+ Following these options, the \meta{data specification} is used to
+ provide the actual to-be-visualized data. The syntax is somewhat
+ similar to commands like |\path|: The \meta{data
+ specification} is a sequence of keywords followed by local options
+ and parameters, terminated with a semicolon. (Indeed, like for the
+ |\path| command, the \meta{data visualizers options} need not be
+ specified at the beginning, but additional option surrounded by
+ square brackets may be given anywhere inside the \meta{data specification}.)
+
+ The different possible keywords inside the \meta{data specification}
+ are explained in the following.
+\end{command}
+
+
+\begin{datavisualizationoperation}{data}{\opt{\oarg{options}}\opt{\marg{inline
+ data}}}
+ This command is used to specify data for the data visualization. It
+ can be used several times inside a single visualization and each
+ time the to-be-read data may have a different format, but the data
+ will be visualized as if it have been specified inside a single |data|
+ command.
+
+ The behaviour of the |data| command depends on
+ whether the \meta{inline data} is present. If it is not present, the
+ \meta{options} must be used to specify a source file from which the
+ data is read; if the \meta{inline data} is present no file will be
+ used, instead the data should directly reside inside the \TeX-file
+ and be given between the curly braces surrounding the \meta{inline
+ data}.
+
+ The \meta{options} are executed with the prefix |/pgf/data|. The
+ following options are always available:
+ \begin{key}{/pgf/data/source=\meta{filename} (initially \normalfont empty)}
+ If you set the |source| attribute to a non-empty \meta{filename},
+ the data will be read from this file. In this case, no
+ \meta{inline data} may be present, not even empty curly braces
+ should be provided.
+\begin{codeexample}[code only]
+\datavisualization ...
+ data [source=file1.csv]
+ data [source=file2.csv];
+\end{codeexample}
+ The other way round, if |source| is empty, the data must directly
+ follow as \meta{inline data}.
+\begin{codeexample}[code only]
+\datavisualization ...
+ data {
+ x, y
+ 1, 2
+ 2, 3
+ };
+\end{codeexample}
+ \end{key}
+ The second important key is |format|, which is used to specify the
+ data format:
+ \begin{key}{/pgf/data/format=\meta{format} (initially table)}
+ Use this key to locally set the format used for parsing the
+ data, see Section~\ref{section-dv-formats} for a list of
+ predefined formats.
+
+ The default format is the |table|-format, also known as
+ ``comma-separated values.'' The first line contains names of
+ attributes separated by commas, all following lines constitute a
+ data point where the attributes are given by the comma-separated
+ values in that line.
+ \end{key}
+
+ \medskip
+ \textbf{Presetting attributes.}
+ Normally, the inline data or the external data contains for each
+ data point the values of the different attributes. However,
+ sometimes you may also wish to set an attribute to a fixed value for
+ all data points of a data set. Suppose, for instance, that you have
+ to source files |experiment007.csv| and |experiment023.csv| and you
+ would like that for all data points of the first file the attribute
+ |/data point/experiment id| is set to 7 while for the data points of
+ the second file they are set to 23. In this case, you can specify
+ the desired settings using an absolute path inside the
+ \meta{options}. The effect will be local to the current |data|
+ command:
+\begin{codeexample}[code only]
+\datavisualization...
+ data [/data point/experiment=7, source=experiment007.csv]
+ data [/data point/experiment=23, source=experiment023.csv];
+\end{codeexample}
+
+ \begin{codeexample}[]
+\begin{tikzpicture}
+ \datavisualization [school book axes, visualize as line]
+ data [/data point/x=1] {
+ y
+ 1
+ 2
+ }
+ data [/data point/x=2] {
+ y
+ 2
+ 0.5
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ \medskip
+ \textbf{Setting options for multiple |data| commands.}
+ You may wish to generally set the format once and for all. This can
+ be done by using the following key:
+ \begin{stylekey}{/tikz/every data}
+ This key is executed for every |data| command.
+ \end{stylekey}
+
+ Another way of passing options to multiple |data| commands is to use
+ the following facility: Whenever an option with the path
+ |/tikz/data visualization/data| is used, the path will be remapped
+ to |/pgf/data|. This means, in particular, that you can pass an
+ option like |data/format=table| to the |\datavisualization| command
+ to set the data format for all |data| commands of the data
+ visualization.
+
+ \medskip
+ \textbf{Parsing inline data.}
+ When you specify data inline, \TeX\ needs to read the data
+ ``line-by-line,'' while \TeX\ normally largely ignores end-of-line
+ characters. For this reason, the data visualization system
+ temporarily changes the meaning of the end-of-line character. This
+ is only possible if \TeX\ has not already processed the data in some
+ other way (namely as the parameter to some macro).
+
+ The bottom line is that you cannot use inline data when the whole
+ |\datavisualization| command is passed as a parameter to some
+ macro that is not setup to handle ``fragile'' code. For instance, in
+ a \textsc{beamer} |frame| you need to add the |fragile| option when
+ a data visualization contains inline data.
+
+ The problem does not arise when an external data |source| is
+ specified.
+\end{datavisualizationoperation}
+
+
+
+\begin{datavisualizationoperation}{scope}{\opt{\oarg{options}}\marg{data
+ specification}}
+ Scopes can be used to nest hierarchical data sets. The
+ \meta{options} will be executed with the path |/pgf/data| and will
+ only apply to the data sets specified inside the \meta{data
+ specification}, which may contain |data| or |scope| commands once more:
+\begin{codeexample}[code only]
+\datavisualization...
+ scope [/data point/experiment=7]
+ {
+ data [source=experiment007-part1.csv]
+ data [source=experiment007-part2.csv]
+ data [source=experiment007-part3.csv]
+ }
+ scope [/data point/experiment=23, format=foo]
+ {
+ data [source=experiment023-part1.foo]
+ data [source=experiment023-part2.foo]
+ };
+\end{codeexample}
+\end{datavisualizationoperation}
+
+
+\begin{datavisualizationoperation}{info}{\opt{\oarg{options}}\marg{code}}
+ This command will execute normal \tikzname\ \meta{code} at the end
+ of a data visualization. The \meta{options} are executed with the
+ normal path |/tikz/|.
+
+ The only difference between this command and just giving the
+ \meta{code} directly following the data visualization is that inside
+ the \meta{code} following an |info| command you still have access
+ to the coordinate system of the data visualization. In sharp
+ contrast, \tikzname\ code given after a data visualization can no
+ longer access this coordinate system.
+
+
+\begin{codeexample}[]
+\begin{tikzpicture}[baseline]
+ \datavisualization [ school book axes, visualize as line ]
+ data [format=function] {
+ var x : interval [-0.1*pi:2];
+ func y = sin(\value x r);
+ }
+ info {
+ \draw [red] (visualization cs: x={(.5*pi)}, y=1) circle (1pt)
+ node [above,font=\footnotesize] {extremal point};
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+ As can be seen, inside a data visualization a special coordinate
+ system is available:
+
+ \begin{coordinatesystem}{visualization}
+ As for other coordinate systems, the syntax is
+ \declare{|(visualization cs:|\meta{list
+ of attribute-value pairs}|)|}. The effect is the following:
+ For each pair \meta{attribute}|=|\meta{value} in the \meta{list}
+ the key |/data point/|\meta{attribute} is set to
+ \meta{value}. Then, it is computed where the resulting data point
+ ``would lie'' on the canvas (however, no data point is passed to
+ the visualizers).
+ \end{coordinatesystem}
+\end{datavisualizationoperation}
+
+In order to put information \emph{behind} the data visualization,
+you should usually use the |background| library and the background
+layer. However, it is also possible to execute code at other points
+during the data visualization process. Since this is potentially
+more disruptive, special keys documented in
+Section~\ref{section-dv-user-code} must be used.
+
+
+
+\subsection{Advanced: Executing User Code During a Data Visualization}
+\label{section-dv-user-code}
+
+The following keys can be passed to the |\datavisualization| command
+and allow you to execute some code at some special time during the
+data visualization process. For details of the process and on which
+signals are emitted when,
+see Section~\ref{section-dv-backend}.
+
+\begin{key}{/tikz/data visualization/before survey=\meta{code}}
+ The \meta{code} is passed to the |before survey| method of the data
+ visualization object and then executed at the appropriate time (see
+ Section~\ref{section-dv-backend} for details).
+
+ The following commands work likewise:
+\end{key}
+\begin{key}{/tikz/data visualization/at start survey=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/at end survey=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/after survey=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/before visualization=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/at start visualization=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/at end visualization=\meta{code}}
+\end{key}
+\begin{key}{/tikz/data visualization/after visualization=\meta{code}}
+\end{key}
+
+
+
+\subsection{Advanced: Creating New Objects}
+
+You will need the following key only when you wish to create new
+rendering pipelines from scratch -- instead of modifying an existing
+pipeline as you would normally do. In the following it is assumed that
+you are familiar with the concepts of Section~\ref{section-dv-backend}.
+
+\begin{key}{/tikz/data visualization/new object=\meta{options}}
+ This key servers two purposes:
+ \begin{enumerate}
+ \item
+ This method makes it easy to create a new object as part of the
+ rendering pipeline, using \meta{options} to specify arguments rather
+ that directly calling |\pgfoonew|. Since you have the full power
+ of the keys mechanism at your disposal, it is easy, for instance,
+ to control whether or not parameters to the constructor are
+ expanded or not.
+ \item
+ The object is not created immediately, but only just before the
+ visualization starts. This allows you to specify that an object
+ must be created, but the parameter values of for its constructor
+ may depend on keys that are not yet set. A typical application is
+ the creating of an axis object: When you say |scientific axes|,
+ the |new object| command is used internally to create two
+ objects representing these axes. However, keys like
+ |x={length=5cm}| can only \emph{later} be used to specify the
+ parameters that need to be passed to the constructor of the
+ objects.
+ \end{enumerate}
+
+ The following keys may be used inside the \meta{options}:
+ \begin{key}{/tikz/data visualization/class=\meta{class name}}
+ The class of the to-be-created object.
+ \end{key}
+ \begin{key}{/tikz/data visualization/when=\meta{phase name}
+ (initially before survey)}
+ This key is used to specify when the object is to be created. As
+ described above, the object is not created immediately, but at
+ some time during the rendering process. You can specify any of the
+ phases defined by the data visualization object, see
+ Section~\ref{section-dv-backend} for details.
+ \end{key}
+ \begin{key}{/tikz/data visualization/store=\meta{key name}}
+ If the \meta{key name} is not empty, once the object has been
+ created, a handle to the object will be stored in \meta{key
+ name}. If a handle is already stored in \meta{key name}, the
+ object is not created twice.
+ \end{key}
+ \begin{key}{/tikz/data visualization/before creation=\meta{code}}
+ This code is executed right before the object is finally
+ created. It can be used to compute values that are then passed to
+ the constructor.
+ \end{key}
+ \begin{key}{/tikz/data visualization/after creation=\meta{code}}
+ This code is executed right after the object has just been
+ created. A handle to the just-created object is available in
+ |\tikzdvobj|.
+ \end{key}
+ \begin{key}{/tikz/data visualization/arg1=\meta{value}}
+ The value to be passed as the first parameter to the
+ constructor. Similarly, the keys |arg2| to |arg8| specify further
+ parameters passed. Naturally, only as many arguments are passed as
+ parameters are set. Here is an example:
+\begin{codeexample}[code only]
+\tikzdatavisualizationset{
+ new object={
+ class = example class,
+ arg1 = foo,
+ arg2 = \bar
+ }
+}
+\end{codeexample}
+ causes the following object creation code to be executed later on:
+\begin{codeexample}[code only]
+\pgfoonew \tikzdvobj=new example class(foo,\bar)
+\end{codeexample}
+ Note that you key mechanisms like |.expand once| to pass the value of
+ a macro instead of the macro itself:
+\begin{codeexample}[code only]
+\tikzdatavisualizationset{
+ new object={
+ class = example class,
+ arg1 = foo,
+ arg2/.expand once = \bar
+ }
+}
+\end{codeexample}
+ Now, if |\bar| is set to |This \emph{is} it.| at the moment to
+ object is created later on, the following object creation code is executed:
+\begin{codeexample}[code only]
+\pgfoonew \tikzdvobj=new example class(foo,This \emph{is} it)
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/arg1 from key=\meta{key}}
+ Works like the |arg1|, only the value that is passed to the
+ constructor is the current value of the specified \meta{key} at
+ the moment when the object is created.
+\begin{codeexample}[code only]
+\tikzdatavisualizationset{
+ new object={
+ class = example class,
+ arg1 from key = /tikz/some key
+ }
+}
+\tikzset{some key/.initial=foobar}
+\end{codeexample}
+ causes the following to be executed:
+\begin{codeexample}[code only]
+\pgfoonew \tikzdvobj=new example class(foobar)
+\end{codeexample}
+ Naturally, the keys |arg2 from key| to |arg8 from key| are also
+ provided.
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/arg1 handle from key=\meta{key}}
+ Works like the |arg1 from key|, only the key must store an object
+ and instead of the object a handle to the object is passed to the
+ constructor.
+ \end{key}
+\end{key}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex
new file mode 100644
index 00000000000..44c866cd04b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex
@@ -0,0 +1,29 @@
+% Copyright 2010 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Style Sheets and Legends}
+\label{section-dv-style-sheets}
+
+\subsection{Overview}
+
+To be written...
+
+\subsection{Concepts: Style Sheets}
+
+\subsection{Concepts: Legends}
+
+\subsection{Usage: Selecting Style Sheets}
+
+\subsection{Usage: Labeling Visualizations}
+
+\subsection{Reference: Style Sheets for Lines}
+
+\subsection{Reference: Color Style Sheets}
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex
new file mode 100644
index 00000000000..f7633ceae70
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex
@@ -0,0 +1,22 @@
+% Copyright 2010 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Visualizers}
+\label{section-dv-visualizers}
+
+\subsection{Overview}
+
+To be written...
+
+\subsection{Concepts}
+
+\subsection{Usage}
+
+\subsection{Reference: Basic Visualizers}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
index 9d7617d6c38..4436a3ab3fb 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
@@ -18,11 +18,11 @@ The guidelines in this section come from different sources. Many of
them are just what I would like to claim is ``common sense,'' some
reflect my personal experience (though, hopefully, not my personal
preferences), some come from books (the bibliography is still missing,
-sorry) on graphic design and typography.
+sorry) on graphic design and typography.
The most influential source are the brilliant books
by Edward Tufte. While I do not agree with everything written in these
books, many of Tufte's arguments are so convincing that I decided to
-repeat them in the following guidelines.
+repeat them in the following guidelines.
The first thing you should ask yourself when someone presents a bunch of
guidelines is: Should I really follow these guidelines? This is an
@@ -60,7 +60,7 @@ creation of \emph{a first draft} of a half page graphic. Later on, I
expect another one to two hours before the final graphic is finished.
In many publications, even in good journals, the authors and editors
-have obviously invested a lot of time on the text, but seem to
+have obviously invested a lot of time on the text, but seem to
have spend about five minutes to create all of the
graphics. Graphics often seem to have been added as an
``afterthought'' or look like a screen shot of whatever the authors's
@@ -69,14 +69,14 @@ graphics that programs like \textsc{gnuplot} produce by default are of
poor quality.
Creating informative graphics that help the reader and that fit
-together with the main text is a difficult, lengthy process.
+together with the main text is a difficult, lengthy process.
\begin{itemize}
\item
Treat graphics as first-class citizens of your papers. They deserve
as much time and energy as the text does.
Indeed, the creation of graphics might deserve \emph{even more} time
than the writing of the main text since more attention will be paid
- to the graphics and they will be looked at first.
+ to the graphics and they will be looked at first.
\item
Plan as much time for the creation and revision of a graphic as you
would plan for text of the same size.
@@ -87,7 +87,7 @@ together with the main text is a difficult, lengthy process.
Very simple graphics will require less time, but most likely you do
not want to have ``very simple graphics'' in your paper, anyway;
just as you would not like to have a ``very simple text'' of the
- same size.
+ same size.
\end{itemize}
@@ -99,7 +99,7 @@ like to report about. The creation of the paper will typically start
with compiling a rough outline. Then, the different sections are
filled with text to create a first draft. This draft is then revised
repeatedly until, often after substantial revision, a final paper
-results. In a good journal paper there is typically not be a single
+results. In a good journal paper there is typically not be a single
sentence that has survived unmodified from the first draft.
Creating a graphics follows the same pattern:
@@ -126,12 +126,12 @@ Creating a graphics follows the same pattern:
Graphics can be placed at different places in a text. Either, they can
be inlined, meaning they are somewhere ``in the middle of the text''
-or they can be placed in standalone ``figures.'' Since printers (the
+or they can be placed in stand-alone ``figures.'' Since printers (the
people) like to have their pages ``filled,'' (both for aesthetic and
-economic reasons) standalone figures may traditionally be placed on
+economic reasons) stand-alone figures may traditionally be placed on
pages in the document far removed from the main text that refers to
them. \LaTeX\ and \TeX\ tend to encourage this ``drifting away'' of
-graphics for technical reasons.
+graphics for technical reasons.
When a graphic is inlined, it will more or less automatically be
linked with the main text in the sense that the labels of the graphic
@@ -139,13 +139,13 @@ will be implicitly explained by the surrounding text. Also, the main
text will typically make it clear what the graphic is about and what
is shown.
-Quite differently, a standalone figure will often be viewed at a time
+Quite differently, a stand-alone figure will often be viewed at a time
when the main text that this graphic belongs to either has not yet
been read or has been read some time ago. For this reason, you should
-follow the following guidelines when creating standalone figures:
+follow the following guidelines when creating stand-alone figures:
\begin{itemize}
\item
- Standalone figures should have a caption than should make them
+ Stand-alone figures should have a caption than should make them
``understandable by themselves.''
For example, suppose a graphic shows an example of the different
@@ -176,9 +176,9 @@ follow the following guidelines when creating standalone figures:
did not end after all.
The argument in favor of abbreviations is that they save space.
-
+
Personally, I am not really convinced by either argument. On the one
- hand, I have not yet seen any hard evidence that abbreviations slow
+ hand, I have not yet seen any hard evidence that abbreviations slow
readers down. On the other hand, abbreviating all ``Figure'' by
``Fig.''\ is most unlikely to save even a single line in most
documents. I avoid abbreviations.
@@ -190,7 +190,7 @@ follow the following guidelines when creating standalone figures:
Perhaps the most common ``mistake'' people do when creating graphics
(remember that a ``mistake'' in design is always just ``ignorance'')
-is to have a mismatch between the way their graphics look and the way
+is to have a mismatch between the way their graphics look and the way
their text looks.
It is quite common that authors use several different programs for
@@ -228,10 +228,10 @@ following guidelines:
$0.4\,\mathrm{pt}$. However, some journals will not accept graphics
with a normal line width below $0.5\,\mathrm{pt}$.
\item
- When using colors, use a consistent color coding in the text and in
+ When using colors, use a consistent color coding in the text and in
graphics. For example, if red is supposed to alert the reader to
something in the main text, use red also in graphics for important
- parts of the graphic. If blue is used for structural elements like
+ parts of the graphic. If blue is used for structural elements like
headlines and section titles, use blue also for structural elements
of your graphic.
@@ -265,7 +265,7 @@ following guidelines:
main text, also use ``$1/2$'' as labels in graphics, not
``0.5''. A $\pi$ is a ``$\pi$'' and not ``$3.141$''. Finally,
$\mathrm e^{-\mathrm i \pi}$ is ``$\mathrm e^{-\mathrm i \pi}$'',
- not ``$-1$'', let alone ``-1''.
+ not ``$-1$'', let alone ``-1''.
\item
Labels should be legible. They should not only have a reasonably
large size, they also should not be obscured by lines or other
@@ -277,7 +277,7 @@ following guidelines:
necessary, add a (subdued) line from the label to the labeled
object. Try to avoid labels that only reference explanations in
external legends. Reader have to jump back and forth between the
- explanation and the object that is described.
+ explanation and the object that is described.
\item
Consider subduing ``unimportant'' labels using, for example, a gray
color. This will keep the focus on the actual graphic.
@@ -299,14 +299,14 @@ bad plots.
The first question you should ask yourself when creating a plot is,
Are there enough data points to merit a plot? If the answer is ``not
-really,'' use a table.
+really,'' use a table.
A typical situation where a plot is unnecessary is when people present
a few numbers in a bar diagram. Here is a real-life example: At the
end of a seminar a lecturer asked the participants for feedback. Of
the 50 participants, 30 returned the feedback form. According to the
feedback, three participants considered the seminar ``very good,''
-nine considered it ``good,'' ten ``ok,'' eight ``bad,'' and no one thought
+nine considered it ``good,'' ten ``ok,'' eight ``bad,'' and no one thought
that the seminar was ``very bad.''
A simple way of summing up this information is the following table:
@@ -343,7 +343,7 @@ were near-unreadable):
\draw (\x,0) node[rotate=90,anchor=east] {\xtext};
\begin{scope}[xshift=\x cm]
-
+
\filldraw[fill=blue!50] (-.3,0,0) rectangle (.3,\height,0);
\filldraw[fill=blue!30] (.3,0,0) -- (.3,0,1) -- (.3,\height,1) -- (.3,\height,0) --cycle;
\filldraw[fill=blue!20] (-.3,\height,0) -- (.3,\height,0) --
@@ -356,7 +356,7 @@ were near-unreadable):
Both the table and the ``plot'' have about the same size. If your first
thought 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:
+the graphic:
\begin{enumerate}
\item
How many participants where there?
@@ -390,7 +390,7 @@ Here is the list of things that went wrong with the 3D-bar diagram:
\item
The labels at the bottom are rotated, making them hard to read.
- (In the real presentation that I saw, the text was rendered at a very
+ (In the real presentation that I saw, the text was rendered at a very
low resolution with about 10 by 6 pixels per letter with wrong
kerning, making the rotated text almost impossible to read.)
\item
@@ -418,7 +418,7 @@ important for the graphic. The important things is the ``message,''
which is that there are more ``very good'' and ``good'' ratings than
``bad'' and ``very bad.'' However, to convey this message either use a
sentence that says so or use a graphic that conveys this message more
-clearly:
+clearly:
\medskip
\par
@@ -428,7 +428,7 @@ clearly:
\colorlet{neutral}{black!60}
\colorlet{none}{white}
- \node[text centered,text width=3cm]{Ratings given by 50~participants};
+ \node[align=center,text width=3cm]{Ratings given by 50~participants};
\begin{scope}[line width=4mm,rotate=270]
\draw[good] (-123:2cm) arc (-123:-101:2cm);
@@ -443,14 +443,14 @@ clearly:
\divide\mycount by 10\relax
\draw[black!15,thick] (\the\mycount:18mm) -- (\the\mycount:22mm);
}
-
+
\draw (0:2.2cm) node[below] {``ok'': 10 (20\%)};
\draw (165:2.2cm) node[above] {none: 20 (40\%)};
\draw (-111:2.2cm) node[left] {``very good'': 3 (6\%)};
\draw (-68:2.2cm) node[left] {``good'': 9 (18\%)};
\draw (65:2.2cm) node[right] {``bad'': 8 (16\%)};
\draw (93:2.2cm) node[right] {``very bad'': 0 (0\%)};
- \end{scope}
+ \end{scope}
\draw[gray] (0,0) circle (2.2cm) circle (1.8cm);
\end{tikzpicture}
@@ -460,7 +460,7 @@ The above graphic has about the same information density as the table
can directly ``see'' that there are more good or very good ratings
than bad ones. One can also ``see'' that the number of people who gave
no rating at all is not negligible, which is quite common for feedback
-forms.
+forms.
Charts are not always a good idea. Let us look at an example
that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005:
@@ -484,7 +484,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005:
{\footnotesize Gesamte Netto-Stromerzeugung in Prozent, in
Milliarden Kilowattstunden (Mrd.\ kWh)}
rectangle ([xshift=1mm]right border);
-
+
% The 3D stuff
\pgfdeclarehorizontalshading{zeit}{100bp}
{color(0pt)=(black);
@@ -515,7 +515,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005:
\draw (0,0) -- (145:1cm);
\draw (0,0) -- (135:1cm);
\draw (0,0) -- (92:1cm);
-
+
\draw(0,0) circle (1cm);
\end{scope}
@@ -554,7 +554,7 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005:
\node[above right] at (Sonstige label) {Sonstige\ \
\footnotesize (16,5 kWh) \hskip1.5cm\
\normalsize\textbf{2,9\%}};
- \end{scope}
+ \end{scope}
\end{tikzpicture}
This graphic has been redrawn in \tikzname, but the original looks
@@ -575,7 +575,7 @@ are a lot of things that went wrong:
Braunkohle is less than the percentage of Kernenergie}.
\item
The 3D-distortion gets worse for small areas. The area of
- ``Regenerative'' somewhat larger than the area of ``Erdgas.''
+ ``Regenerative'' somewhat larger than the area of ``Erdgas.''
The area of ``Wind'' is slightly smaller than the area of
``Mineral\"olprodukte'' \emph{although the percentage of Wind is
nearly three times larger than the percentage of
@@ -585,13 +585,13 @@ are a lot of things that went wrong:
distortion. The designer(s) of the original graphic have also made
the ``Wind'' slice too small, even taking distortion into
account. (Just compare the size of ``Wind'' to ``Regenerative'' in
- general.)
+ general.)
\item
According to its caption, this chart is supposed to inform us that
coal was the most important energy source in Germany in
2004. Ignoring the strong distortions caused by the superfluous and
misleading 3D-setup, it takes quite a while for this message to get
- across.
+ across.
Coal as an energy source is split up into two slices: one for
``Steinkohle'' and one for ``Braunkohle'' (two different kinds of
@@ -625,7 +625,7 @@ Here are a few recommendations that may help you avoid producing chart junk:
\item
Consider using a table instead of a pie chart.
\item
- Due not apply colors randomly; use them to direct the readers's
+ Do not apply colors randomly; use them to direct the readers's
focus and to group things.
\item
Do not use background patterns, like a crosshatch or diagonal
@@ -657,7 +657,7 @@ from going quickly and evenly from line to line will make the text
harder to read.
Now, pick up your favorite weekly magazine or newspaper and have a
-look at a typical
+look at a typical
page. You will notice that there is quite a lot ``going on'' on the
page. Fonts are used at different sizes and in different arrangements,
the text is organized in narrow columns, typically interleaved with
@@ -719,7 +719,6 @@ Here is a non-exhaustive list of things that can distract readers:
Background images and shadings distract and only seldom add
anything of importance to a graphic.
\item
- Cute little cliparts can easily draw attention away from the
+ Cute little clip arts can easily draw attention away from the
data.
\end{itemize}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
index e556e2000f3..97c2968088b 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
@@ -13,18 +13,18 @@ There are different ways of installing \pgfname, depending
on your system and needs, and you may need to install other
packages as well as, see below. Before installing, you may wish to
review the licenses under which the package is
-distributed, see Section~\ref{section-license}.
+distributed, see Section~\ref{section-license}.
Typically, the package will already be installed on your
system. Naturally, in this case you do not need to worry about the
installation process at all and you can skip the rest of this
-section.
+section.
\subsection{Package and Driver Versions}
This documentation is part of version \pgfversion\ of the \pgfname\
-package. In order to run \pgfname, you need a reasonably recent
+package. In order to run \pgfname, you need a reasonably recent
\TeX\ installation. When using \LaTeX, you need the following packages
installed (newer versions should also work):
\begin{itemize}
@@ -32,7 +32,7 @@ installed (newer versions should also work):
|xcolor| version \xcolorversion.
\end{itemize}
With plain \TeX, |xcolor| is not needed, but you obviously do not
-get its (full) functionality.
+get its (full) functionality.
Currently, \pgfname\ supports the following backend drivers:
\begin{itemize}
@@ -65,9 +65,11 @@ Currently, \pgfname\ supports the following formats:
\item
|plain| with complete functionality, except for graphics inclusion,
which works only for pdf\TeX.
-\item
- |context| with complete functionality, except for graphics inclusion,
- which works only for pdf\TeX.
+\item
+ |context| with complete functionality\footnote{Note that
+ \pgfname/\tikzname{} is not supported by recent Con\TeX t versions
+ (like mark IV, the Lua\TeX-aware part of Con\TeX t).}, except for
+ graphics inclusion, which works only for pdf\TeX.
\end{itemize}
For more details, see Section~\ref{section-formats}.
@@ -81,13 +83,13 @@ fortunately, nice other people do. I cannot give detailed instructions
on how to install these packages, since I do not manage them, but I
\emph{can} tell you were to find them. If you have a problem with
installing, you might wish to have a look at the Debian page or the
-Mik\TeX\ page first.
+MiK\TeX\ page first.
\subsubsection{Debian}
The command ``|aptitude install pgf|'' should do the trick. Sit back
-and relax. In detail, the following packages are installed:
+and relax. In detail, the following packages are installed:
\begin{verbatim}
http://packages.debian.org/pgf
http://packages.debian.org/latex-xcolor
@@ -97,15 +99,15 @@ http://packages.debian.org/latex-xcolor
\subsubsection{MiKTeX}
For MiK\TeX, use the update wizard to install the (latest versions of
-the) packages called |pgf| and |xcolor|.
+the) packages called |pgf| and |xcolor|.
\subsection{Installation in a texmf Tree}
-For a permanent installation, you place the files of the
-the \textsc{pgf} package in an appropriate |texmf| tree.
+For a permanent installation, you place the files of
+the \textsc{pgf} package in an appropriate |texmf| tree.
When you ask \TeX\ to use a certain class or package, it usually looks
for the necessary files in so-called |texmf| trees. These trees
@@ -120,7 +122,7 @@ are simply huge directories that contain these files. By default,
|/usr/local/share/texmf/| or |c:\localtexmf\| or somewhere similar.
\item
Your personal |texmf| tree, which is usually located in your home
- directory at |~/texmf/| or |~/Library/texmf/|.
+ directory at |~/texmf/| or |~/Library/texmf/|.
\end{itemize}
You should install the packages either in the local tree or in
@@ -143,8 +145,8 @@ tree that you have chosen create a sub-sub-directory called
|texmf/tex/generic/pgf-|\texttt{\pgfversion}, if you prefer. Then
place all files of the |pgf| package in this directory. Finally,
rebuild \TeX's filename database. This is done by running the command
-|texhash| or |mktexlsr| (they are the same). In Mik\TeX, there is a
-menu option to do this.
+|texhash| or |mktexlsr| (they are the same). In MiK\TeX, there is a
+menu option to do this.
\subsubsection{Installation that is TDS-Compliant}
@@ -187,5 +189,4 @@ installation). The easiest way to do this is to first delete the old
version and then proceed as described above. Sometimes, there are
changes in the syntax of certain command from version to version. If
things no longer work that used to work, you may wish to have a look
-at the release notes and at the change log.
-
+at the release notes and at the change log.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
index 6cfcd4bbd96..7db4aa68733 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
@@ -12,7 +12,7 @@
The \pgfname\ package, where ``\pgfname'' is supposed to mean ``portable
graphics format'' (or ``pretty, good, functional'' if you
-prefer\dots), is a package for creating graphics in an ``inline''
+prefer\dots), is a package for creating graphics in an ``inline''
manner. It defines a number of \TeX\ commands that draw
graphics. For example, the code |\tikz \draw (0pt,0pt) -- (20pt,6pt);|
yields the line \tikz \draw (0pt,0pt) -- (20pt,6pt); and the code
@@ -20,13 +20,13 @@ yields the line \tikz \draw (0pt,0pt) -- (20pt,6pt); and the code
\fill[orange] (1ex,1ex) circle (1ex);.
In a sense, when you use \pgfname\ you ``program'' your graphics, just
-as you ``program'' your document when you use \TeX. You get all
-the advantages of the ``\TeX-approach to typesetting'' for your
+as you ``program'' your document when you use \TeX. You get all
+the advantages of the ``\TeX-approach to typesetting'' for your
graphics: quick creation of simple graphics, precise positioning, the
use of macros, often superior typography. You also inherit all the
disadvantages: steep learning curve, no \textsc{wysiwyg}, small
changes require a long recompilation time, and the code does not
-really ``show'' how things will look like.
+really ``show'' how things will look like.
@@ -46,7 +46,7 @@ The \pgfname\ system consists of different layers:
differences. For example, the system command
|\pgfsys@lineto{10pt}{10pt}| extends the current path to the coordinate
$(10\mathrm{pt},10\mathrm{pt})$ of the current
- |{pgfpicture}|. Depending on whether |dvips|,
+ |{pgfpicture}|. Depending on whether |dvips|,
|dvipdfm|, or |pdftex| is used to process the document, the system
command will be converted to different |\special| commands.
The system layer is as ``minimalistic'' as possible since each
@@ -83,7 +83,7 @@ The \pgfname\ system consists of different layers:
the third, one for closing the path, and one for actually painting
the triangle (as opposed to filling it). With the |tikz| frontend
all this boils down to a single simple \textsc{metafont}-like
- command:
+ command:
\begin{verbatim}
\draw (0,0) -- (1,0) -- (1,1) -- cycle;
\end{verbatim}
@@ -94,10 +94,10 @@ The \pgfname\ system consists of different layers:
The \tikzname\ frontend is the ``natural'' frontend for \pgfname. It gives
you access to all features of \pgfname, but it is intended to be
easy to use. The syntax is a mixture of \textsc{metafont} and
- \textsc{pstricks} and some ideas of myself. This frontend is
+ \textsc{pstricks} and some ideas of myself. This frontend is % TODOsp: change all `pstricks' to `PStricks'? (ff)
\emph{neither} a complete \textsc{metafont} compatibility layer nor
a \textsc{pstricks} compatibility layer and it is not intended to
- become either.
+ become either.
\item
The |pgfpict2e| frontend reimplements the standard \LaTeX\
|{picture}| environment and commands like |\line| or |\vector|
@@ -157,15 +157,15 @@ other packages.
\item
The |xypic| package is an older package for creating
graphics. However, it is more difficult to use and to learn because
- the syntax and the documentation are a bit cryptic.
+ the syntax and the documentation are a bit cryptic.
\item
The |dratex| package is a small graphic package for creating a
graphics. Compared to the other package, including \pgfname, it is
- very small, which may or may not be an advantage.
+ very small, which may or may not be an advantage.
\item
The |metapost| program is a very powerful alternative to
\pgfname. However, it is an external program, which entails a
- bunch of problems. The time needed both to create a small graphic
+ bunch of problems. The time needed both to create a small graphic
and also to compile it is much greater than in \pgfname.
The main problem with |metapost|, however, is the inclusion of
labels. This is \emph{much} easier to achieve using \pgfname.
@@ -182,11 +182,11 @@ other packages.
\subsection{Utility Packages}
-The \pgfname\ package comes along with a numer of utility package that
+The \pgfname\ package comes along with a number of utility package that
are not really about creating graphics and which can be used
independently of \pgfname. However, they are bundled with \pgfname,
partly out of convenience, partly because their functionality is
-closely intertwined with \pgfname. These utility packages are:
+closely intertwined with \pgfname. These utility packages are:
\begin{enumerate}
\item The |pgfkeys| package defines a powerful key management
facility. It can be used completely independently of \pgfname.
@@ -208,7 +208,7 @@ closely intertwined with \pgfname. These utility packages are:
\LaTeX\ without the use of any external programs. However,
|pgfpages| can do quite a lot more than that. You can use it to put
logos and watermark on pages, print up to 16 pages on one page, add
- borders to pages, and more.
+ borders to pages, and more.
\end{enumerate}
@@ -223,7 +223,7 @@ esoteric features are discussed later.
If you have not yet installed \pgfname, please read the installation
first. Second, it might be a good idea to read the tutorial. Finally,
-you might wish to skim through the description of \tikzname. Typically,
+you might wish to skim through the description of \tikzname. Typically,
you will not need to read the sections on the basic layer. You will
only need to read the part on the system layer if you intend to write
your own frontend or if you wish to port \pgfname\ to a new driver.
@@ -238,12 +238,21 @@ in green is optional and can be left out.
\label{section-authors}
The bulk of the \pgfname\ system and its documentation was written by
-Till Tantau. The \pgfname\ mathematical engine, many shapes, and the
-decoration engine were written and documented by Mark
-Wibrow. Additionally, numerous people have contributed to the
-\pgfname\ system by writing emails, spotting bugs, or sending
-libraries. Many thanks to all these people, who are too numerous to
-name them all!
+Till Tantau. A further member of the main team is Mark Wibrow, who
+is responsible, for example, for the \pgfname\ mathematical engine,
+many shapes, the decoration engine, and matrices. The third member is
+Christian Feuers\"anger who contributed the floating point library,
+image externalization, extended key processing, and automatic hyperlinks
+in the manual.
+
+Furthermore, occasional contributions have been made by Christophe
+Jorssen, Jin-Hwan Cho, Olivier Binda, Matthias Schulz, Ren\'ee Ahrens,
+Stephan Schuster, and Thomas Neumann.
+
+Additionally, numerous people have contributed to the \pgfname\ system
+by writing emails, spotting bugs, or sending libraries and patches.
+Many thanks to all these people, who are too numerous to name them
+all!
@@ -284,4 +293,3 @@ following:
Please, do not phone me in my office (unless, of course, you attend
one of my lectures).
\end{enumerate}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
index 8e8f4649ce3..da4523a9ff1 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
@@ -13,17 +13,34 @@
\begin{pgflibrary}{arrows}
The package defines additional arrow tips, which are described
- below. See page~\pageref{standard-arrows} for the arrows tips that
- are defined by default. Note that neither the standard packages nor
+ below. Note that neither the standard packages nor
this package defines an arrow name containing |>| or |<|. These are
left for the user to defined as he or she sees fit.
\end{pgflibrary}
+The arrow tips |to|, |stealth|, |latex|, |space|, their reversed
+forms, and \verb!|! are predefined, but listed below for completeness,
+nevertheless.
+
+
+\subsection{Mathematical Arrow Tips}
+
+\begin{tabular}{ll}
+ \symarrow{to} \\
+ \symarrow{to reversed} \\
+ \symarrowdouble{implies} \\
+\end{tabular}
+
+
\subsection{Triangular Arrow Tips}
\begin{tabular}{ll}
+ \symarrowdouble{latex} \\
+ \symarrowdouble{latex reversed} \\
\symarrow{latex'} \\
\symarrow{latex' reversed} \\
+ \symarrowdouble{stealth} \\
+ \symarrowdouble{stealth reversed} \\
\symarrow{stealth'} \\
\symarrow{stealth' reversed}\\
\symarrow{triangle 90} \\
@@ -40,6 +57,7 @@
\symarrow{open triangle 45 reversed} \\
\end{tabular}
+
\subsection{Barbed Arrow Tips}
\begin{tabular}{ll}
@@ -56,14 +74,29 @@
\subsection{Bracket-Like Arrow Tips}
+{
+\bigskip
+\catcode`\|=12
\begin{tabular}{ll}
\sarrow{[}{]} \\
\sarrow{]}{[} \\
\sarrow{(}{)} \\
- \sarrow{)}{(}
+ \sarrow{)}{(} \\
+ \index{*vbar@\protect\texttt{\protect\myvbar} arrow tip}%
+ \index{Arrow tips!*vbar@\protect\texttt{\protect\myvbar}}
+ \texttt{\char`\|-\char`\|} & yields thick
+ \begin{tikzpicture}[arrows={|-|},thick]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0,0) -- (1,0);
+ \end{tikzpicture} and thin
+ \begin{tikzpicture}[arrows={|-|},thin]
+ \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \draw (0,0) -- (1,0);
+ \end{tikzpicture}
\end{tabular}
+}
-\subsection{Circle and Diamond Arrow Tips}
+\subsection{Circle, Diamond and Square Arrow Tips}
\begin{tabular}{ll}
@@ -71,6 +104,8 @@
\symarrow{*} \\
\symarrow{diamond} \\
\symarrow{open diamond} \\
+ \symarrow{square} \\
+ \symarrow{open square} \\
\end{tabular}
@@ -109,6 +144,16 @@
\end{tabular}
+\subsection{Spacing Tips}
+
+The spacing arrow tips are useful for combining them with other arrows
+to get arrows that do not touch the end of the line.
+
+\begin{tabular}{ll}
+ \symarrow{space} \\
+\end{tabular}
+
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
index 2cc4021316e..2684d96c71d 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
@@ -12,7 +12,7 @@
\begin{tikzlibrary}{automata}
This packages provides shapes and styles for drawing finite state
- automata and Turing machines.
+ automata and Turing machines.
\end{tikzlibrary}
@@ -22,7 +22,7 @@ The automata drawing library is intended to make it easy to draw
finite automata and Turing machines. It does not cover every
situation imaginable, but most finite automata and Turing machines
found in text books can be drawn in a nice and convenient fashion
-using this library.
+using this library.
To draw an automaton, proceed as follows:
\begin{enumerate}
@@ -41,8 +41,8 @@ To draw an automaton, proceed as follows:
\end{enumerate}
Let us now see how this works for a real example. Let us consider a
-nondeterminsitic four state automaton that checks whether an contains
-the sequence $0^*1$ or the sequence $1^*0$.
+nondeterministic four state automaton that checks whether an contains
+the sequence $0^*1$ or the sequence $1^*0$.
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
\draw[help lines] (0,0) grid (3,2);
@@ -86,7 +86,7 @@ By default, the following state styles are defined:
\draw[help lines] (0,0) grid (3,2);
\node[state without output] {$q_0$};
-
+
\node[state with output] at (2,0) {$q_1$ \nodepart{lower} $00$};
\end{tikzpicture}
\end{codeexample}
@@ -103,7 +103,7 @@ By default, the following state styles are defined:
\end{codeexample}
\end{stylekey}
-\begin{stylekey}{/tikz/every state (initially \normalfont empyt)}
+\begin{stylekey}{/tikz/every state (initially \normalfont empty)}
This style is used by |state with output| and also by
|state without output|. By default, it does nothing, but you can use
it to make your state look more fancy:
@@ -177,10 +177,10 @@ Let us start with the initial states.
\end{stylekey}
\begin{stylekey}{/tikz/initial by diamond}
- This style uses a diamond to indicate an initial node.
+ This style uses a diamond to indicate an initial node.
\end{stylekey}
-For the accepting states, the sitation is similar: There is also an
+For the accepting states, the situation is similar: There is also an
|accepting| style that selects the way accepting states are
rendered. There are now two options: First,
|accepting by arrow|, which works the same way as |initial by arrow|,
@@ -194,7 +194,7 @@ where accepting states get a double line around them.
\end{stylekey}
\begin{stylekey}{/tikz/accepting by double}
- This style causes a double line to be drawn arond a state.
+ This style causes a double line to be drawn around a state.
\end{stylekey}
\begin{stylekey}{/tikz/accepting by arrow}
@@ -217,7 +217,7 @@ where accepting states get a double line around them.
\begin{stylekey}{/tikz/every accepting by arrow (initially \normalfont empty)}
Executed at the beginning of every path that contains
the arrow and the text.
- \end{stylekey}
+ \end{stylekey}
\begin{codeexample}[]
\begin{tikzpicture}
[shorten >=1pt,node distance=2cm,on grid,>=stealth',initial text=,
@@ -260,7 +260,7 @@ In the following example, we once more typeset the automaton presented
in the previous sections. This time, we use the following rule for
accepting/initial state: Initial states are red, accepting states are
green, and normal states are orange. Then, we must find a path from a
-red state to a green state.
+red state to a green state.
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth',thick,
@@ -298,10 +298,10 @@ beaver:
\path [every node/.style={font=\footnotesize}]
(A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
- (B) edge [loop above] node {1,1,L} (B)
+ (B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
- edge [bend left] node {1,0,R} (E)
+ edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
@@ -309,7 +309,7 @@ beaver:
\end{codeexample}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
index 8144d8aec42..ed7ed14b624 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
@@ -21,6 +21,35 @@
your picture or |gridded| to put a grid behind your picture.
\end{tikzlibrary}
+
+The first use of this library is to make the following key available:
+\begin{key}{/tikz/on background layer}
+ This key can be used with a |{scope}|. It will cause everything
+ inside the scope to be typeset on a background layer. Note that the
+ scope should not be ``deeply nested'' inside the picture since
+ changes to the graphic state (like the color or the transformation
+ matrix) ``do not survive a layer switch.'' For more details on
+ layers see Section~\ref{section-layers}.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ % On main layer:
+ \fill[blue] (0,0) circle (1cm);
+
+ \begin{scope}[on background layer]
+ \fill[yellow] (-1,-1) rectangle (1,1);
+ \end{scope}
+
+ \begin{scope}[on background layer]
+ \fill[black] (-.8,-.8) rectangle (.8,.8);
+ \end{scope}
+
+ % On main layer again:
+ \fill[blue!50] (-.5,-1) rectangle (.5,1);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
When this package is loaded, the following styles become available:
\begin{stylekey}{/tikz/show background rectangle}
This style causes a rectangle to be drawn behind your graphic. This
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex
new file mode 100644
index 00000000000..5641ec11b6b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex
@@ -0,0 +1,6 @@
+\section{Calc Library}
+
+\begin{tikzlibrary}{calc}
+ The library allows advanced Coordinate Calculations. It is documented in all detail in Section~\ref{tikz-lib-calc} on page~\pageref{tikz-lib-calc}.
+\end{tikzlibrary}
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
index 679a22a0332..a61feb19de7 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
@@ -26,7 +26,7 @@
The core command for creating calendars in \tikzname\ is the
|\calendar| command. It is available only inside |{tikzpicture}|
-environments (similar to, say, the |\draw| command).
+environments (similar to, say, the |\draw| command).
\begin{command}{\calendar \meta{calendar specification}|;|}
The syntax for this command is similar to commands like |\node| or
@@ -43,14 +43,14 @@ environments (similar to, say, the |\draw| command).
\item |[|\meta{options}|]|
You provide \meta{options} in square brackets as
- in |[red,draw=none]|. These \meta{options} can be any \tikzname\
+ in |[red,draw=none]|. These \meta{options} can be any \tikzname\
option and they apply to the whole calendar. You can provide this
element multiple times, the effect accumulates.
\item |(|\meta{name}|)|
This has the same effect as saying |[name=|\meta{name}|]|. The
effect of providing a \meta{name} is explained later. Note
- alreadys that \emph{a calendar is not a node} and the \meta{name}
+ already that \emph{a calendar is not a node} and the \meta{name}
is \emph{not the name of a node}.
\item |at (|\meta{coordinate}|)|
@@ -65,7 +65,7 @@ environments (similar to, say, the |\draw| command).
\begin{stylekey}{/tikz/every calendar (initially \normalfont empty)}
This style is used with every calendar.
\end{stylekey}
-
+
\medskip
\textbf{The date range.}
The overall effect of the |\calendar| command is to execute code for
@@ -88,20 +88,20 @@ environments (similar to, say, the |\draw| command).
current date code is executed, which will be called the
\emph{current date code}. The current date code consists of
different parts, to be detailed later.
-
+
The central part of the current date code is the execution of the
code |\tikzdaycode|. By default, this code simply produces a node
whose text is set to the day of month. This means that unless further
action is taken, all days of a calendar will be put on top of each
other! To avoid this, you must modify the current date code to shift
- days around appropriately. Predefined arrangements like
+ days around appropriately. Predefined arrangements like
|day list downward| or |week list| do this for you, but you can
define arrangements yourself. Since defining an arrangement is a bit
tricky, it is explained only later on. For the time being, let us
use a predefined arrangement to produce our first calendar:
\begin{codeexample}[]
-\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list];
+\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list];
\end{codeexample}
\medskip
@@ -114,7 +114,7 @@ environments (similar to, say, the |\draw| command).
horizontal shift between days. This is not the gap between days,
but the shift between the anchors of their nodes.
\begin{codeexample}[]
-\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex];
+\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex];
\end{codeexample}
\end{key}
\begin{key}{/tikz/day yshift=\meta{dimension} (initially 3ex)}
@@ -122,7 +122,7 @@ environments (similar to, say, the |\draw| command).
vertical shift between days. Again, this is the shift between the
anchors of their nodes.
\begin{codeexample}[]
-\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex];
+\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex];
\end{codeexample}
\end{key}
\begin{key}{/tikz/month xshift=\meta{dimension}}
@@ -131,14 +131,14 @@ environments (similar to, say, the |\draw| command).
\end{key}
\begin{key}{/tikz/month yshift=\meta{dimension}}
Specifies an
- additional vertical shift between different months.
+ additional vertical shift between different months.
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
- month yshift=0pt];
+ month yshift=0pt];
\end{codeexample}
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
- month yshift=1cm];
+ month yshift=1cm];
\end{codeexample}
\end{key}
@@ -164,15 +164,15 @@ environments (similar to, say, the |\draw| command).
placed in such a way the center of 2000-01-20 lies on the position
$(2,2)$:
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\matrix [anchor=cal-2000-01-20.center] at (2,2)
{ \calendar(cal)[dates=2000-01-01 to 2000-01-31,week list]; \\};
\end{tikzpicture}
\end{codeexample}
Unfortunately, the matrix-base positions, which is the cleanest way,
- isnot as portable as the other approaches (it currently does not
- work with the \textsc{svg} backend for instance).
+ isn't as portable as the other approaches (it currently does not
+ work with the \textsc{svg} backend for instance).
\medskip
\textbf{Changing the appearance of days.}
@@ -187,7 +187,7 @@ environments (similar to, say, the |\draw| command).
name, but you can change this:
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
- day code={\fill[blue] (0,0) circle (2pt);}];
+ day code={\fill[blue] (0,0) circle (2pt);}];
\end{codeexample}
The default code is the following:
\begin{codeexample}[code only]
@@ -201,7 +201,7 @@ environments (similar to, say, the |\draw| command).
day that is currently being processed in ISO format .
For example, if January 1, 2006 is being processed and the
- calendar has been named |mycal|, then the node containg the |1|
+ calendar has been named |mycal|, then the node containing the |1|
for this date will be names |mycal-2006-01-01|. You can later
reference this node.
\begin{codeexample}[]
@@ -219,7 +219,7 @@ environments (similar to, say, the |\draw| command).
change it arbitrarily. Here is a silly example:
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
- day text=x];
+ day text=x];
\end{codeexample}
More useful examples are based on using the |\%| command. This
command is redefined inside a |\pgfcalendar| to mean the same as
@@ -229,7 +229,7 @@ environments (similar to, say, the |\draw| command).
The |\%| inserts the current day/month/year/day of week in a
certain format into the text. The first letter following the |\%|
- selects the type (permisslbe values are |d|, |m|, |y|, |w|), the
+ selects the type (permissible values are |d|, |m|, |y|, |w|), the
second letter specifies how the value should be displayed (|-|
means numerically, |=| means numerically with leading
space, |0| means numerically with leading zeros, |t| means
@@ -242,7 +242,7 @@ environments (similar to, say, the |\draw| command).
leading zero:
\begin{codeexample}[leave comments]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
- day text=\%d0];
+ day text=\%d0];
\end{codeexample}
\end{key}
@@ -285,10 +285,10 @@ environments (similar to, say, the |\draw| command).
\begin{key}{/tikz/month text=\meta{text}}
This option allows you to change the macro |\tikzmonthtext|. By
default, the month text is a long textual presentation of the
- current month being typeset.
+ current month being typeset.
\begin{codeexample}[leave comments]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
- month label above centered,
+ month label above centered,
month text=\textcolor{red}{\%mt} \%y-];
\end{codeexample}
\end{key}
@@ -310,7 +310,7 @@ environments (similar to, say, the |\draw| command).
\begin{key}{/tikz/every year}
Works like |every month|, only for years.
\end{key}
-
+
\medskip
\textbf{Date ifs.}
Much of the power of the |\calendar| command comes from the use of
@@ -321,20 +321,20 @@ environments (similar to, say, the |\draw| command).
code or options}. You can have multiple such conditionals (but
you cannot nest them in this simple manner). The second way is to
use the following option:
- \begin{key}{/tikz/if=|(|\meta{coditions}|)|\meta{code or
+ \begin{key}{/tikz/if=|(|\meta{conditions}|)|\meta{code or
options}\opt{|else|\meta{else code or options}}}
This option has
the same effect as giving a corresponding if in the \meta{calendar
specification}. The option is mostly useful for use in the
|every calendar| style, where you cannot provide if conditionals
- otherwise.
+ otherwise.
\end{key}
Now, regardless of how you specify a conditional, it has the
following effect (individually and independently for each date in
the calendar):
\begin{enumerate}
\item It is checked whether the current date is one of the
- possibilities listed in \meta{coditions}. An example of such a
+ possibilities listed in \meta{conditions}. An example of such a
condition is |Sunday|. Thus, when you write
|if (Saturday,Sunday) {foo}|, then |foo| will be executed for
every day in the calendar that is a Saturday \emph{or} a Sunday.
@@ -394,7 +394,7 @@ environments (similar to, say, the |\draw| command).
correctly. For this, we can change the day text to |\%d=|,
which adds a space at the beginning of single day
text.
-
+
In the following, more technical information is covered. Most
readers may wish to skip it.
@@ -405,7 +405,7 @@ environments (similar to, say, the |\draw| command).
nodes, to render the date nodes, to draw the month labels and to do
all other stuff that is necessary to draw a calendar.
- The current daet code consists of the following parts, in this order:
+ The current date code consists of the following parts, in this order:
\begin{enumerate}
\item The before-scope code.
\item A scope is opened.
@@ -439,7 +439,7 @@ environments (similar to, say, the |\draw| command).
\begin{key}{/tikz/execute before day scope=\meta{code}}
The \meta{code} is executed before everything else for each
- date. Multiple
+ date. Multiple
calls of this option have an accumulative effect. Thus, if you use
this option twice, the code from the first use is used first for
each day, followed by the code given the second time.
@@ -455,15 +455,15 @@ environments (similar to, say, the |\draw| command).
commands in at-begin- and at-end-code.
\end{key}
\begin{key}{/tikz/execute after day scope=\meta{code}}
- This is executed at the very end of the current date, outside the
+ This is executed at the very end of the current date, outside the
scope. The accumulation is also in reverse.
- \end{key}
+ \end{key}
\end{command}
In the rest of the following subsections we have a look at how the
different scope codes can be used to create different calendar
-arrangements.
+arrangements.
\subsubsection{Creating a Simple List of Days}
@@ -472,7 +472,7 @@ We start with a list the days of the calendar, one day below the
other. For this, we simply shift the coordinate system downward at the
end of the code for each day. This shift must be \emph{outside} the
day scope as we want day shifts to accumulate. Thus, we use the
-following code:
+following code:
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-01 to 2000-01-08,
@@ -496,7 +496,7 @@ month. The idea is to do two things:
We have two options where we should add the month code: Either we add
it at the beginning of the day scope or before. Either will work fine,
but it might be safer to put the code inside the scope to ensure that
-settings to not inadventerdly ``leak outside.''
+settings to not inadvertently ``leak outside.''
\begin{codeexample}[]
\tikz
\calendar
@@ -527,7 +527,7 @@ the Monday of each week. That means that at the end of each week the
origin is moved downward one line. On all other days, the origin at
the end of the day code is the same as at the beginning. To position
each day correctly, we use code inside and at the beginning of the day
-scope to horizontally shift the day according to its day of week.
+scope to horizontally shift the day according to its day of week.
\begin{codeexample}[]
\tikz
\calendar
@@ -543,7 +543,7 @@ scope to horizontally shift the day according to its day of week.
\subsubsection{Creating a Month List Arrangement}
-For another example, let us create an arrangment that contains one
+For another example, let us create an arrangement that contains one
line for each month. This is easy enough to do as for weeks, unless we
add the following requirement: Again, we want all days in a column to
have the same day of week. Since months start on different days of
@@ -587,7 +587,7 @@ on the page. The calendar library defines a number of predefined
arrangements.
We start with arrangements in which the days are listed in a long
-line.
+line.
\begin{stylekey}{/tikz/day list downward}
This style causes the days of a month to be typeset one below the
@@ -624,7 +624,7 @@ line.
As above, but the list grows left.
\end{stylekey}
-The next arrangement lists days weekwise.
+The next arrangement lists days by the week.
\begin{stylekey}{/tikz/week list}
This style creates one row for each week in the range. The value
@@ -659,15 +659,15 @@ The following arrangement gives a very compact view of a whole year.
\begin{stylekey}{/tikz/month list}
In this arrangement there is a row for each month. As for the
|week list|, the |day xshift| is used for the horizontal distance.
- For the vertical shft, |month yshift| is used.
+ For the vertical shift, |month yshift| is used.
In each row, all days of the month are listed alongside each
other. However, it is once more ensured that days in each column lie
on the same day of week. Thus, the very first column contains only
Mondays. If a month does not start with a Monday, its days are
- shifted to the right such that the days lie on the correct columns.
+ shifted to the right such that the days lie on the correct columns.
\begin{codeexample}[]
-\sffamily\scriptsize
+\sffamily\scriptsize
\tikz
\calendar [dates=2000-01-01 to 2000-12-31,
month list,month label left,month yshift=1.25em]
@@ -850,10 +850,10 @@ The following example is a futuristic calendar that is all about circles:
\begin{codeexample}[]
\sffamily
-\colorlet{winter}{blue}
-\colorlet{spring}{green!60!black}
-\colorlet{summer}{orange}
-\colorlet{fall}{red}
+\colorlet{winter}{blue}
+\colorlet{spring}{green!60!black}
+\colorlet{summer}{orange}
+\colorlet{fall}{red}
% A counter, since TikZ is not clever enough (yet) to handle
% arbitrary angle systems.
@@ -880,7 +880,7 @@ The following example is a futuristic calendar that is all about circles:
]
if (day of month=1) {\color{\monthcolor}\tikzmonthcode}
if (Sunday) [red]
- if (all)
+ if (all)
{
% Again, compute angle
\mycount=1
@@ -906,7 +906,7 @@ Next, lets us have a whole year in a tight column:
\end{codeexample}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
index 6354593d91d..25f0c1f3433 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
@@ -23,12 +23,12 @@
in an o row or a column and that are -- typically -- connected by
edges. More generally, they can be used to position nodes of a
branching network in a systematic manner. For the positioning of nodes
-in rows and columns you can also use matrices, see
-Section~\ref{section-matrices}, but chains can also be used
+in rows and columns you can also use matrices, see
+Section~\ref{section-matrices}, but chains can also be used
to describe the connections between nodes that have already been
connected using, say, matrices. Thus, it often makes sense to use
matrices for the positioning of elements and chains to describe the
-connections.
+connections.
@@ -79,7 +79,7 @@ option.
explained in the description of the |on chain| option. Right now,
just remember that the \meta{direction} you provide with the |chain|
option applies to the whole chain.
-
+
Other than this, this key has no further effect. In particular, to
place nodes on the chain, you must use the |on chain| option,
described next.
@@ -115,8 +115,8 @@ option.
\node [on chain=2] at (0.5,-.5) {0};
\node [on chain=2] {1};
\node [on chain=2] {2};
-
- \node [on chain=1] {D};
+
+ \node [on chain=1] {D};
\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -182,7 +182,7 @@ option.
direction used for this node, otherwise the \meta{direction}
that was given to the original |start chain| option is used (or of
the last |continue chain| option, which allows you to change this
- default).
+ default).
The effects of this option are the following:
\begin{enumerate}
@@ -218,7 +218,7 @@ option.
with |going| or with |placed|. The difference is that in the first
case, the placement rule is not applied to the first node of the
chain, while in the second case the placement rule is applied also
- to this first node. The idea is that a |going|-direciton indicates
+ to this first node. The idea is that a |going|-direction indicates
that we are ``going somewhere relative to the previous node''
whereas a |placed| indicates that we are ``placing nodes according
to their number.''
@@ -228,10 +228,10 @@ option.
compulsory space) can have two different effects:
\begin{enumerate}
\item If it contains an equal sign, then this \meta{text} is used
- as the placement rule, that is, it is simply executed.
+ as the placement rule, that is, it is simply executed.
\item If it does not contain an equal sign, then
\meta{text}|=of \tikzchainprevious| is used as the placement
- rule.
+ rule.
\end{enumerate}
Note that in the first case, inside the \meta{text} you have
@@ -241,7 +241,7 @@ option.
\begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)}]
\foreach \i in {1,...,10}
\node [on chain] {\i};
-
+
\draw (circle-1) -- (circle-10);
\end{tikzpicture}
\end{codeexample}
@@ -249,12 +249,12 @@ option.
The following style is executed:
\begin{stylekey}{/tikz/every on chain}
This key is executed for every node of a chain, including the
- first one.
+ first one.
\end{stylekey}
\end{enumerate}
Recall that the standard replacement rule has a form like
- |right=of (\tikzchainprevious)|. This means that each
+ |right=of (\tikzchainprevious)|. This means that each
new node is placed to the right of the previous one, spaced by the
current value of |node distance|.
\begin{codeexample}[]
@@ -319,15 +319,15 @@ following command, which is only defined inside scopes where a
It is permissible to give the |on chain| option inside the
\meta{options} in order to specify on which chain the node should be
- put.
-
+ put.
+
This command is just a shortcut for
\begin{quote}
|\path (|\meta{existing name}|) [late options={on chain,every chain in,|\meta{options}|}]|
\end{quote}
In particular, it is possible to continue to path after a |\chainin|
command, though that does not seem very useful.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm,
every node/.style=draw,every join/.style=->]
@@ -341,13 +341,13 @@ following command, which is only defined inside scopes where a
\chainin (existing) [join];
\node [draw,on chain,join] {this};
\node [draw,on chain,join] {is};
- }
+ }
\end{tikzpicture}
\end{codeexample}
Here is an example where nodes are positioned using a matrix and
then connected using a chain
-{\catcode`\|=12
+{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\matrix [matrix of nodes,column sep=5mm,row sep=5mm]
@@ -356,7 +356,7 @@ following command, which is only defined inside scopes where a
|(c)| be & |(d) [isosceles triangle]| would \\
|(e) [ellipse]| great & |(f)| ! \\
};
-
+
{ [start chain,every on chain/.style={join=by ->}]
\chainin (a);
\chainin (b);
@@ -364,7 +364,7 @@ following command, which is only defined inside scopes where a
\chainin (c);
\chainin (e);
\chainin (f);
- }
+ }
\end{tikzpicture}
\end{codeexample}
}
@@ -382,7 +382,7 @@ following command, which is only defined inside scopes where a
is used. This |edge| command gets the \meta{options} as parameter
and the current node as its target. If there is no
previous node and no |with| is given, no |edge| command gets
- executed.
+ executed.
\begin{stylekey}{/tikz/every join}
This style is executed each time this command is used.
\end{stylekey}
@@ -452,7 +452,7 @@ was just described.
\node [on chain] {$\beta$};
\node [on chain] {$\gamma$};
}
-
+
\node [on chain,join=with trunk/numbers-end,join=with trunk/greek-end] {C};
{ [start branch=symbols going below]
\node [on chain] {$\star$};
@@ -465,7 +465,7 @@ was just described.
\end{key}
\begin{key}{/tikz/continue branch=\meta{branch name}\opt{\meta{direction}}}
- This option works like the |continue chain| option, only
+ This option works like the |continue chain| option, only
\meta{current chain}|/|\meta{branch name} is used as the chain name,
rather than just \meta{branch name}.
\begin{codeexample}[]
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
new file mode 100644
index 00000000000..496eac52179
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
@@ -0,0 +1,2166 @@
+% Copyright 2008 by Till Tantau and Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\section{Circuit Libraries}
+\label{section-library-circuits}
+
+\emph{Written and documented by Till Tantau, and Mark Wibrow. Inspired
+by the work of Massimo Redaelli.}
+
+\subsection{Introduction}
+
+The circuit libraries can be used to draw different kinds of
+electrical or logical circuits. There is not a single library for
+this, but a whole hierarchy of libraries that work in concert. The
+main design goal was to create a balance between ease-of-use and
+ease-of-extending, while creating high-quality graphical
+representations of circuits.
+
+\subsubsection{A First Example}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,x=3cm,y=2cm,semithick,
+ every info/.style={font=\footnotesize},
+ small circuit symbols,
+ set resistor graphic=var resistor IEC graphic,
+ set diode graphic=var diode IEC graphic,
+ set make contact graphic= var make contact IEC graphic]
+ % Let us start with some contacts:
+ \foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5}
+ {
+ \node [contact] (left contact \contact) at (0,\y) {};
+ \node [contact] (right contact \contact) at (1,\y) {};
+ }
+ \draw (right contact 1) -- (right contact 2) -- (right contact 3)
+ -- (right contact 4) -- (right contact 5);
+
+ \draw (left contact 1) to [diode] ++(down:1)
+ to [voltage source={near start,
+ direction info={volt=3}},
+ resistor={near end,ohm=3}] ++(right:1)
+ to (right contact 1);
+ \draw (left contact 1) to [resistor={ohm=4}] (right contact 1);
+ \draw (left contact 1) to [resistor={ohm=3}] (left contact 2);
+ \draw (left contact 2) to [voltage source={near start,
+ direction info={<-,volt=8}},
+ resistor={ohm=2,near end}] (right contact 2);
+ \draw (left contact 2) to [resistor={near start,ohm=1},
+ make contact={near end,info'={[red]$S_1$}}]
+ (left contact 3);
+ \draw (left contact 3) to [current direction'={near start,info=$\iota$},
+ resistor={near end,info={$R=4\Omega$}}]
+ (right contact 3);
+ \draw (left contact 4) to [voltage source={near start,
+ direction info={<-,volt=8}},
+ resistor={ohm=2,near end}] (right contact 4);
+ \draw (left contact 3) to [resistor={ohm=1}] (left contact 4);
+ \draw (left contact 4) to [resistor={ohm=3}] (left contact 5);
+ \draw (left contact 5) to [resistor={ohm=4}] (right contact 5);
+ \draw (left contact 5) to [diode] ++(up:1)
+ to [voltage source={near start,
+ direction info={volt=3}},
+ resistor={near end,ohm=3}] ++(right:1)
+ to (right contact 5);
+\end{tikzpicture}
+\end{codeexample}
+
+An important feature of the circuit library is that the appearance of
+a circuit can be configured in general ways and that the labels are
+placed automatically by default. Here is the graphic once more,
+generated from \emph{exactly the same source code}, with only
+the options of the |{tikzpicture}| environment replaced by
+|[rotate=-90,circuit ee IEC,x=3.25cm,y=2.25cm]|:
+
+\begin{tikzpicture}[rotate=-90,circuit ee IEC,x=3cm,y=2.25cm]
+ % Let us start with some contacts:
+ \foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5}
+ {
+ \node [contact] (left contact \contact) at (0,\y) {};
+ \node [contact] (right contact \contact) at (1,\y) {};
+ }
+ \draw (right contact 1) -- (right contact 2) -- (right contact 3)
+ -- (right contact 4) -- (right contact 5);
+
+ \draw (left contact 1) to [diode] ++(down:1)
+ to [voltage source={near start,direction info={volt=3}},
+ resistor={near end,ohm=3}] ++(right:1)
+ to (right contact 1);
+ \draw (left contact 1) to [resistor={ohm=4}] (right contact 1);
+ \draw (left contact 1) to [resistor={ohm=3}] (left contact 2);
+ \draw (left contact 2) to [voltage source={near start,
+ direction info={<-,volt=8}},
+ resistor={ohm=2,near end}] (right contact 2);
+ \draw (left contact 2) to [resistor={near start,ohm=1},
+ make contact={near end,info'={[red]$S_1$}}] (left contact 3);
+ \draw (left contact 3) to [current direction'={near start,info=$\iota$},
+ resistor={near end,info={$R=4\Omega$}}]
+ (right contact 3);
+ \draw (left contact 4) to [voltage source={near start,
+ direction info={<-,volt=8}},
+ resistor={ohm=2,near end}] (right contact 4);
+ \draw (left contact 3) to [resistor={ohm=1}] (left contact 4);
+ \draw (left contact 4) to [resistor={ohm=3}] (left contact 5);
+ \draw (left contact 5) to [resistor={ohm=4}] (right contact 5);
+ \draw (left contact 5) to [diode] ++(up:1)
+ to [voltage source={near start,direction info={volt=3}},
+ resistor={near end,ohm=3}] ++(right:1)
+ to (right contact 5);
+\end{tikzpicture}
+
+
+\subsubsection{Symbols}
+
+A circuit typically consists of numerous electronic elements like
+logical gates or resistors or diodes that are connected by wires. In
+\pgfname/\tikzname, we use nodes for the
+electronic elements and normal lines for the wires. \tikzname\ offers
+a large number of different ways of positioning and connecting nodes
+in general, all of which can be used here. Additionally, the
+|circuits| library defines an additional useful |to|-path that is
+particularly useful for elements like a resistor on a line.
+
+There are many different names that are used to refer to electrical
+``elements,'' so a bit of terminology standardization is useful: We
+will call such elements \emph{symbols}. A \emph{symbol shape} is a
+\pgfname\ shape declared using the |\pgfdeclareshape| command. A
+\emph{symbol node} is a node whose shape is a symbol shape.
+
+
+\subsubsection{Symbol Graphics}
+
+Symbols can be created by
+|\node[shape=some symbol shape]|. However, in order to represent some
+symbols correctly, just using standard \pgfname\ shapes is not
+sufficient. For instance, most symbols have a visually appealing
+``default size,'' but the size of a symbol shape depends only on the
+current values of parameters like |minimum height| or |inner xsep|.
+
+For these reasons, the circuit libraries introduce the concept of a
+\emph{symbol graphic}. This is a style that causes a |\node| to
+not only have the correct shape, but also the correct size and the
+correct path usage. More generally, this style may setup things in any
+way so that the ``symbol looks correct''. When you write, for
+instance, |\node[diode]|, then the style called |diode graphic| is
+used, which in turn is set to something like
+|shape=diode IEC,draw,minimum height=...|.
+
+Here is an overview of the different kinds of circuit libraries:
+
+\begin{itemize}
+\item The \tikzname-library |circuits| defines general keys for
+ creating circuits. Mostly, these keys are useful for defining more
+ specialized libraries.
+
+ You normally do not use this library directly since it does not
+ define any symbol graphics.
+\item The \tikzname-library |circuits.logic| defines keys for creating
+ logical gates like and-gates or xor-gates. However, this library
+ also does not actually define any symbol graphics; this is done by
+ two sublibraries:
+ \begin{itemize}
+ \item The library |circuits.logic.US| defines symbol graphics that
+ cause the logical gates to be rendered in the ``US-style.'' It
+ includes all of the above libraries and you can use this library
+ directly.
+ \item The library |circuits.logic.IEC| also defines symbol graphics
+ for logical gates, but it uses rectangular gates rather that the
+ round US-gates. This library can coexist peacefully with the above
+ library, you can change which symbol graphics are used ``on the
+ fly.''
+ \end{itemize}
+\item The \tikzname-library |cirucits.ee| defines keys for symbols
+ from electrical engineering like resistors or capacitors. Again,
+ sublibraries define the actual symbol graphics.
+ \begin{itemize}
+ \item The library |circuits.ee.IEC| defines symbol shapes that
+ follow the IEC norm.
+ \end{itemize}
+\item The \pgfname-libraries |shapes.gates.*| define (circuit) symbol
+ shapes. However, you normally do not use these shapes directly,
+ rather you use a style that uses an appropriate symbol graphic,
+ which in turn uses one of these shapes.
+\end{itemize}
+
+Let us have a look at a simple example. Suppose we wish to create a
+logical circuit. Then we first have to decide which symbol graphics we
+would like to use. Suppose we wish to use the US-style, then we would
+include the library |circuits.logic.US|. If you wish to use IEC-style
+symbols, use |circuits.logic.IEC|. If you cannot decide, include both:
+\begin{codeexample}[code only]
+\usetikzlibrary{circuits.logic.US,circuits.logic.IEC}
+\end{codeexample}
+To create a picture that contains a US-style circuit you can now use
+the option |circuit logic US|. This will setup keys like |and gate| to
+create use an appropriate symbol graphic for rendering an and
+gate. Using the |circuit logic IEC| instead will setup |and gate| to
+use another symbol graphic.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit logic US]
+ \matrix[column sep=7mm]
+ {
+ \node (i0) {0}; & & \\
+ & \node [and gate] (a1) {}; & \\
+ \node (i1) {0}; & & \node [or gate] (o) {};\\
+ & \node [nand gate] (a2) {}; & \\
+ \node (i2) {1}; & & \\
+ };
+ \draw (i0.east) -- ++(right:3mm) |- (a1.input 1);
+ \draw (i1.east) -- ++(right:3mm) |- (a1.input 2);
+ \draw (i1.east) -- ++(right:3mm) |- (a2.input 1);
+ \draw (i2.east) -- ++(right:3mm) |- (a2.input 2);
+ \draw (a1.output) -- ++(right:3mm) |- (o.input 1);
+ \draw (a2.output) -- ++(right:3mm) |- (o.input 2);
+ \draw (o.output) -- ++(right:3mm);
+\end{tikzpicture}
+\end{codeexample}
+
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit logic IEC]
+ \matrix[column sep=7mm]
+ {
+ \node (i0) {0}; & & \\
+ & \node [and gate] (a1) {}; & \\
+ \node (i1) {0}; & & \node [or gate] (o) {};\\
+ & \node [nand gate] (a2) {}; & \\
+ \node (i2) {1}; & & \\
+ };
+ \draw (i0.east) -- ++(right:3mm) |- (a1.input 1);
+ \draw (i1.east) -- ++(right:3mm) |- (a1.input 2);
+ \draw (i1.east) -- ++(right:3mm) |- (a2.input 1);
+ \draw (i2.east) -- ++(right:3mm) |- (a2.input 2);
+ \draw (a1.output) -- ++(right:3mm) |- (o.input 1);
+ \draw (a2.output) -- ++(right:3mm) |- (o.input 2);
+ \draw (o.output) -- ++(right:3mm);
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsubsection{Annotations}
+
+An \emph{annotation} is a little extra drawing that can be added to a
+symbol. For instance, when you add two little parallel arrows pointing
+away from some electrical element, this usually means that the element
+is light emitting.
+
+Instead of having one symbol for ``diode'' and another for ``light
+emitting diode,'' there is just one |diode| symbol, but you can add
+the |light emitting| annotation to it. This is done by passing the
+annotation as a parameter to the symbol as in the following example:
+
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \draw (0,0) to [diode={light emitting}] (3,0)
+ to [resistor={adjustable}] (3,2);
+\end{codeexample}
+
+
+
+\subsection{The Base Circuit Library}
+
+\begin{tikzlibrary}{circuits}
+ This library is a base library that is included by other circuit
+ libraries. You do not include it directly, but you will typically
+ use some of the general keys, described below.
+\end{tikzlibrary}
+
+\begin{key}{/tikz/circuits}
+ This key should be passed as an option to a picture or a scope that
+ contains a circuit. It will do some internal setups. This key is
+ normally called by more specialized keys like |circuit ee IEC|.
+\end{key}
+
+
+
+
+\subsubsection{Symbol Size}
+
+\begin{key}{/tikz/circuit symbol unit=\meta{dimension} (initially 7pt)}
+ This dimension is a ``unit'' for the size of symbols. The libraries
+ generally define the sizes of symbols relative to this
+ dimension. For instance, the longer side of an inductor is, by
+ default, in the IEC library equal to five times this
+ \meta{dimension}. When you change this \meta{dimension}, the size of
+ all symbols will automatically change accordingly.
+
+ Note, that it is still possible to overwrite the size of any
+ particular symbol. These settings apply only to the default sizes.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC]
+ \draw (0,1) to [resistor] (3.5,1);
+ \draw[circuit symbol unit=14pt]
+ (0,0) to [resistor] (3.5,0);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{stylekey}{/tikz/huge circuit symbols}
+ This style sets the default circuit symbol unit to |10pt|.
+\end{stylekey}
+\begin{stylekey}{/tikz/large circuit symbols}
+ This style sets the default circuit symbol unit to |8pt|.
+\end{stylekey}
+\begin{stylekey}{/tikz/medium circuit symbols}
+ This style sets the default circuit symbol unit to |7pt|.
+\end{stylekey}
+\begin{stylekey}{/tikz/small circuit symbols}
+ This style sets the default circuit symbol unit to |6pt|.
+\end{stylekey}
+\begin{stylekey}{/tikz/tiny circuit symbols}
+ This style sets the default circuit symbol unit to |5pt|.
+\end{stylekey}
+
+\begin{key}{/tikz/circuit symbol size=|width| \meta{width} |height|
+ \meta{height}}
+ This key sets |minimum height| to \meta{height} times the current
+ value of the circuit symbol unit and the |minimum width| to
+ \meta{width} times this value. Thus, this option can be used with a
+ node command to set the size of the node as a multiple of the
+ circuit symbol unit.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC]
+ \draw (0,1) to [resistor] (2,1) to[inductor] (4,1);
+
+ \begin{scope}
+ [every resistor/.style={circuit symbol size=width 3 height 1}]
+ \draw (0,0) to [resistor] (2,0) to[inductor] (4,0);
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+
+\subsubsection{Declaring New Symbols}
+
+
+\begin{key}{/tikz/circuit declare symbol=\meta{name}}
+ This key is used to declare a symbol. It does not cause this symbol
+ to be shown nor does it set a graphic to be used for the symbol, it
+ simply ``prepares'' several keys that can later be used to draw a
+ symbol and to configure it.
+
+ In detail, the first key that is defined is just called
+ \meta{name}. This key should be given as an option to a |node| or on
+ a |to| path, as explained below. The key will take options, which
+ can be used to influence the way the symbol graphic is rendered.
+
+ Let us have a look at an example. Suppose we want to define a symbol
+ called |foo|, which just looks like a simple rectangle. We could
+ then say
+\begin{codeexample}[code only]
+\tikzset{circuit declare symbol=foo}
+\end{codeexample}
+ The symbol could now be used like this:
+\begin{codeexample}[code only]
+ \node [foo] at (1,1) {};
+ \node [foo={red}] at (2,1) {};
+\end{codeexample}
+
+ However, in the above example we would not actually see anything
+ since we have not yet setup the graphic to be used by |foo|. For
+ this, we must use a key called |set foo graphic| or, generally,
+ |set| \meta{name} |graphic|. This key gets graphic options as parameter
+ that will be set when a symbol |foo| should be shown:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [circuit declare symbol=foo,
+ set foo graphic={draw,shape=rectangle,minimum size=5mm}]
+
+ \node [foo] at (1,1) {};
+ \node [foo={red}] at (2,1) {};
+\end{tikzpicture}
+\end{codeexample}
+
+ In detail, when you use the key \meta{name}=\meta{options} with a
+ node, the following happens:
+ \begin{enumerate}
+ \item The |inner sep| is set to |0.5pt|.
+ \item The following style is executed:
+ \begin{stylekey}{/tikz/every circuit symbol}
+ Use this style to setup things in general.
+ \end{stylekey}
+ \item The graphic options that have been set using
+ |set| \meta{name} |graphic| are set.
+ \item The style |every |\meta{name} is executed. You can use it to
+ configure the symbol further.
+ \item The \meta{options} are executed.
+ \end{enumerate}
+
+ The key \meta{name} will have a different effect when it is used on
+ a |to| path command inside a |circuit| environment (the |circuit|
+ environment sets up |to| paths in such a way that the use of a key
+ declared using |circuit declare symbol| is automatically detected).
+ When \meta{name} is used on a |to| path, the above actions also
+ happen (setting the inner separation, using the symbol graphic, and
+ so on), but they are passed to the key |circuit handle symbol|,
+ which is explained next.
+\end{key}
+
+
+\begin{key}{/tikz/circuit handle symbol=\meta{options}}
+ This key is mostly used internally. Its purpose is to render a
+ symbol. The effect of this key differs, depending on whether it is
+ used as the optional argument of a |to| path command or elsewhere.
+
+ If the key is not used as an argument of a |to| path command, the
+ \meta{options} are simply executed.
+
+ The more interesting case happens when the key is given on a |to|
+ path command. In this case, several things happen:
+ \begin{enumerate}
+ \item The |to| path is locally changed and set to an internal
+ path (which you should not try to change) that consists mostly of
+ a single straight line.
+ \item The \meta{options} are tentatively executed with filtering
+ switched on. Everything is filtered out, except for the key |pos|
+ and also the styles |at start|, |very near start|, |near start|,
+ |midway|, |near end|, |very near end|, and |at end|. If none of
+ them is found, |midway| is used.
+ \item The filtered option is used to determine a position for the
+ symbol on the path. At the given position (with |pos=0|
+ representing the start and |pos=1| representing the end), a node
+ will be added to the path (in a manner to be described presently).
+ \item This node gets \meta{options} as its option list.
+ \item The node is added by virtue of a special |markings|
+ decoration. This means that a |mark| command is executed that
+ causes the node to placed as a mark on the path.
+ \item The marking decoration will automatically subdivide the path
+ and cause a line to be drawn to from the start of the path to the
+ node's border (at the position that lies on a line from the node's
+ center to the start of the path) and then from the node's border
+ (at a position on the other side of the node) to the end of the
+ path.
+ \item The marking decoration will also take care of the case that
+ multiple marks are present on a path, in this case the lines from
+ and to the borders of the nodes are only between consecutive
+ nodes.
+ \item The marking decoration will also rotate the coordinate system
+ in such a way that the $x$-axis points along the path. Thus, if
+ you use the |transform shape| option, the node will ``point
+ along'' the path.
+ \item In case a node is at |pos=0| or at |pos=1| some special code
+ will suppress the superfluous lines to the start or end of the
+ path.
+ \end{enumerate}
+
+ The net effect of all of the above is that a node will be placed
+ ``on the path'' and the path will have a ``gap'' just large enough
+ to encompass the node. Another effect is that you can use this key
+ multiple times on a path to add several node to a path, provided
+ they do not overlap.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit]
+ \draw (0,0) to [circuit handle symbol={draw,shape=rectangle,near start},
+ circuit handle symbol={draw,shape=circle,near end}] (3,2);
+ \end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}[transform shape,circuit]
+ \draw (0,0) to [circuit handle symbol={draw,shape=rectangle,at start},
+ circuit handle symbol={draw,shape=circle,near end}] (3,2);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+
+\subsubsection{Pointing Symbols in the Right Direction}
+
+Unlike normal nodes, which generally should not be rotated since this
+will make their text hard to read, symbols often need to be
+rotated. There are two ways of achieving such rotations:
+
+\begin{enumerate}
+\item When you place a symbol on a |to| path, the graphic symbol is
+ automatically rotated such that it ``points along the path.'' Here
+ is an examples that show how the inductor shape (which looks,
+ unrotated, like this: \tikz[circuit ee IEC]\node[inductor]{};) is
+ automatically rotated around:
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \draw (3,0) to[inductor] (1,0) to[inductor] (0,2);
+\end{codeexample}
+\item Many shapes cannot be placed ``on'' a path in this way, namely
+ whenever there are more than two possible inputs. Also, you may wish
+ to place the nodes first, possibly using a matrix, and connect them
+ afterwards. In this case, you can simply add rotations like
+ |rotate=90| to the shapes to rotate them. The following four keys
+ make this slightly more convenient:
+ \begin{key}{/tikz/point up}
+ This is the same as |rotate=90|.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \node [diode,point up] {};
+\end{codeexample}
+ \end{key}
+ \begin{key}{/tikz/point down}
+ This is the same as |rotate=-90|.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \node [diode,point down] {};
+\end{codeexample}
+ \end{key}
+ \begin{key}{/tikz/point left}
+ This is the same as |rotate=-180|.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \node [diode,point left] {};
+\end{codeexample}
+ \end{key}
+ \begin{key}{/tikz/point right}
+ This key has no effect.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \node [diode,point right] {};
+\end{codeexample}
+ \end{key}
+\end{enumerate}
+
+
+\subsubsection{Info Labels}
+
+Info labels are used to add text to a circuit symbol. Unlike normal
+nodes like a rectangle, circuit symbols typically do not have text
+``on'' them, but the text is placed next to them (like the text
+``$3\Omega$'' next to a resistor).
+
+\tikzname\ already provides the |label| option for this purpose. The
+|info| option is build on top of this option, but it comes in some
+predefined variants that are especially useful in conjunction with
+circuits.
+
+\begin{key}{/tikz/info=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
+ This key has nearly the same effect as the |label| key, only the
+ following style is used additionally automatically:
+ \begin{stylekey}{/tikz/every info}
+ Set this style to configure the styling of info labels. Since this
+ key is \emph{not} used with normal labels, it provides an easy way
+ of changing the way info labels look without changing other
+ labels.
+ \end{stylekey}
+ The \meta{options} and \meta{angle} are passed directly to the
+ |label| command.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
+ \node [resistor,info=$3\Omega$] {};
+\end{tikzpicture}
+\end{codeexample}
+
+ You will find a detailed discussion of the |label| option on
+ page~\pageref{label-option}.
+
+ Hint: To place some text \emph{on} the main node, use |center| as
+ the \meta{angle}:
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
+ \node [resistor,info=center:$3\Omega$] {};
+ \node [resistor,point up,info=center:$R_1$] at (2,0) {};
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/info'=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
+ This key works exactly like the |info| key, only in case the
+ \meta{angle} is missing, it defaults to |below| instead of the
+ current value of |label position|, which is usually |above|. This
+ means that when you use |info|, you get a label above the node,
+ while when you use the |info'| key you get a label below the
+ node. In case the node has been rotated, the positions of the info
+ nodes are rotated accordingly.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
+ \draw (0,0) to[resistor={info={$3\Omega$},info'={$R_1$}}] (3,0)
+ to[resistor={info={$4\Omega$},info'={$R_2$}}] (3,2);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/info sloped=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
+ This key works like |info|, only the |transform shape| option is set
+ when the label is drawn, causing it to follow the sloping of the
+ main node.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
+ \draw (0,0) to[resistor={info sloped={$3\Omega$}}] (3,0)
+ to[resistor={info sloped={$4\Omega$}}] (3,2);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/info' sloped=}
+ This is a combination of |info'| and |info sloped|.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
+ \draw (0,0) to[resistor={info' sloped={$3\Omega$}}] (3,0)
+ to[resistor={info' sloped={$4\Omega$}}] (3,2);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/circuit declare unit=\marg{name}\marg{unit}}
+ This key is used to declare keys that make it easy to attach
+ physical units to nodes. The idea is that instead of
+ |info=$3\Omega$| you can write |ohm=3| or instead of
+ |info'=$5\mathrm{S}$| you can write |siemens'=5|.
+
+ In detail, four keys are defined, namely |/tikz/|\meta{name},
+ |/tikz/|\meta{name}|'|, |/tikz/|\meta{name} |sloped|, and
+ |/tikz/|\meta{name}|'| |sloped|. The arguments of all of these keys
+ are of the form
+ \opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{value} and it is
+ passed (slightly modified) to the corresponding key |info|, |info'|,
+ |info| |sloped|, or |info'| |sloped|. The ``slight modification'' is the
+ following: The text that is passed to the, say, |info| key is not
+ \meta{value}, but rather |$\mathrm{|\meta{value}\meta{unit}|}$|
+
+ This means that after you said |circuit declare unit={ohm}{\Omega}|,
+ then |ohm=5k| will have the same effect as
+ |info={[every ohm]$\mathrm{5k\Omega}$}|. Here, |every ohm| is a
+ style that allows you to configure the appearance of this unit.
+ Since the |info| key is used internally, by changing the
+ |every info| style, you can change the appearance of all units
+ infos.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC,circuit declare unit={my ohm}{O}]
+ \draw (0,0) to[resistor={my ohm' sloped=3}] (3,2);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+\subsubsection{Declaring and Using Annotations}
+
+Annotations are quite similar to info labels. The main difference is
+that they generally cause something to be drawn by default rather than
+some text to be added (although an annotation might also add some
+text).
+
+Annotations can be declared using the following key:
+
+\begin{key}{/tikz/circuit declare annotation=\marg{name}\marg{distance}\marg{path}}
+ This key is used to declare an annotation named \meta{name}. Once
+ declared, it can be used as an argument of a symbol and will add the
+ drawing in \meta{path} to the symbol. In detail, the following
+ happens:
+
+ \textbf{The Main Keys.}
+ Two keys called \meta{name} and \meta{name}|'| are
+ defined. The second causes the annotation to be ``mirrored and
+ placed on the other side'' of the symbol. Both of these keys may
+ also take further keys as parameter like |info| keys.
+ Whenever the \meta{name} key is used, a local scope is opened and in
+ this scope the following things are done:
+ \begin{enumerate}
+ \item The style |every| \meta{name} is executed.
+ \item The following style is executed and then |arrows=->|:
+ \begin{stylekey}{/tikz/annotation arrow}
+ This style should set the |>| key to some desirable arrow tip.
+ \end{stylekey}
+ \item The coordinate system is shifted such that the origin is at
+ the north anchor of the symbol. (For the \meta{name}|'| key the
+ coordinate system is flipped and shifted such that the origin is
+ at the south anchor of the symbol.)
+ \item The |label distance| is locally set to \meta{distance}.
+ \item The parameter options given to the \meta{name} key are
+ executed.
+ \item The \meta{path} is executed.
+ \end{enumerate}
+
+ \textbf{Usage.}
+ What all of the above amounts to is best explained by an
+ example. Suppose we wish to create an annotation that looks like a
+ little circular arrow (like \tikz \draw [->] (0,0) arc
+ (-270:80:1ex);). We could then say:
+\begin{codeexample}[code only]
+\tikzset{circuit declare annotation=
+ {circular annotation}
+ {9pt}
+ {(0pt,8pt) arc (-270:80:3.5pt)}
+}
+\end{codeexample}
+ We can then use it like this:
+\tikzset{circuit declare annotation=
+ {circular annotation}
+ {8pt}
+ {(0pt,8pt) arc (-270:80:3.5pt)}
+}
+\begin{codeexample}[]
+\tikz[circuit ee IEC]
+ \draw (0,0) to [resistor={circular annotation}] (3,0);
+\end{codeexample}
+ Well, not very impressive since we do not see anything. This is due to
+ the fact that the \meta{path} becomes part of a path that contains
+ the symbol node an nothing else. This path is not drawn or filled,
+ so we do not see anything. What we must do is to use an |edge| path
+ operation:
+\begin{codeexample}[]
+\tikzset{circuit declare annotation={circular annotation}{9pt}
+ {(0pt,8pt) edge[to path={arc(-270:80:3.5pt)}] ()}
+}
+\tikz[circuit ee IEC]
+ \draw (0,0) to [resistor={circular annotation}] (3,0)
+ to [capacitor={circular annotation'}] (3,2);
+\end{codeexample}
+ The \meta{distance} is important for the correct placement of
+ additional |info| labels. When an annotation is present, the info
+ labels may need to be moved further away from the symbol, but not
+ always. For this reason, an annotation defines an additional
+ \meta{distance} that is applied to all info labels given
+ as parameters to the annotation. Here is an example, that shows the
+ difference:
+\tikzset{circuit declare annotation={circular annotation}{9pt}
+ {(0pt,8pt) edge[to path={arc (-270:80:3.5pt)}] ()}
+}
+\begin{codeexample}[]
+\tikz[circuit ee IEC]
+ \draw (0,0) to [resistor={circular annotation,ohm=5}] (2,0)
+ to [resistor={circular annotation={ohm=5}}] (4,0);
+\end{codeexample}
+\end{key}
+
+
+\subsubsection{Theming Symbols}
+\label{section-theming-symbols}
+For each symbol, a certain graphical representation is chosen to
+actually show the symbol. You can modify this graphical representation
+in several ways:
+
+\begin{itemize}
+\item You can select a different library and use a different
+ |circuit ...| key. This will change all graphics used for the
+ symbols.
+\item You can generally change the size of graphic symbols by setting
+ |circuit size unit| to a different value or using a key like
+ |small circuit symbols|.
+\item
+ You can add options to the graphics used by symbols either globally
+ by setting the |every circuit| |symbol| style or locally by setting the
+ |every| \meta{name} style, where \meta{name} is the name of a
+ symbol. For instance, in the following picture the symbols are
+ ridiculously thick and resistors are red.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [circuit ee IEC,
+ every circuit symbol/.style={ultra thick},
+ every resistor/.style={red}]
+
+ \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2);
+\end{tikzpicture}
+\end{codeexample}
+\item You can selectively change the graphic used for a symbol
+ by saying |set resistor graphic=|.
+\item You can change one or more of the following styles:
+ \begin{stylekey}{/tikz/circuit symbol open (initially draw)}
+ This style is used with symbols that consist of lines that
+ surround some area. For instance, the IEC version of a resistor is
+ an open symbol.
+\begin{codeexample}[]
+\tikz [circuit ee IEC,
+ circuit symbol open/.style={thick,draw,fill=yellow}]
+ \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2);
+\end{codeexample}
+ \end{stylekey}
+ \begin{stylekey}{/tikz/circuit symbol filled (initially {draw,fill=black})}
+ This style is used with symbols that are completely filled. For
+ instance, the variant IEC version of an inductor is a filled,
+ black rectangle.
+ \end{stylekey}
+ \begin{stylekey}{/tikz/circuit symbol lines (initially draw)}
+ This style is used with symbols that consist only of lines the do
+ not surround anything. Examples are a capacitor.
+\begin{codeexample}[]
+\tikz [circuit ee IEC,
+ circuit symbol lines/.style={thick,draw=red}]
+ \draw (0,0) to [capacitor] ++(right:3) to [resistor] ++(up:2);
+\end{codeexample}
+ \end{stylekey}
+ \begin{stylekey}{/tikz/circuit symbol wires (initially draw)}
+ This style is used for symbols that consist only of ``wires.'' The
+ difference to the previous style is that a symbol consisting of
+ wires will look strange when the lines are thicker than the lines
+ of normal wires, while for symbols consisting of lines (but not
+ wires) it may look nice to make them thicker. An example is the
+ |make contact| symbol.
+
+ Compare
+\begin{codeexample}[]
+\tikz [circuit ee IEC,circuit symbol lines/.style={draw,very thick}]
+ \draw (0,0) to [capacitor={near start},
+ make contact={near end}] (3,0);
+\end{codeexample}
+ to
+\begin{codeexample}[]
+\tikz [circuit ee IEC,circuit symbol wires/.style={draw,very thick}]
+ \draw (0,0) to [capacitor={near start},
+ make contact={near end}] (3,0);
+\end{codeexample}
+ \end{stylekey}
+\end{itemize}
+
+All circuit environments like |circuit logic IEC| mainly use options
+like |set and gate graphic=...| to setup the graphics used for a certain
+symbol. It turns out that graphic hidden in the ``|...|'' part is also
+always available as a separate style, whose name contains the
+library's initials. For instance, the |circuit logic IEC| option
+actually contains the following command:
+\begin{codeexample}[code only]
+ set and gate graphic = and gate IEC graphic,
+\end{codeexample}
+The |and gate IEC graphic| style, in turn, is defined as follows:
+\begin{codeexample}[code only]
+\tikzset{and gate IEC graphic/.style=
+ {
+ circuit symbol open,
+ circuit symbol size=width 2.5 height 4,
+ shape=and gate IEC,
+ inner sep=.5ex
+ }
+}
+\end{codeexample}
+
+Normally, you do not need to worry about this, since you will not need
+to access a style like |and gate IEC graphic| directly; you will only
+use the |and gate| key. However, sometimes libraries define
+\emph{variants} of a graphic; for instance, there are two variants for
+the resistor graphic in the IEC library. In this case you can set the
+graphic for the resistor to this variant (or back to the original) by
+saying |set resistor graphic| yourself:
+
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit ee IEC]
+ % Standard resistor
+ \draw (0,2) to [resistor] (3,2);
+
+ % Var resistor
+ \begin{scope}[set resistor graphic=var resistor IEC graphic]
+ \draw (0,1) to [resistor] (3,1);
+
+ % Back to original
+ \draw [set resistor graphic=resistor IEC graphic]
+ (0,0) to [resistor] (3,0);
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsection{Logical Circuits}
+
+
+\subsubsection{Overview}
+
+A \emph{logical circuit} is a circuit that contains what we call
+\emph{logical gates} like an and-gate or an xor-gate. The logical
+libraries are intended to make it easy to draw such circuits.
+
+In the following, we first have a look at the different libraries that
+can be used in principle and how the symbols look like. Then we have a
+more detailed look at how the symbols are used. Finally, we discuss
+the implementation details.
+
+There are different ways of depicting logical gates, which is why there
+are different (sub-)libraries for drawing them. They provide the
+necessary graphical representations of the symbols declared in the
+following library:
+
+\begin{tikzlibrary}{circuits.logic}
+ This library declares the logical gate symbols, but does not
+ provide the symbol graphics.
+ The library also defines the following key which, however, is also
+ only used indirectly, namely by other libraries:
+ \begin{key}{/tikz/circuit logic}
+ This style calls the keys |circuit| (which internally calls
+ |every circuit|, then it defines the |inputs| key and it calls the
+ |every circuit logic| key.
+ \begin{key}{/tikz/inputs=\meta{inputs}}
+ This key is defined only inside the scope of a
+ |circuit logic|. There, it has the same effect as
+ |logic gate inputs|, described on
+ page~\pageref{logic-gate-inputs}.
+ \end{key}
+ \begin{stylekey}{/tikz/every circuit logic}
+ Use this key to configure the appearance of logical circuits.
+ \end{stylekey}
+ \end{key}
+\end{tikzlibrary}
+
+Since the |circuit.logic| library does not define any actual graphics,
+you need to use one of the following libraries, instead:
+
+\begin{pgflibrary}{circuits.logic.IEC}
+ This library provides graphics based on gates
+ recommended by the International Electrotechnical Commission. When
+ you include this library, you can use the following key to
+ setup a scope that contains a logical circuit where the gates are
+ shown in this style.
+
+ \begin{key}{/tikz/circuit logic IEC}
+ This key calls |circuit logic| and installs the IEC-like
+ graphics for the logical symbols like |and gate|.
+
+ As explained in Section~\ref{section-theming-symbols}, for each
+ graphic symbol of the library there is also a style that stores this
+ particular appearance. These keys are called |and gate IEC graphic|,
+ |or gate IEC graphic|, and so on.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit logic IEC,
+ every circuit symbol/.style={
+ logic gate IEC symbol color=black,
+ fill=blue!20,draw=blue,very thick}]
+ \matrix[column sep=7mm]
+ {
+ \node (i0) {0}; & & \\
+ & \node [and gate] (a1) {}; & \\
+ \node (i1) {0}; & & \node [or gate] (o) {};\\
+ & \node [nand gate] (a2) {}; & \\
+ \node (i2) {1}; & & \\
+ };
+ \draw (i0.east) -- ++(right:3mm) |- (a1.input 1);
+ \draw (i1.east) -- ++(right:3mm) |- (a1.input 2);
+ \draw (i1.east) -- ++(right:3mm) |- (a2.input 1);
+ \draw (i2.east) -- ++(right:3mm) |- (a2.input 2);
+ \draw (a1.output) -- ++(right:3mm) |- (o.input 1);
+ \draw (a2.output) -- ++(right:3mm) |- (o.input 2);
+ \draw (o.output) -- ++(right:3mm);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+\end{pgflibrary}
+
+\begin{pgflibrary}{circuits.logic.US}
+ This library provides graphics showing ``American'' logic
+ gates. It defines the following key:
+
+ \begin{key}{/tikz/circuit logic US}
+ This style calls |circuit logic| and installs US-like graphics
+ for the logical symbols like |and gate|. For instance, it says
+ \begin{codeexample}[code only]
+set and gate graphic = and gate US graphic
+ \end{codeexample}
+
+ Here is an example:
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit logic CDH,
+ tiny circuit symbols,
+ every circuit symbol/.style={
+ fill=white,draw}]
+ \matrix[column sep=7mm]
+ {
+ \node (i0) {0}; & & \\
+ & \node [and gate] (a1) {}; & \\
+ \node (i1) {0}; & & \node [or gate] (o) {};\\
+ & \node [nand gate] (a2) {}; & \\
+ \node (i2) {1}; & & \\
+ };
+ \draw (i0.east) -- ++(right:3mm) |- (a1.input 1);
+ \draw (i1.east) -- ++(right:3mm) |- (a1.input 2);
+ \draw (i1.east) -- ++(right:3mm) |- (a2.input 1);
+ \draw (i2.east) -- ++(right:3mm) |- (a2.input 2);
+ \draw (a1.output) -- ++(right:3mm) |- (o.input 1);
+ \draw (a2.output) -- ++(right:3mm) |- (o.input 2);
+ \draw (o.output) -- ++(right:3mm);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+\end{pgflibrary}
+
+\begin{pgflibrary}{circuits.logic.CDH}
+ This library provides graphics based on the logic symbols used in
+ A. Croft, R. Davidson, and M. Hargreaves (1992), \emph{Engineering
+ Mathematics}, Addison-Wesley, 82--95. They are identical to the
+ US-style symbols, except for the and- and nand-gates.
+
+ \begin{key}{/tikz/circuit logic CDH}
+ This key calls |circuit logic US| and installs the two special
+ and- and nand-gates, that is, it uses |set and gate graphic| with
+ |and gate CDH graphic| and likewise for nand-gates.
+ \end{key}
+\end{pgflibrary}
+
+
+Inside |circuit logic XYZ| scopes, you can now use the keys shown in
+Section~\ref{section-logic-symbols}. We have a more detailed look at
+one of them, all the other work the same way:
+
+\begin{key}{/tikz/and gate}
+ This key should be passed to a |node| command. It will cause the
+ node to ``look like'' an and-gate, where the exact appearance of the
+ gate is dictated by the which circuit environment is used. To
+ further configure the appearance of the |and gate|, see
+ Section~\ref{section-theming-symbols}.
+
+\begin{codeexample}[]
+\tikz [circuit logic IEC] \node [and gate] {$A$};
+\end{codeexample}
+\begin{codeexample}[]
+\tikz [circuit logic US]
+{
+ \node [and gate,point down] {$A$};
+ \node [and gate,point down,info=center:$A$] at (1,0) {};
+}
+\end{codeexample}
+
+ \medskip\textbf{Inputs.}
+ Multiple inputs can be specified for a logic gate (provided they
+ support multiple inputs: a not gate---also known as an
+ inverter---does not). However, there is an upper limit for the
+ number of inputs which has been set at 1024, which should be \emph{way}
+ more than would ever be needed.
+
+ The following key is used to configure the inputs. It is available
+ only inside a |circuit logic| environment.
+
+ \begin{key}{/tikz/inputs=\meta{input list} (initially \char`\{normal,normal\char`\})}
+ If a gate has $n$ inputs, the \meta{input list} should consists of
+ $n$ letters, each being |i| for ``inverted'' or |n| for
+ ``normal.'' Inverted gates will be indicated by a little
+ circle. In any case the anchors for the inputs will be set
+ up appropriately, numbered from top to bottom |input 1|, |input 2|,
+ \ldots and so on. If the gate only supports one input the anchor
+ is simply called |input| with no numerical index.
+\begin{codeexample}[]
+\begin{tikzpicture}[circuit logic IEC]
+ \node[and gate,inputs={inini}] (A) {};
+ \foreach \a in {1,...,5}
+ \draw (A.input \a -| -1,0) -- (A.input \a);
+ \draw (A.output) -- ++(right:5mm);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+
+ (This key is just a shorthand for |logic gate inputs|, described
+ in detail on page~\pageref{logic-gate-inputs}. There you will also
+ find descriptions of how to configure the size of the inverted
+ circles and the way the symbol size increases when there are too
+ many inputs.)
+
+ \textbf{Output.}
+ Every logic gate has one anchor called |output|.
+\end{key}
+
+
+\subsubsection{Symbols: The Gates}
+
+\label{section-logic-symbols}
+
+The following table shows which symbols are declared by the main
+|circuits.logic| library and their appearance in the different
+sublibraries.
+\medskip
+
+\def\gateexamples#1{%
+ \texttt{#1}
+ \indexkey{#1} &
+ \tikz[baseline,circuit logic IEC] \node[#1,label=] {}; &
+ \tikz[baseline,circuit logic US] \node[#1] {}; &
+ \tikz[baseline,circuit logic CDH] \node[#1] {};
+}
+\begin{tabular}{lccc}
+ \emph{Key} & \emph{Appearance inside} & \emph{Appearance inside} & \emph{Appearance inside} \\
+ & |circuit logic IEC| & |circuit logic US| & |circuit logic CDH| \\
+ \gateexamples{/tikz/and gate}\\
+ \gateexamples{/tikz/nand gate}\\
+ \gateexamples{/tikz/or gate}\\
+ \gateexamples{/tikz/nor gate}\\
+ \gateexamples{/tikz/xor gate}\\
+ \gateexamples{/tikz/xnor gate}\\
+ \gateexamples{/tikz/not gate}\\
+ \gateexamples{/tikz/buffer gate}
+\end{tabular}
+
+
+\subsubsection{Implementation: The Logic Gates Shape Library}
+
+The previous sections described the \tikzname\ interface for creating
+logical circuits. In this section we take a closer look at the
+underlying \pgfname\ libraries.
+
+Just as there are several \tikzname\ circuit libraries, there are two
+underlying \pgfname\ shape libraries, one for creating US-style gates
+and one for IEC-style gates. These libraries define \emph{shapes}
+only. It is the job of the circuit libraries to ``theme'' them so that
+they ``look nice.'' However, in principle, you can also use these
+shapes directly.
+
+Let us begin with the base library that defines the handling of
+inputs.
+
+\begin{pgflibrary}{shapes.gates.logic}
+ This library defines common keys used by all logical gate shapes.
+
+\begin{key}{/pgf/logic gate inputs=\meta{input list} (initially \char`\{normal,normal\char`\})}
+ \label{logic-gate-inputs}%
+ Specify the inputs for the logic gate. The keyword |inverted|
+ indicates an inverted input which will mean \pgfname{} will draw a
+ circle attached to the main shape of the logic gate. Any keyword
+ that is not |inverted| will be treated as a ``normal'' or
+ ``non-inverted'' input (however, for readability, you may wish to
+ use |normal| or |non-inverted|), and \pgfname{} will not draw the
+ circle.
+ In both cases the anchors for the inputs will be set
+ up appropriately, numbered from top to bottom |input 1|, |input 2|,
+ \ldots and so on. If the gate only supports one input the anchor
+ is simply called |input| with no numerical index.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum height=0.75cm]
+ \node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}]
+ (A) {};
+ \foreach \a in {1,...,3}
+ \draw (A.input \a -| -1,0) -- (A.input \a);
+ \draw (A.output) -- ([xshift=0.5cm]A.output);
+\end{tikzpicture}
+\end{codeexample}
+
+ For multiple inputs it may be somewhat unwieldy to specify a long
+ list, thus, the following ``shorthand'' is permitted (this is an
+ extension of ideas due to Juergen Werber and Christoph Bartoschek):
+ Using |i| for inverted and |n| for normal inputs, \meta{input list}
+ can be specified \emph{without the commas}. So, for example,
+ |ini| is equivalent to |inverted, normal, inverted|.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum height=0.75cm]
+ \node[or gate US, draw,logic gate inputs=inini] (A) {};
+ \foreach \a in {1,...,5}
+ \draw (A.input \a -| -1,0) -- (A.input \a);
+ \draw (A.output) -- ([xshift=0.5cm]A.output);
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
+
+The height of the gate may be increased to accommodate the number
+of inputs. In fact, it depends on three variables:
+$n$, the number of inputs, $r$, the radius of the circle used
+to indicate an inverted input and $s$, the distance between
+the centers of the inputs.
+The default height is then calculated according to the expression
+$(n+1)\times\max(2r,s)$. This then may
+be increased to accommodate the node contents or any
+minimum size specifications.
+
+The radius of the inverted input circle and the distance between the
+centers of the inputs can be customized using the following keys:
+
+\begin{key}{/pgf/logic gate inverted radius=\meta{length} (initially 2pt)}
+ Set the radius of the circle that is used to indicate inverted
+ inputs. This is also the radius of the circle used for the inverted
+ output of the |nand|, |nor|, |xnor| and |not| gates.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum height=0.75cm]
+ \tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}}
+ \node[logic gate inverted radius=2pt] {A};
+ \node[logic gate inverted radius=4pt] at (0,-1) {B};
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/logic gate input sep=\meta{length} (initially .125cm)}
+ Set the distance between the \emph{centers} of the inputs to the
+ logic gate.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum size=0.75cm]
+ \draw [help lines] grid (3,2);
+ \tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}}
+ \node[logic gate input sep=0.33333cm] at (1,1)(A) {A};
+ \node[logic gate input sep=0.5cm] at (3,1) (B) {B};
+ \foreach \a in {1,...,3}
+ \draw (A.input \a -| 0,0) -- (A.input \a)
+ (B.input \a -| 2,0) -- (B.input \a);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+ \pgfname{} will increase the size of the
+ logic gate to accommodate the number of inputs, and the size
+ of the inverted radius and the separation between the inputs.
+ However with all shapes in this library, any increase in size
+ (including any minimum size requirements) will be applied so that
+ the default aspect ratio is unaltered. This means that changing
+ the height will change the width and vice versa.
+
+\end{pgflibrary}
+
+
+\subsubsection{Implementation: The US-Style Logic Gates Shape Library}
+
+\begin{pgflibrary}{shapes.gates.logic.US}
+ This library provides ``American'' logic gate shapes whose names are
+ suffixed with the identifier |US|. Additionally,
+ alternative |and| and |nand| gates are provided which are based on the
+ logic symbols used in A. Croft, R. Davidson, and M. Hargreaves (1992),
+ \emph{Engineering Mathematics}, Addison-Wesley, 82--95. These two
+ shapes are suffixed with |CDH|.
+
+ The ``compass point'' anchors apply to the main part of the shape
+ and do not include any inverted inputs or outputs. This library
+ provides an additional feature to facilitate the relative positioning
+ of logic gates:
+
+\begin{key}{/pgf/logic gate anchors use bounding box=\meta{boolean} (initially false)}
+ When set to |true| this key will ensure that the
+ compass point anchors use the bounding rectangle of the
+ main shape, which, ignore any inverted inputs or outputs, but
+ includes any |outer sep|.
+ This \emph{only} affects the compass point anchors
+ and is not set on a shape by shape basis: whether the bounding
+ box is used is determined by value of this key when the anchor
+ is accessed.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum height=1.5cm]
+ \node[xnor gate US, draw, gray!50,line width=2pt] (A) {};
+ \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt}
+ \foreach \a in {north, south, east, west, north east,
+ south east, north west, south west}
+ \draw[logic gate anchors use bounding box=\x, color=\y]
+ (A.\a) circle(\z);
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
+
+ The library defines a number of shapes. For each shape the allowed
+ number of inputs is also shown:
+ \begin{itemize}
+ \item |and gate US|, two or more inputs
+ \item |and gate CDH|, two or more inputs
+ \item |nand gate US|, two or more inputs
+ \item |nand gate CDH|, two or more inputs
+ \item |or gate US|, two or more inputs
+ \item |nor gate US|, two or more Inputs
+ \item |xor gate US|, two inputs
+ \item |xnor gate US|, two inputs
+ \item |not gate US|, one input
+ \item |buffer gate US|, one input
+ \end{itemize}
+
+ In the following, we only have a detailed look at the anchors
+ defined by one of them. We choose the |nand gate US| because it
+ shows all the ``interesting'' anchors.
+
+ \begin{shape}{nand gate US}
+ This shape is a nand gate, which supports two or more inputs. If
+ less than two inputs are specified an error will result.
+ The anchors for this gate with two
+ non-inverted inputs (using the normal compass point anchors) are
+ shown below. Anchor |30| is an example of a border anchor.
+
+\begin{codeexample}[]
+\Huge
+\begin{tikzpicture}
+ \node[name=s,shape=nand gate US,shape example, inner sep=0cm,
+ logic gate inputs={in},
+ logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm};
+ \foreach \anchor/\placement in
+ {center/above, text/above, 30/above right,
+ mid/right, mid east/left, mid west/above,
+ base/below, base east/below, base west/left,
+ north/above, south/below, east/above, west/above,
+ north east/above, south east/below, south west/below, north west/above,
+ output/right, input 1/above, input 2/below}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+ \end{shape}
+\end{pgflibrary}
+
+
+
+\subsubsection{Implementation: The IEC-Style Logic Gates Shape Library}
+
+\begin{pgflibrary}{shapes.gates.logic.IEC}
+ This library provides rectangular logic gate shapes. These shapes
+ are suffixed with |IEC| as they are based on gates recommended by
+ the International Electrotechnical Commission.
+
+ By default each gate is drawn with a symbol, $\char`\&$ for |and| and
+ |nand| gates, $\geq1$ for |or| and |nor| gates, $1$ for |not| and
+ |buffer| gates, and $=1$ for |xor| and |xnor| gates. These symbols
+ are drawn automatically (internally they are drawn using the
+ ``foreground'' path), and are not strictly speaking part of the node
+ contents. However, the gate is enlarged to make sure the symbols are
+ within the border of the node.
+ It is possible to change
+ the symbols and their position within the node using the following
+ keys:
+
+\begin{key}{/pgf/and gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)}
+ Set the symbol for the |and gate|. Note that if the node is filled,
+ this color will be used for the symbol, making it invisible, so
+ it will be necessary set \meta{text} to something like
+ |\color{black}\char`\&|. Alternatively, the
+ |logic gate IEC symbol color| key can be used to set the color
+ of all symbols simultaneously.
+
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |and gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/nand gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)}
+ Set the symbol for the |nand gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |nand gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/or gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)}
+ Set the symbol for the |or gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |or gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/nor gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)}
+ Set the symbol for the |nor gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |nor gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/xor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})}
+ Set the symbol for the |xor gate|. Note the necessity for braces,
+ as the symbol contains |=|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |or gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/xnor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})}
+ Set the symbol for the |xnor gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |xnor gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/not gate IEC symbol=\meta{text} (initially 1)}
+ Set the symbol for the |not gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |not gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/buffer gate IEC symbol=\meta{text} (initially 1)}
+ Set the symbol for the |buffer gate|.
+ In \tikzname, when the |use IEC style logic gates| key has been
+ used, this key can be replaced by |buffer gate symbol|.
+\end{key}
+
+\begin{key}{/pgf/logic gate IEC symbol align=\meta{align} (initially top)}
+ Set the alignment of the logic gate symbol (in \tikzname, when the
+ |use IEC style logic gates| key has been used, |IEC| can be omitted.
+ The specification in \meta{align} is a comma separated list from
+ |top|, |bottom|, |left| or |right|. The distance between the border
+ of the node and the outer edge of the symbol is determined by the values
+ of the |inner xsep| and |inner ysep|.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates]
+ \tikzset{every node/.style={nor gate, draw}}
+ \node (A) at (0,1.5) {};
+ \node [logic gate symbol align={bottom, right}] (B) at (0,0) {};
+ \foreach \g in {A, B}{
+ \foreach \i in {1,2}
+ \draw ([xshift=-0.5cm]\g.input \i) -- (\g.input \i);
+ \draw (\g.output) -- ([xshift=0.5cm]\g.output);
+ }
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
+
+
+\begin{key}{/pgf/logic gate IEC symbol color=\meta{color}}
+ This key sets the color for all symbols simultaneously. This color
+ can be overridden on a case by case basis by specifying a color
+ when setting the symbol text.
+\end{key}
+
+ The library defines the following shapes:
+ \begin{itemize}
+ \item |and gate IEC|, two or more inputs
+ \item |nand gate IEC|, two or more inputs
+ \item |or gate IEC|, two or more inputs
+ \item |nor gate IEC|, two or more inputs
+ \item |xor gate IEC|, two inputs
+ \item |xnor gate IEC|, two inputs
+ \item |not gate IEC|, one input
+ \item |buffer gate IEC|, one input
+ \end{itemize}
+
+ Again, we only have a look at the nand-gate in more detail:
+
+\begin{shape}{nand gate IEC}
+ This shape is a nand gate. It supports two or more inputs.
+ If less than two inputs are specified an error will result.
+ The anchors for this gate with two
+ non-inverted inputs are
+ shown below. Anchor |30| is an example of a border anchor.
+
+\begin{codeexample}[]
+\Huge
+\begin{tikzpicture}
+ \node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm,
+ minimum height=6cm, nand gate IEC symbol=\color{black!30}\char`\&,
+ logic gate inputs={in},
+ logic gate inverted radius=0.65cm]
+ {Nand Gate\vrule width1pt height2cm};
+ \foreach \anchor/\placement in
+ {center/above, text/above, 30/above right,
+ mid/right, mid east/left, mid west/above,
+ base/below, base east/below, base west/left,
+ north/above, south/below, east/above, west/above,
+ north east/above, south east/below, south west/below, north west/above,
+ output/right, input 1/above, input 2/below}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+\end{pgflibrary}
+
+
+
+
+\subsection{Electrical Engineering Circuits}
+
+\subsubsection{Overview}
+
+An \emph{electrical engineering circuit} contains symbols like
+resistors or capacitors or voltage sources and annotations like the
+two arrows pointing toward an element whose behaviour is light
+dependent. The electrical engineering libraries, abbreviated
+ee-libraries, provide such symbols and annotations.
+
+Just as for logical gates, there are different ways of drawing
+ee-symbols. Currently, there is one main library for drawing circuits,
+which uses the graphics from the International Electrotechnical
+Commission, but you can add your own libs. This is why, just as for
+logical gates, there are a base library and more specific libraries.
+
+\begin{tikzlibrary}{circuits.ee}
+ This library declares the ee symbols, but (mostly) does not
+ provide the symbol graphics, which is left to the sublibraries.
+ Just like the logical gates library, a key is defined that is
+ normally only used internally:
+ \begin{key}{/tikz/circuit ee}
+ This style calls the keys |circuit| (which internally calls
+ |every circuit| and the following style:
+ \begin{stylekey}{/tikz/every circuit ee}
+ Use this key to configure the appearance of logical circuits.
+ \end{stylekey}
+ \end{key}
+
+ The library also declares some standard annotations and units.
+\end{tikzlibrary}
+
+As for logical circuits, to draw a circuit the first step is to
+include a library containing the symbols graphics. Currently, you have to
+include |circuits.ee.IEC|.
+
+\begin{tikzlibrary}{circuit.ee.IEC}
+ When this library is loaded, you can use the following style:
+ \begin{key}{/tikz/circuit ee IEC}
+ This style calls |circuit ee| and installs the IEC-like
+ graphics for the logical symbols like |resistor|.
+ \end{key}
+\end{tikzlibrary}
+
+Inside the |circuit ee IEC| scope, you can now use the keys for
+symbols, units, and annotations listed in the later sections. We have
+a more detailed look at one of each of them, all the other work the
+same way.
+
+Let us start with an example of a symbol: the resistor symbol. The
+other predefined symbols are listed in
+Section~\ref{section-circuits-ee-symbols} and later sections.
+
+\begin{key}{/tikz/resistor=\opt{\meta{options}}}
+ This key should be used with a |node| path command or with the |to|
+ path command.
+
+ \medskip\textbf{Using the Key with Normal Nodes.}
+ When used with a node, it will cause this node to
+ ``look like'' a resistor (by default, in the IEC library, this is
+ just a simple rectangle).
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \node [resistor] {};
+\end{codeexample}
+
+ Unlike normal nodes, a resistor node generally should not take any
+ text (as in |node [resistor] {foo}|). Instead, the labeling of
+ resistors should be done using the |label|, |info| and |ohm|
+ options.
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \node [resistor,ohm=5] {};
+\end{codeexample}
+
+ The \meta{options} make no real sense when the |resistor| option is
+ used with a normal node, you can just as well given them to the
+ |node| itself. Thus, the following has the same effect as the above
+ example:
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \node [resistor={ohm=5}] {};
+\end{codeexample}
+
+ In a circuit, you will often wish to rotate elements. For this, the
+ options |point up|, |point down|, |point left| or |point right| may
+ be especially useful. They are just shorthands for appropriate
+ rotations like |rotate=90|.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] {
+ \node (R1) [resistor,point up,ohm=5] at (3,1) {};
+ \node (R2) [resistor,ohm=10k] at (0,0) {};
+ \draw (R2) -| (R1);
+}
+\end{codeexample}
+
+ \medskip\textbf{Using the Key on a To Path.}
+ When the |resistor| key is used on a |to| path inside a
+ |circuit ee IEC|, the |circuit handle symbol| key is called
+ internally. This has a whole bunch of effects:
+ \begin{enumerate}
+ \item The path currently being constructed is cut up to make place
+ for a node.
+ \item This node will be a |resistor node| that is rotated so that it
+ points ``along'' the path (unless an option like |shift only| or
+ an extra rotation is used to change this).
+ \item The \meta{options} passed to the |resistor| key are passed on
+ to the node.
+ \item The \meta{options} are pre-parsed to identify a |pos| key or
+ a key like |at start| or |midway|. These keys are used to
+ determine where on the |to| path the node will lie.
+ \end{enumerate}
+
+ Since the \meta{options} of the |resistor| key are passed on to the
+ resistor node on the path, you can use it to add labels to the
+ node. Here is a simple example:
+
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \draw (0,0) to [resistor=red] (3,0)
+ to [resistor={ohm=2\mu}] (3,2);
+\end{codeexample}
+
+ You can add multiple labels to a resistor and you can have multiple
+ resistors (or other elements) on a single path.
+
+ \medskip\textbf{Inputs, Outputs, and Anchors.}
+ Like the logical gates, all ee-symbols have an |input|
+ and an |output| anchor. Special purpose nodes may have even more
+ anchors of this type. Furthermore, the ee-symbols nodes also for
+ standard compass direction anchors.
+
+ \medskip\textbf{Changing the Appearance.}
+ To configure the appearance of all |resistor|s, see
+ Section~\ref{section-theming-symbols}. You can use the
+ \meta{options} to locally change the appearance of a single
+ resistor.
+\end{key}
+
+Let us now have a look at an example of a unit: the Ohm unit. The
+other predefined units are listed in Section~\ref{section-circuits-units}.
+
+\begin{key}{/tikz/ohm=\meta{value}}
+ This key is used to add an |info| label to a node with a special
+ text: |$\mathrm{|\meta{value}|\Omega}$|. In other words, the |ohm|
+ key can only be used with the options of a node and, when used, it
+ will cause the \meta{value} to be placed next to the node, followed
+ by $\Omega$. Since the \meta{value} is typeset inside a |\mathrm|
+ command, when you write |ohm=5k| you get $\mathrm{5k\Omega}$,
+ |ohm=5p| yields $\mathrm{5p\Omega}$, and |ohm=5.6\cdot 10^{2}\mu|
+ yields $\mathrm{5.6\cdot 10^{2}\mu\Omega}$.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm=5M}] (0,2);
+\end{codeexample}
+
+ Instead of |ohm| you can also use |ohm'|, which places the label on
+ the other side.
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm'=5M}] (0,2);
+\end{codeexample}
+
+ Finally, there are also keys |ohm sloped| and |ohm' sloped| for
+ having the info label rotate together with the main node.
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+ \draw (0,0) to [resistor={ohm sloped=5M}] (0,2)
+ (2,0) to [resistor={ohm' sloped=6f}] (2,2);
+\end{codeexample}
+
+ You can configure the appearance of an Ohm info label using the key
+ |every ohm|.
+\end{key}
+
+Finally, let us have a look at an annotation: the |light emitting|
+annotation. The other predefined units are listed in
+Section~\ref{section-circuits-annotations}.
+
+\begin{key}{/tikz/light emitting=\opt{\meta{options}}}
+ Like a unit, an annotation should be given as an additional option
+ to a node. It causes some drawings (in this case, two parallel
+ lines) to be placed next to the node.
+
+\begin{codeexample}[]
+\tikz [circuit ee IEC] \draw (0,0) to [diode=light emitting] (2,0);
+\end{codeexample}
+
+ The \meta{options} can be used for three different things:
+ \begin{enumerate}
+ \item You can use keys like |red| to change the appearance of this
+ annotation, locally.
+ \item You can use keys like |<-| or |-latex| to change the
+ direction and kinds of arrows used in the annotation.
+ \item You can use info labels like |ohm=5| or |info=foo| inside the
+ \meta{options}. These info labels will be added to the main node
+ (not to the annotation itself), but the label distance will have
+ been changed to accommodate for the space taken up by the
+ annotation.
+\begin{codeexample}[]
+\tikz [circuit ee IEC]
+{
+ \draw (0,2) to [diode={light emitting,info=not good}] (2,2);
+ \draw (0,0) to [diode={light emitting={info=better},
+ info'=also good}] (2,0);
+}
+\end{codeexample}
+ \end{enumerate}
+
+ In addition to |light emitting| there is also a key called
+ |light emitting'|, which simply places the annotation on the other
+ side of the node.
+
+ You can configure the appearance of annotations in three ways:
+ \begin{itemize}
+ \item You can set the |every circuit annotation| style.
+ \item You can set the |every light emitting| style.
+ \item You can set the following key:
+ \begin{stylekey}{/tikz/annotation arrow}
+ This style should set the default |>| arrow to some nice value.
+ \end{stylekey}
+ \end{itemize}
+\end{key}
+
+
+
+
+
+\def\eelineexample#1#2{%
+ \texttt{#1}\indexkey{#1}
+ &
+ \tikz[baseline=-.5ex,circuit ee IEC] \draw (0,0) to [#1] (3,0);
+ &
+ \relax\def\temp{#2}
+ \ifx\temp\empty\else
+ {\tikz[baseline=-.5ex,circuit ee IEC,set #2 graphic=var #2 IEC graphic]
+ \draw (0,0) to [#2] (3,0);}
+ \fi \\[.2em]
+}
+\def\eeendexample#1#2{%
+ \texttt{#1}\indexkey{#1}
+ &
+ \tikz[baseline=-.5ex,circuit ee IEC] \draw (0,0) to [#1={at end}] (1.5,0)(3,0);
+ &
+ \relax\def\temp{#2}
+ \ifx\temp\empty\else
+ {\tikz[baseline=-.5ex,circuit ee IEC,set #2 graphic=var #2 IEC graphic]
+ \draw (0,0) to [#2={at end}] (1.5,0)(3,0);}
+ \fi \\[.2em]
+}
+\def\unitexample#1{%
+ \texttt{#1}\indexkey{#1}
+ &
+ \tikz [baseline,inner sep=0pt] \node[#1=1] {};\\
+}
+\def\annotationexample#1{%
+ \texttt{#1}\indexkey{#1}
+ &
+ \tikz[baseline=-.5ex,circuit ee IEC]
+ \draw (0,0) to [resistor={#1}] (2,0)
+ to [diode ={#1'}] (4,0);\\
+}
+\def\empty{}
+
+
+\subsubsection{Symbols: Indicating Current Directions}
+
+\label{section-ee-symbols}
+\label{section-circuits-ee-symbols}
+
+There are two symbols for indicating current directions. These symbols
+are defined directly inside |circuit ee|.
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}ll}
+ \emph{Key} & \emph{Appearance}\\[.25em]
+ \eelineexample{/tikz/current direction}{}
+ \eelineexample{/tikz/current direction'}{}
+\end{tabular}
+
+\medskip
+The examples have been produced by (in essence)
+|\draw (0,0) to[|\meta{symbol name}|] (3,0);|.
+
+
+\subsubsection{Symbols: Basic Elements}
+
+The following table show basic symbols as they are depicted inside the
+|circuit ee IEC| environment. To install one of alternate graphics,
+you have to say |set| \meta{symbol name} |graphic=var| \meta{symbol name}
+|IEC graphic|.
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}ll}
+ \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em]
+ \eelineexample{/tikz/resistor}{resistor}
+ \eelineexample{/tikz/inductor}{inductor}
+ \eelineexample{/tikz/capacitor}{}
+ \eelineexample{/tikz/battery}{}
+ \eelineexample{/tikz/bulb}{}
+ \eelineexample{/tikz/current source}{}
+ \eelineexample{/tikz/voltage source}{}
+ \eeendexample{/tikz/ground}{}
+\end{tabular}
+
+
+\subsubsection{Symbols: Diodes}
+
+The following table shows diodes as they are depicted inside the
+|circuit ee IEC| environment.
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}ll}
+ \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em]
+ \eelineexample{/tikz/diode}{diode}
+ \eelineexample{/tikz/Zener diode}{Zener diode}
+ \eelineexample{/tikz/Schottky diode}{Schottky diode}
+ \eelineexample{/tikz/tunnel diode}{tunnel diode}
+ \eelineexample{/tikz/backward diode}{backward diode}
+ \eelineexample{/tikz/breakdown diode}{breakdown diode}
+\end{tabular}
+
+
+\subsubsection{Symbols: Contacts}
+
+The following table shows contacts as they are depicted inside the
+|circuit ee IEC| environment.
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}ll}
+ \emph{Key} & \emph{Appearance} & \emph{Alternate appearance} \\[.25em]
+ \eelineexample{/tikz/contact}{}
+ \eelineexample{/tikz/make contact}{make contact}
+ \eelineexample{/tikz/break contact}{}
+\end{tabular}
+
+
+\subsubsection{Units}
+
+\label{section-circuits-units}
+
+The |circuit.ee| library predefines the following unit keys:
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}c}
+ \emph{Key} & \emph{Appearance of $1$ unit} \\[.25em]
+ \unitexample{/tikz/ampere}
+ \unitexample{/tikz/volt}
+ \unitexample{/tikz/ohm}
+ \unitexample{/tikz/siemens}
+ \unitexample{/tikz/henry}
+ \unitexample{/tikz/farad}
+ \unitexample{/tikz/coulomb}
+ \unitexample{/tikz/voltampere}
+ \unitexample{/tikz/watt}
+ \unitexample{/tikz/hertz}
+\end{tabular}
+
+
+
+\subsubsection{Annotations}
+
+\label{section-circuits-annotations}
+
+The |circuit.ee.IEC| library defines the following annotations:
+\medskip
+
+\noindent
+\begin{tabular}{p{5cm}ll}
+ \emph{Key} & \emph{Appearance} \\[.25em]
+ \annotationexample{/tikz/light emitting}
+ \annotationexample{/tikz/light dependent}
+ \annotationexample{/tikz/direction info}
+ \annotationexample{/tikz/adjustable}
+\end{tabular}
+\medskip
+
+The lines have been produced using, in essence,
+\begin{codeexample}[code only]
+\draw (0,0) to [resistor=light emitting] (2,0) to [diode=light emitting'] (4,0);
+\end{codeexample}
+and similarly for the other annotations.
+
+
+\subsubsection{Implementation: The EE-Symbols Shape Library}
+
+The \tikzname\ libraries depend on two shape libraries, which are
+included automatically. Usually, you will not need to use these shapes
+directly.
+
+\begin{pgflibrary}{shapes.gates.ee}
+ This library defines basic shapes that can be used by all ee-circuit
+ libraries. Currently, it defines the following shapes:
+ \begin{itemize}
+ \item |rectangle ee|
+ \item |circle ee|
+ \item |direction ee|
+ \end{itemize}
+ Additionally, the library defines the following arrow tip:
+ The |direction ee| arrow tip is basically the same as a |triangle 45|
+ arrow tip with rounded joins.
+
+ \begin{tabular}{ll}
+ \symarrow{direction ee}
+ \end{tabular}
+
+ However, unlike normal arrow tips, its size does \emph{not} depend on
+ the current line width. Rather, it depends on the value of its
+ arrow options, which should be set to the desired size. Thus, you
+ should say something like |\pgfsetarrowoptions{direction ee}{5pt}| to
+ set the size of the arrow.
+\end{pgflibrary}
+
+\begin{shape}{rectangle ee}
+ This shape is completely identical to a normal |rectangle|, only
+ there are two additional anchors: The |input| anchor is an alias for
+ the |west| anchor, while the |output| anchor is an alias for the
+ |east| anchor.
+\end{shape}
+
+\begin{shape}{circle ee}
+ Like the |rectangle ee| shape, only for circles.
+\end{shape}
+
+\begin{shape}{direction ee}
+ This shape is rather special. It is intended to be used to ``turn an
+ arrow tip into a shape.'' First, you should set the following key to
+ the name of an arrow tip:
+ \begin{key}{/pgf/direction ee arrow=\meta{right arrow tip name}}
+ The value of this key will be used for the arrow tip depicted in
+ an |direction ee| shape.
+ \end{key}
+ When a node of shape |direction ee| is created, several things
+ happen:
+ \begin{enumerate}
+ \item The size of the shape is computed according to the following
+ rules: The width of the shape is setup so that the left border of
+ the shape is at the left end of the arrow tip and the right border
+ is at the right end of the arrow tip. These left and right
+ ``ends'' of the arrow are the left and right extends specified by
+ the arrow itself (see the documentation of the |\pgfarrowsdeclare|
+ for details). You usually need not worry about this width
+ setting.
+
+ By comparison, the height of the arrow is given my the current
+ setting of |minimum height|. Thus, this key must have been setup
+ correctly to reflect the ``real'' height of the arrow tip. The
+ reason is that the height of an arrow is not specified when arrows
+ are declared and is, thus, not available, here.
+
+ Possibly, the height computation will change in the future to
+ reflect the real height of the arrow, so you should generally
+ setup the |minimum height| to be the same as the real height.
+ \item A straight line from left to right inside the shape's
+ boundaries is added to the background path.
+ \item The arrow tip, pointing right, is drawn before the background
+ path.
+ \end{enumerate}
+ The anchors of this shape are just the compass anchors, which lie on
+ a rectangle whose width and height are the above-computed height and
+ width.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \pgfsetarrowoptions{direction ee}{6cm}
+ \node[name=s,shape=direction ee,shape example,minimum height=0.7654*6cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[direction ee arrow=angle 45]
+ \node[name=s,shape=direction ee,shape example,minimum height=1.75cm] {};
+ \foreach \anchor/\placement in {north/above, south/below,
+ output/right, input/left}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+
+\subsubsection{Implementation: The IEC-Style EE-Symbols Shape Library}
+
+\begin{pgflibrary}{shapes.gates.ee.IEC}
+ This library defines shapes for depicting ee symbols according to
+ the IEC recommendations. These shapes will typically be
+ used in conjunction with the graphic mechanism detailed earlier, but
+ you can also used them directly.
+\end{pgflibrary}
+
+\begin{shape}{generic circle IEC}
+ This shape inherits from |circle ee|, which in turn is just a normal
+ |circle| with additional |input| and |output| anchors at the left
+ and right ends. However, additionally, this shapes allows you to
+ specify a path that should be added before the background path using
+ the following key:
+ \begin{key}{/pgf/generic circle IEC/before background=\meta{code}}
+ When a node of shape |generic circle IEC| is created, the current
+ setting of this key is used as the ``before background path.''
+ This means that after the circle's background has been
+ drawn/filled/whatever, the \meta{code} is executed.
+
+ When the \meta{code} is executed, the coordinate system will have
+ been transformed in such a way that the point
+ $(1\mathrm{pt},0\mathrm{pt})$ lies at the right end of the circle
+ and $(0\mathrm{pt},1\mathrm{pt})$ lies at the top of the
+ circle. (More precisely, these points will lie exactly on the
+ middle of the radial line.)
+ \end{key}
+ Here is an examples of how to use this shape:
+\begin{codeexample}[]
+\tikz \node [generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{1pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}}
+ \pgfusepathqstroke
+ },
+ draw] {Hello world};
+\end{codeexample}
+\end{shape}
+
+
+\begin{shape}{generic diode IEC}
+ This shape is used to depict diodes. The main shape is taken up by a
+ ``right pointing'' triangle. The anchors are positioned on border of
+ a rectangle around the diode, see the below example. The
+ diode's size is based on the current settings of |minimum width| and
+ |minimum height|.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=generic diode IEC,shape example,minimum size=6cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+
+ This shape, like the |generic circle IEC| shape, is generic in the
+ sense that there is a special key that is used for the before
+ background drawings:
+ \begin{key}{/pgf/generic diode IEC/before background=\meta{code}}
+ Similarly to the |generic circle IEC| shape, when a node of shape
+ |generic diode IEC| is created, the current setting of this key is
+ used as the ``before background path.''
+ When the \meta{code} is executed, the coordinate system will have
+ been transformed in such a way that the origin is at the ``tip''
+ of the diode's triangle, the point $(0\mathrm{pt},1\mathrm{pt})$
+ is exactly half the diode's height above this origin, and
+ the point $(1\mathrm{pt},0\mathrm{pt})$ is half the diode's height
+ to the right of the origin.
+
+ The idea is that you use this key to draw different kinds of diode
+ endings.
+\begin{codeexample}[]
+\tikz \node [minimum size=1cm,generic diode IEC,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}}
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ draw] {};
+\end{codeexample}
+ \end{key}
+\end{shape}
+
+
+
+\begin{shape}{breakdown diode IEC}
+ This shape is used to depict a bidirectional breakdown diode. The
+ diode's size is based on the current settings of |minimum width| and
+ |minimum height|.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=breakdown diode IEC,shape example,minimum width=6cm,minimum height=4cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{var resistor IEC}
+ This shape is used to depict a variant version of a resistor. Its
+ size is computed as for a rectangle (thus, its size depends things
+ like the |minimum height|). Then, inside this rectangle, a
+ background path is setup according to the following rule: Starting
+ from the left end, zigzag segments are added to the path. Each
+ segment consists of a line at a 45 degree angle going up to the top
+ of the rectangle, then going down to the bottom, then going up to
+ mid height of the node. As many segments as possible are put inside
+ as possible. The last segment is then connected to the output anchor
+ via a straight line.
+
+ All of this means that, in general, the shape should be much wider
+ than high.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=var resistor IEC,shape example,minimum width=7cm,minimum height=1cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+
+\begin{shape}{inductor IEC}
+ This shape is used to depict an inductor, using a bumpy line. Its
+ size is computed as follows: Any text and |inner sep| are ignored
+ (and should normally not be given). The |minimum height| plus
+ (twice) the |outer ysep| specify the distance between the |north|
+ and |south| anchors, similarly for the |minimum width| plus the
+ |outer xsep| for the |east| and |west|.
+ The bumpy line is drawn starting from the lower left corner to the
+ lower right corner with bumps being half-circles whose height is
+ exactly the |minimum height|. The |center| of the shape is just
+ above the |south| anchor, at a distance of the |outer ysep|.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=inductor IEC,shape example,minimum width=7cm,minimum height=1cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+ Just as for a |var resistor IEC|, as many bumps as possible are
+ added and the last bump is connected to the output anchor via a
+ straight line.
+\end{shape}
+
+\begin{shape}{capacitor IEC}
+ This shape is based on a |rectangle ee|. However, instead of a
+ rectangle as the background path, only the ``left and right lines''
+ that make up the rectangle are drawn.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=capacitor IEC,shape example,
+ minimum width=2cm,minimum height=3cm,inner sep=0pt] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{battery IEC}
+ This shape is similar to a |capacitor IEC|, only the right line is
+ only half the height of the left line.
+\begin{codeexample}[]
+\tikz \node[shape=battery IEC,shape example,minimum size=2cm,
+ inner sep=0pt] {};
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{ground IEC}
+ This shape is similar to a |batter IEC|, only three lines of
+ different heights are drawn.
+\begin{codeexample}[]
+\tikz \node[shape=ground IEC,shape example,minimum size=2cm,
+ inner sep=0pt] {};
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{make contact IEC}
+ This shape consists of a line going from the lower left corner to
+ the upper right corner. The size and anchors of this shape are
+ computed in the same way as for an |inductor IEC|.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[name=s,shape=make contact IEC,shape example,minimum width=3cm,minimum height=1cm] {};
+ \foreach \anchor/\placement in
+ {center/above, 30/above right,
+ north/above, south/below, east/left, west/right,
+ north east/above, south east/below, south west/below, north west/above,
+ input/left,output/right}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{var make contact IEC}
+ This shape works like |make contact IEC|, only a little circle is
+ added to the path at the lower left corner. The radius of this
+ circle is one twelfth of the width of the node.
+\begin{codeexample}[]
+\tikz \node[shape=var make contact IEC,shape example,
+ minimum height=1cm,minimum width=3cm,inner sep=0pt] {};
+\end{codeexample}
+\end{shape}
+
+\begin{shape}{break contact IEC}
+ This shape depicts a contact that can be broken. It works like
+ |make contact IEC|.
+\begin{codeexample}[]
+\tikz \node[shape=break contact IEC,shape example,
+ minimum height=1cm,minimum width=3cm,inner sep=0pt] {};
+\end{codeexample}
+\end{shape}
+
+\endinput
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
index eeef79c6ee8..bb0e6cadad9 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
@@ -16,11 +16,11 @@
The decoration libraries define a number of (more or less useful)
decorations that can be applied to paths. The usage of decorations is
-not covered in the present section, please consult
+not covered in the present section, please consult
Sections~\ref{section-tikz-decorations}, which explains how
decorations are used in \tikzname, and
\ref{section-base-decorations}, which explains how new
-decorations can be defined.
+decorations can be defined.
The decorations are influenced by a number of parameters that can be
set using the |decoration| option. These parameters are
@@ -35,32 +35,32 @@ is stored (so that you can access it). Note that some values are
stored in \TeX\ dimension registers while others are stored in macros.
\begin{key}{/pgf/decoration/amplitude=\meta{dimension} (initially 2.5pt)}
- This key determines the ``desired height'' (or amplitude) of
+ This key determines the ``desired height'' (or amplitude) of
decorations for which this makes sense. For instance, the initial
value of |2.5pt| means that deforming decorations should deform a
path by up to 2.5pt away from the original path.
- This key set the \TeX-dimension |\pgfdecorationsegmentamplitude|.
+ This key set the \TeX-dimension |\pgfdecorationsegmentamplitude|.
\end{key}
\begin{key}{/pgf/decoration/meta-amplitude=\meta{dimension} (initially 2.5pt)}
- This key determines the amplitude for a meta-decoration.
+ This key determines the amplitude for a meta-decoration.
The key set the \TeX-macro (!) |\pgfmetadecorationsegmentamplitude|.
\end{key}
\begin{key}{/pgf/decoration/segment length=\meta{dimension} (initially 10pt)}
Many decorations are made up of small segments. This key determines
- the desired length of such segments.
+ the desired length of such segments.
- This key set the \TeX-dimension |\pgfdecorationsegmentlength|.
+ This key set the \TeX-dimension |\pgfdecorationsegmentlength|.
\end{key}
\begin{key}{/pgf/decoration/meta-segment length=\meta{dimension} (initially 1cm)}
This determined the length of the meta-segments from which a
meta-decoration is made up.
- This key set the \TeX-macro (!) |\pgfmetadecorationsegmentlength|.
+ This key set the \TeX-macro (!) |\pgfmetadecorationsegmentlength|.
\end{key}
\begin{key}{/pgf/decoration/angle=\meta{degree} (initially 45)}
@@ -68,7 +68,7 @@ stored in \TeX\ dimension registers while others are stored in macros.
instance, a |wave| decoration consists of arcs and the opening angle
of these arcs is given by the |angle|.
- This key set the \TeX-macro |\pgfdecorationsegmentangle|.
+ This key set the \TeX-macro |\pgfdecorationsegmentangle|.
\end{key}
\begin{key}{/pgf/decoration/aspect=\meta{factor} (initially 0.5)}
@@ -76,7 +76,7 @@ stored in \TeX\ dimension registers while others are stored in macros.
for a |brace| decoration the aspect ratio determines where the brace
point will be.
- This key set the \TeX-macro |\pgfdecorationsegmentaspect|.
+ This key set the \TeX-macro |\pgfdecorationsegmentaspect|.
\end{key}
\begin{key}{/pgf/decoration/start radius=\meta{dimension} (initially 2.5pt)}
@@ -100,7 +100,7 @@ stored in \TeX\ dimension registers while others are stored in macros.
This is a hint to the decoration code as to whether the path has
corners or not. If a path has a sharp corner, setting this option to
|true| may result in better rendering of the decoration because the
- joins of input segements are approached ``more carefully'' than
+ joins of input segments are approached ``more carefully'' than
when this key is set to false. However, if the path is, say, a
smooth circle, setting this key to |true| will usually look
worse. Most decorations ignore this key, anyway. Internally, it sets
@@ -118,7 +118,7 @@ stored in \TeX\ dimension registers while others are stored in macros.
change the number of subpaths. For instance, if the path used to
consist of two circles and an open arc, the path will after the
decoration process still consist of two closed subpath and one open
- subpath.
+ subpath.
\end{pgflibrary}
@@ -146,13 +146,13 @@ the paths.
\begin{decoration}{straight zigzag}
- This (meta-)decoration decorates the path by alternating between
+ This (meta-)decoration decorates the path by alternating between
|curveto| and |zigzag| decorations. It always finishes
with the |curveto| decoration. The following parameters influence
the decoration:
\begin{itemize}
\item |amplitude|
- determines how much the zig-zag lines raises above and falls below
+ determines how much the zigzag lines raises above and falls below
a straight line to the target point.
\item |segment length|
determines the length of a complete ``up-down'' cycle.
@@ -213,11 +213,11 @@ the paths.
\begin{decoration}{zigzag}
- This decoration looks like a zig-zag line. The following parameters
+ This decoration looks like a zigzag line. The following parameters
influence the decoration:
\begin{itemize}
\item |amplitude|
- determines how much the zig-zag lines raises above and falls below
+ determines how much the zigzag lines raises above and falls below
a straight line to the target point.
\item |segment length|
determines the length of a complete ``up-down'' cycle.
@@ -238,12 +238,12 @@ the paths.
\begin{decoration}{bent}
This decoration adds a slightly bent line from the start to the
target. The amplitude of the bent is given |amplitude|
- (an amplitude of zero gives a straight line).
+ (an amplitude of zero gives a straight line).
\begin{itemize}
\item |amplitude|
determines the amplitude of the bent.
\item |aspect|
- determines how tight the bent is. A good value is around |0.3|.
+ determines how tight the bent is. A good value is around |0.3|.
\end{itemize}
Note that this decoration makes only little sense for curves. You
should apply it only to straight lines.
@@ -267,7 +267,7 @@ the paths.
\begin{decoration}{bumps}
This decoration replaces the path by little half ellipses. The
- following parameters influence itL
+ following parameters influence it.
\begin{itemize}
\item |amplitude|
determines the height of the half ellipse.
@@ -290,7 +290,7 @@ the paths.
the path toward the target. Then, we ``view'' the spring from a
certain angle. If we look ``straight from the side'' we will see a
perfect sine curve, if we look ``more from the front'' we will see a
- coil. The following parameters influence the decoration:
+ coil. The following parameters influence the decoration:
\begin{itemize}
\item |amplitude|
determines how much the coil rises above the path and falls below
@@ -298,11 +298,11 @@ the paths.
\item |segment length|
determines the distance between two consecutive ``curls.'' Thus,
when the spring is see ``from the side'' this will be the wave
- length of the sine curve.
+ length of the sine curve.
\item |aspect|
determines the ``viewing direction.'' A value of |0| means
``looking from the side'' and a value of |0.5|, which is the
- default, means ``look more from the front.''
+ default, means ``look more from the front.''
\end{itemize}
\begin{codeexample}[]
\begin{tikzpicture}[decoration=coil]
@@ -350,7 +350,7 @@ the paths.
This decoration replaces the path by a line that looks like a snake
seen from above. More precisely, the snake is a sine wave with a
``softened'' start and ending. The following parameters influence
- the snake:
+ the snake:
\begin{itemize}
\item |amplitude|
determines the sine wave's amplitude.
@@ -368,7 +368,7 @@ the paths.
-
+
\subsection{Path Replacing Decorations}
\begin{pgflibrary}{decorations.pathreplacing}
@@ -385,14 +385,14 @@ the paths.
This decoration adds straight lines the path that are at a specific
angle to the line toward the target. The idea is to add these little
lines to indicate the ``border'' or an area. The following
- parameters influence the decoration:
+ parameters influence the decoration:
\begin{itemize}
\item |segment length|
determines the distance between consecutive ticks.
\item |amplitude|
determines the length of the ticks.
\item |angle|
- determines the angle between the ticks and the line of the path.
+ determines the angle between the ticks and the line of the path.
\end{itemize}
\begin{codeexample}[]
\begin{tikzpicture}[decoration=border]
@@ -414,7 +414,7 @@ the paths.
determines how much the brace rises above the path.
\item |aspect|
determines the fraction of the total length where the ``middle
- part'' of the brace will be.
+ part'' of the brace will be.
\end{itemize}
\begin{codeexample}[]
\begin{tikzpicture}[decoration=brace]
@@ -445,10 +445,20 @@ the paths.
\end{decoration}
+\begin{decoration}{moveto}
+ This decoration simply jumps to the end of the path using a move-to
+ path operation. It is mainly useful as |pre=moveto| or |post=moveto|
+ decorations.
+
+ This decoration is actually always defined when the decoration
+ module is loaded, but it is documented here for consistency.
+\end{decoration}
+
+
\begin{decoration}{ticks}
This decoration replaces the path by straight lines that are
orthogonal to the path. The following parameters influence the
- decoration:
+ decoration:
\begin{itemize}
\item |segment length|
determines the distance between consecutive ticks.
@@ -467,7 +477,7 @@ the paths.
\begin{decoration}{waves}
This decoration replaces the path by arcs that have a constant
- size. The following parameters influence the decoration:
+ size. The following parameters influence the decoration:
\begin{itemize}
\item |segment length|
determines the distance between consecutive arcs.
@@ -488,13 +498,548 @@ the paths.
-\subsection{Decorations with Shapes}
+\begin{decoration}{show path construction}
+ This decoration allows ``something different'' to be done
+ for each \emph{type} of input segment (i.e., moveto, lineto,
+ curveto or closepath). Typically, each segment will be replaced
+ with another path, but this need not necessarily be the case.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[>=stealth, every node/.style={midway, sloped, font=\tiny},
+ decoration={show path construction,
+ moveto code={
+ \fill [red] (\tikzinputsegmentfirst) circle (2pt)
+ node [fill=none, below] {moveto};},
+ lineto code={
+ \draw [blue,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
+ node [above] {lineto};
+ },
+ curveto code={
+ \draw [green!75!black,->] (\tikzinputsegmentfirst) .. controls
+ (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
+ ..(\tikzinputsegmentlast) node [above] {curveto};
+ },
+ closepath code={
+ \draw [orange,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
+ node [above] {closepath};}
+ }]
+ \draw [help lines] grid (3,2);
+ \path [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
+\end{tikzpicture}
+\end{codeexample}
+
+
+ The following keys can be used to specify the code to execute
+ for each type of input segment.
+
+\begin{key}{/pgf/decoration/moveto code=\meta{code} (initially \char`\{\char`\})}
+ Set the code to be executed for every moveto input segment.
+ It is important to remember that the transformations applied
+ by the decoration automaton are turned \emph{off} when \meta{code}
+ is executed.
+\end{key}
+
+\begin{key}{/pgf/decoration/lineto code=\meta{code} (initially \char`\{\char`\})}
+ Set the code to be executed for every lineto input segment.
+\end{key}
+
+\begin{key}{/pgf/decoration/curveto code=\meta{code} (initially \char`\{\char`\})}
+ Set the code to be executed for every curveto input segment.
+\end{key}
+
+\begin{key}{/pgf/decoration/closepath code=\meta{code} (initially \char`\{\char`\})}
+ Set the code to be executed for every closepath input segment.
+\end{key}
+
+Within \meta{code} the first and last
+points on the current input segment can be accessed using
+|\pgfpointdecoratedinputsegmentfirst| and
+|\pgfpointdecoratedinputsegmentlast|. For curves, the
+control (support) points can be accessed using
+|\pgfpointdecoratedinputsegmentsupporta| and
+|\pgfpointdecoratedinputsegmentsupportb|.
+
+In \tikzname, you can use the following macros
+inside a \tikzname{} coordinate.
+
+\begin{command}{\tikzinputsegmentfirst}
+ The first point on the current input segment path.
+\end{command}
+
+\begin{command}{\tikzinputsegmentlast}
+ The last point on the current input segment path.
+\end{command}
+
+\begin{command}{\tikzinputsegmentsupporta}
+ The first support on the curveto input segment path.
+\end{command}
+
+\begin{command}{\tikzinputsegmentsupportb}
+ The second support on the curveto input segment path.
+\end{command}
+
+{\tikzexternaldisable
+\begin{codeexample}[]
+\tikzset{
+ show curve controls/.style={
+ decoration={
+ show path construction,
+ curveto code={
+ \draw [blue, dashed]
+ (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta)
+ node [at end, cross out, draw, solid, red, inner sep=2pt]{};
+ \draw [blue, dashed]
+ (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast)
+ node [at start, cross out, draw, solid, red, inner sep=2pt]{};
+ }
+ },decorate
+ }
+}
+
+\tikzpicture
+ \draw [postaction=show curve controls, thick]
+ (0,2) .. controls (2.5,1.5) and (0.5,0.5) .. (3,0);
+\endtikzpicture
+\end{codeexample}
+}%
+\end{decoration}
+
+
+
+
+\subsection{Marking Decorations}
+
+\subsubsection{Overview}
+
+A \emph{marking on a path} is any kind of graphic that is placed on a
+specific position on a path. Markings are useful in rather diverse
+situations: you can use them to, say, place little ``footsteps'' along
+a path as if someone where walking along the path; to place arrow tips
+on the middle of a path to indicate the ``direction'' in which
+something is flowing; or you can use them to place informative
+information at certain positions of a path.
+
+For historical reasons there are three different libraries for placing
+marks on a path. They differ in what kind of markings can be added to
+a path. We start with the most general and most useful of these libraries.
+
+
+
+\subsection{Arbitrary Markings}
+
+\begin{pgflibrary}{decorations.markings}
+ Markings are arbitrary ``marks'' that can be put on a path. Marks
+ can be arrow tips or nodes or even whole pictures.
+\end{pgflibrary}
+
+\begin{decoration}{markings}
+ A \emph{marking} can be thought of a ``little picture'' or more
+ precisely of ``some scope contents'' that is placed ``on'' a path at
+ a certain position. Suppose the marking should be a simple cross. We
+ can produce this with the following code:
+\begin{codeexample}[code only]
+\draw (-2pt,-2pt) -- (2pt,2pt);
+\draw (2pt,-2pt) -- (-2pt,2pt);
+\end{codeexample}
+ If we use this code as a marking at position |2cm| on a path, then
+ the following happens: \pgfname\ determines the position on the path
+ that is 2cm along the path. Then is translates the coordinate system
+ to this position and rotates it such that the positive $x$-axis is
+ tangent to the path. Then a protective scope is created, inside
+ which the above code is executed -- resulting in a little cross on
+ the path.
+
+ The |markings| decoration allows you to place one or more such
+ markings on a path. The decoration destroys the input path (except
+ in certain cases, detailed later), which means that it uses the path
+ for determining positions on the path, but after the decoration is
+ done this path is gone. You typically need to use a |postaction| to
+ add markings.
+
+ Let us start with the above example in real code:
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={
+ markings,% switch on markings
+ mark=% actually add a mark
+ at position 2cm
+ with
+ {
+ \draw (-2pt,-2pt) -- (2pt,2pt);
+ \draw (2pt,-2pt) -- (-2pt,2pt);
+ }
+ }
+ ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ We can also add the cross repeatedly:
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={
+ markings,% switch on markings
+ mark=% actually add a mark
+ between positions 0 and 1 step 5mm
+ with
+ {
+ \draw (-2pt,-2pt) -- (2pt,2pt);
+ \draw (2pt,-2pt) -- (-2pt,2pt);
+ }
+ }
+ ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ The |mark| decoration option is used to specify a marking. It comes
+ in two version:
+ \begin{key}{/pgf/decoration/mark=|at position|
+ \meta{pos}| with |\meta{code}}
+ The options specifies that when a |marking| decoration is applied,
+ there should be a marking at position \meta{pos} on the path whose
+ code is given by \meta{code}.
+
+ The \meta{pos} can have four different forms:
+ \begin{enumerate}
+ \item It can be a non-negative dimension like |0pt| or |2cm| or
+ |5cm/2|. In this case, it refers to the position along the path
+ that is this far removed from the start.
+ \item It can be a negative dimension like |-1cm-2pt| or |-1sp|. In
+ this case, the position is taken from the end of the path. Thus,
+ |-1cm| is the position that is $-1$cm removed from the end of
+ the path.
+ \item It can be a dimensionless non-negative number like |1/2| or
+ |0.333+2*0.1|. In this case, the \meta{pos} is interpreted as a
+ factor of the total path length. Thus, a \meta{pos} or |0.5|
+ refers to the middle of the path, |0.1| is near the start, and
+ so on.
+ \item It can be a dimensionless negative number like |-0.1|. Then,
+ again, the fraction of the path length counts ``from the end.''
+ \end{enumerate}
+
+ The \meta{pos} determines a position on the path. When the marking
+ is applied, the (high level) coordinate system will have been
+ transformed so that the origin lies at this position and the
+ positive $x$-axis points along the path. For this coordinate
+ system, the \meta{code} is executed. It can contains all sorts of
+ graphic drawing commands, including (even named) nodes.
+
+ If the position lies past the end of the path (for
+ instance if \meta{pos} is set to |1.2|), the marking will not be
+ drawn.
+
+ It is possible to give the |mark| option several times, which
+ causes several markings to be applied. In this case, however, it
+ is necessary that the positions on the path are in increasing
+ order. That is, it is not allowed (and will result in chaos) to
+ have a marking that lies earlier on the path to follow a marking
+ that is later on the path.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={
+ markings,% switch on markings
+ mark=at position 1cm with \node[red]{1cm};,
+ mark=at position .5 with \node[green]{mid};,
+ mark=at position -1cm with {\node[blue,transform shape]{1cm from end};}}
+ ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ Here is an example that shows how markings can be used to place text
+ on plots:
+\begin{codeexample}[]
+\begin{tikzpicture}[domain=0:4,label/.style={postaction={
+ decorate,
+ decoration={
+ markings,
+ mark=at position .75 with \node #1;}}}]
+ \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
+
+ \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
+ \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
+
+ \draw[red,label={[above left]{$f(x)=x$}}] plot (\x,\x);
+ \draw[blue,label={[below left]{$f(x)=\sin x$}}] plot (\x,{sin(\x r)});
+ \draw[orange,label={[right]{$f(x)= \frac{1}{20} \mathrm e^x$}}] plot (\x,{0.05*exp(\x)});
+\end{tikzpicture}
+\end{codeexample}
+
+ When the \meta{code} is begin executed, two special keys will have
+ been setup, whose value may be of interest:
+ \begin{key}{/pgf/decoration/mark info/sequence number}
+ This key can only be read. Its value (which can be obtained
+ using the |\pgfkeysvalueof| command) is a ``sequence number'' of
+ the mark. The first mark that is added to a path has number |1|,
+ the second number |2|, and so on. This key is mainly useful in
+ conjunction with repeated markings (see below).
+ \end{key}
+ \begin{key}{/pgf/decoration/mark info/distance from start}
+ This key can only be read. Its value is the distance of the
+ marking from the start of the path in points. For instance, if
+ the path length is 100pt and the marking is in the middle of the
+ path, the value of this key would be |50.0pt|.
+ \end{key}
+ \end{key}
+
+ A second way to use the |mark| key is the following:
+ \begin{key}{/pgf/decoration/mark=|between positions|
+ \meta{start pos} |and| \meta{end pos} |step| \meta{stepping}
+ |with| \meta{code}}
+ This works similarly to the |at position| version of this option,
+ only multiple marks are placed, starting at \meta{start pos} and
+ then spaced apart by \meta{stepping}. The \meta{start pos}, the
+ \meta{end pos}, and also the \meta{stepping} may all be specified
+ in the same way as for the |at position| version, that is, either
+ using units or no units and also using positive or negative
+ values.
+
+ Let us start with a simple example in which we place ten crosses
+ along a path starting with the beginning of the
+ path ($\meta{start pos} = 0$) and ending at the end ($\meta{end
+ pos} = 1$).
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ mark=between positions 0 and 1 step 0.1
+ with { \draw (-2pt,-2pt) -- (2pt,2pt);
+ \draw (2pt,-2pt) -- (-2pt,2pt); }} ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ In the next example we place arrow shapes on the path instead of
+ crosses. Note the use of the |transform shape| option to ensure
+ that the nodes are actually rotated.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ mark=between positions 0 and 1 step 1cm
+ with { \node [single arrow,fill=red,
+ single arrow head extend=3pt,transform shape] {};}}]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ Using the key |sequence number| we can also ``number'' the nodes
+ and even refer to them later on.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ mark=between positions 0 and 1 step 1cm with {
+ \node [draw,
+ name=mark-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number},
+ transform shape]
+ {\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}};}}]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+ \draw [red,->] (mark-3) -- (mark-7);
+\end{tikzpicture}
+\end{codeexample}
+
+ In the following example we use the distance info to place
+ ``length information'' on a path:
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ % Main marks
+ mark=between positions 0 and 1 step 40pt with
+ { \draw [help lines] (0,0) -- (0,0.5)
+ node[above,font=\tiny]{
+ \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; },
+ mark=at position -0.1pt with
+ { \draw [help lines] (0,0) -- (0,0.5)
+ node[above,font=\tiny]{
+ \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; }}]
+ \draw [help lines] grid (5,3);
+ \draw [postaction={decorate}] (0,0) .. controls (8,3) and (0,3) .. (5,0) ;
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/decoration/reset marks}
+ Since |mark| options accumulate, there needs to be a way to
+ ``reset'' things, so that any |mark| options set in an enclosing
+ scope do not interfere. This option does exactly this. Note that
+ when the \meta{code} of a marking is executed, the markings are
+ automatically reset.
+ \end{key}
+
+ As mentioned earlier, the decoration usually destroys the
+ path. However, this is no longer the case when the following key is
+ set:
+ \begin{key}{/pgf/decoration/mark connection node=\meta{node name} (initially empty)}
+ When this key is set to a nonempty \meta{node name} while the
+ decoration is being processed, the following happens: The marking
+ code should, among possibly other things, define node named
+ \meta{node name}. Then, the output path of this decoration will
+ contain a line-to to ``one end'' of this node, followed by a
+ moveto to the ``other end'' of the node. More precisely, the first
+ end is given by the position on the border of \meta{node name}
+ that lies in the direction ``from which the path heads toward the
+ node'' while the other end lies on the border ``where the path
+ heads away from the node.'' Furthermore, this option causes the
+ decoration to end with a line-to to the end instead of a move-to.
+
+ The net effect of all this is that when you decorate a straight
+ line with one or more markings that contain just a node, the line
+ will effectively connect these nodes.
+
+ Here are two examples that show how this works:
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ mark connection node=my node,
+ mark=at position .5 with
+ {\node [draw,blue,transform shape] (my node) {my node};}}]
+ \draw [help lines] grid (3,2);
+ \draw decorate { (0,0) -- (3,2) };
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={markings,
+ mark connection node=my node,
+ mark=at position .25 with
+ {\node [draw,red] (my node) {my node};}}]
+ \draw [help lines] grid (3,2);
+ \draw decorate { (0,0) -- (3,2) };
+\end{tikzpicture}
+\end{codeexample}
+
+ \end{key}
+\end{decoration}
+
+
+\subsubsection{Arrow Tip Markings}
+
+Frequent markings that are hard to create correctly are arrow
+tips. For them, two special commands are available when the \meta{code} of
+a |mark| option is execute. (They are only defined in this code):
+
+\begin{command}{\arrow\opt{\oarg{options}}\marg{arrow end tip}}
+ This command simply draws the \meta{arrow end tip} at the origin,
+ pointing right. This is exactly what you need when you want to
+ draw an arrow tip as a marking.
+
+ The \meta{options} can only be given when \tikzname\ is used. In
+ this case, they are executed in a scope that contains the arrow
+ tip.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={
+ markings,% switch on markings
+ mark=at position 1cm with {\node[red]{1cm};},
+ mark=at position .75 with {\arrow[blue,line width=2mm]{>}},
+ mark=at position -1cm with {\arrowreversed[black]{stealth};}}
+ ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+
+ Here is a more useful example:
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={
+ markings,% switch on markings
+ mark=between positions 0 and .75 step 4mm with {\arrow{stealth}},
+ mark=between positions .75 and 1 step 4mm with {\arrowreversed{stealth}}}
+ ]
+ \draw [help lines] grid (3,2);
+ \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\arrowreversed\opt{\oarg{options}}\marg{arrow end tip}}
+ As above, only the arrow end tip is flipped and points in the
+ other direction.
+\end{command}
+
+
+\subsubsection{Footprint Markings}
+
+\begin{pgflibrary}{decorations.footprints}
+ The decorations of this library can be used to decorate a path with
+ little footprints, as if someone had ``walked'' along the path.
+\end{pgflibrary}
+
+\begin{decoration}{footprints}
+ The footprint decoration adds little footprints around the
+ path. They start with the left foot.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={footprints,foot length=5pt,stride length=10pt}]
+ \draw [help lines] grid (3,3);
+ \fill [decorate] (0,0) -- (3,2) arc (0:180:1.5 and 1);
+\end{tikzpicture}
+\end{codeexample}
+ You can influence the way this decoration looks using the following
+ options:
+ \begin{key}{/pgf/decoration/foot length (initially 10pt)}
+ The length or size of the footprint itself. A larger value makes
+ the footprint larger, but does not change the stride length.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={footprints,foot length=20pt}]
+ \fill [decorate] (0,0) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+ \begin{key}{/pgf/decoration/stride length (initially 30pt)}
+ The length of strides. This is the distance between the beginnings
+ of left footprints along the path.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={footprints,stride length=50pt}]
+ \fill [decorate] (0,0) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+ \begin{key}{/pgf/decoration/foot sep (initially 4pt)}
+ The separation in the middle between the footprints. The
+ footprints are moved away from the path by half this amount.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={footprints,foot sep=10pt}]
+ \fill [decorate] (0,0) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+ \begin{key}{/pgf/decoration/foot angle (initially 10)}
+ Footprints are rotate by this much.
+\begin{codeexample}[]
+\begin{tikzpicture}[decoration={footprints,foot angle=60}]
+ \fill [decorate] (0,0) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+ \begin{key}{/pgf/decoration/foot of (initially human)}
+ The species whose footprints are shown. Possible values are:
+
+ \def\render#1{
+ \texttt{#1} &
+ \tikz [baseline,decoration={footprints,foot of=#1}]
+ \fill [decorate] (0,0) -- (6,0); \\[3em]
+ }
+ \begin{tabular}{ll}
+ \emph{Species} & \emph{Result} \\[1em]
+ \render{gnome}
+ \render{human}
+ \render{bird}
+ \render{felis silvestris}
+ \end{tabular}
+ \end{key}
+\end{decoration}
+
+
+
+
+\subsubsection{Shape Background Markings}
+
+The third library for adding markings uses the background paths of
+certain shapes. This library is included mostly for historical
+reasons, using the |markings| library is usually preferable.
\begin{pgflibrary}{decorations.shapes}
This library defines decorations that use shapes or shape-like
drawings to decorate a path. The following options are common
options used by the decorations in this library:
-
+
\begin{key}{/pgf/decoration/shape width=\meta{dimension} (initially 2.5pt)}
The desired width of the shapes. For decorations that support
varying shape sizes, this key sets both the start and end width
@@ -517,7 +1062,7 @@ the paths.
\begin{decoration}{crosses}
This decoration replaces the path by (diagonal) crosses. The
- following parameters influence the decoration:
+ following parameters influence the decoration:
\begin{itemize}
\item |segment length|
determines the distance between (the centers of) consecutive crosses.
@@ -536,7 +1081,7 @@ the paths.
\begin{decoration}{triangles}
This decoration replaces the path by triangles that point along the
- path. The following parameters influence the decoration:
+ path. The following parameters influence the decoration:
\begin{itemize}
\item |segment length|
determines the distance between consecutive triangles.
@@ -555,15 +1100,19 @@ the paths.
\end{decoration}
-
\begin{decoration}{shape backgrounds}
This is a general decoration that replaces the to-be-decorated path by repeated
copies of the background path of an arbitrary shape that has
previously defined using the |\pgfdeclareshape| command (that is,
- you can use any shape in the shape libraries). Please note that the
- background path of the shapes is used, but \emph{no nodes are
- created}. You cannot have text inside the shapes of this path, you
- cannot name them, or refer to them.
+ you can use any shape in the shape libraries).
+
+ Please note that the background path of the shapes is used, but
+ \emph{no nodes are created}. This means that \emph{you cannot have
+ text inside the shapes of this path, you cannot name them, or
+ refer to them.} Finally, this decoration \emph{will not work with
+ shapes that depend strongly of the size of the text box (like the
+ arrow shapes).} If any of these restrictions pose a problem, use
+ the |markings| library instead.
\begin{codeexample}[]
\begin{tikzpicture}[decoration={shape backgrounds,shape=star,shape size=5pt}]
@@ -593,7 +1142,7 @@ the paths.
A shape background path is added at the start point of the path and,
if the distance between the shapes is appropriate, at the end point
- of the path.
+ of the path.
\begin{codeexample}[]
\begin{tikzpicture}[decoration={
@@ -605,7 +1154,7 @@ the paths.
\end{tikzpicture}
\end{codeexample}
- Keys for cusomizing specific shapes can be specified (e.g.,
+ Keys for customizing specific shapes can be specified (e.g.,
|star points|, |cloud puffs|, |kite angles|, and so on). The size of
the shape is ``enforced'' using transformations. This means that the
shape is typeset with an empty text box and some default size
@@ -616,7 +1165,7 @@ the paths.
entirely accurate. More general options such as |inner sep| and
|minimum size| will be ignored, but transformations can be applied
to each segment as described below.
-
+
\begin{codeexample}[]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50},
@@ -631,17 +1180,17 @@ the paths.
\end{codeexample}
There are various keys to control the drawing of the shape
- decoration.
-
+ decoration.
+
\begin{key}{/pgf/decoration/shape=\meta{shape name} (initially circle)}
The shape whose background path is used.
\end{key}
-
- \begin{key}{/pgf/decorations/shape sep=\meta{spacing} (initially {.25cm, between centers})}
- Set the spacing between the shapes on the decorationd path. This can be
- just a distance on its own, but the additional keywords
- |between centers|, and |between borders| (which must be preceded by a
- comma), specify that the distance is between the center anchors of
+
+ \begin{key}{/pgf/decoration/shape sep=\meta{spacing} (initially {.25cm, between centers})}
+ Set the spacing between the shapes on the decorations path. This can be
+ just a distance on its own, but the additional keywords
+ |between centers|, and |between borders| (which must be preceded by a
+ comma), specify that the distance is between the center anchors of
the shapes or between the edges of the \emph{boundaries} of
the shape borders.
@@ -660,19 +1209,19 @@ the paths.
\end{tikzpicture}
\end{codeexample}
\end{key}
-
+
\begin{key}{/pgf/decoration/shape evenly spread=\meta{number}}
- This key overides the |shape sep| key and forces the decoration to
- fit \meta{number} shapes evenly across the path.
- If \meta{number} is less than |1|, then no shapes will be used.
- If \meta{number} equals |1|, then one shape is put in the middle
- of the path.
+ This key overrides the |shape sep| key and forces the decoration to
+ fit \meta{number} shapes evenly across the path.
+ If \meta{number} is less than |1|, then no shapes will be used.
+ If \meta{number} equals |1|, then one shape is put in the middle
+ of the path.
The additional keywords |by centers| (the default, if no keyword is
- specified) and |by borders| can be used (both preceded by a comma),
+ specified) and |by borders| can be used (both preceded by a comma),
to specify how the distance between shapes is determined. These
- keywords will only have a noticable effect if the shapes sizes
+ keywords will only have a noticeable effect if the shapes sizes
differ over time.
-
+
\begin{codeexample}[]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50},
@@ -684,7 +1233,7 @@ the paths.
\fill [paint=green,spreading={5, by borders},
decoration={shape scaled}] (0,2) -- (3,2);
\fill [paint=blue,spreading={5, by centers},
- decoration={shape scaled}] (0,1.5) -- (3,1.5);
+ decoration={shape scaled}] (0,1.5) -- (3,1.5);
\fill [paint=red, spreading=5] (0,1) -- (3,1);
\fill [paint=orange, spreading=4] (0,.5) -- (3,.5);
\fill [paint=gray, spreading=1] (0,0) -- (3,0);
@@ -693,8 +1242,8 @@ the paths.
\end{key}
\begin{key}{/pgf/decoration/shape sloped=\opt{\meta{boolean}} (initially true)}
- By default, shapes are rotated to the slope of the decorationd path. If
- \meta{boolean} is the value |false|, then this rotation is turned
+ By default, shapes are rotated to the slope of the decorations path. If
+ \meta{boolean} is the value |false|, then this rotation is turned
off. Internally this sets the \TeX-if |\ifpgfshapedecorationsloped|
appropriately.
@@ -705,7 +1254,7 @@ the paths.
\begin{tikzpicture}[decoration={
shape width=.65cm, shape height=.45cm,
shape=isosceles triangle, shape sep=.75cm,
- shape backgrounds}]
+ shape backgrounds}]
\draw [help lines] grid (3,2);
\draw [paint=red,decorate] (0,0) -- (2,2);
\draw [paint=blue,decorate,decoration={shape sloped=false}]
@@ -715,7 +1264,7 @@ the paths.
\end{key}%
It is possible to scale the width and height of the shapes across the
- length of the decorationd path. The shapes are scaled between the starting
+ length of the decorations path. The shapes are scaled between the starting
size and the ending size. The following keys customize the way the
decoration shapes are scaled:
@@ -746,9 +1295,9 @@ the paths.
\begin{key}{/pgf/decoration/shape start height=\meta{length} (initially 2.5pt)}
The starting height of the shape.
\end{key}%
-
+
\begin{stylekey}{/pgf/decoration/shape start size=\meta{length}}
- Set both the the start height and start width simultaneously.
+ Set both the start height and start width simultaneously.
\end{stylekey}%
\begin{key}{/pgf/decoration/shape end width=\meta{length} (initially 2.5pt)}
@@ -757,7 +1306,7 @@ the paths.
of the path.
-\begin{codeexample}[]
+\begin{codeexample}[]
\tikzset{
bigger/.style={decoration={shape start size=.25cm, shape end size=1cm}},
smaller/.style={decoration={shape start size=1cm, shape end size=.25cm}},
@@ -767,13 +1316,13 @@ the paths.
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\fill [decorate,bigger,
- decoration={shape sep={.25cm, between borders}}, blue!50]
+ decoration={shape sep={.25cm, between borders}}, blue!50]
(0,1.5) -- (3,1.5);
\fill [decorate,smaller,
- decoration={shape sep={1cm, between centers}}, red!50]
+ decoration={shape sep={1cm, between centers}}, red!50]
(0,.5) -- (3,.5);
- \draw [gray, dotted] (0,1.625) -- (3,2) (0,1.375) -- (3,1)
- (0,1) -- (3,.625) (0,0) -- (3,.375);
+ \draw [gray, dotted] (0,1.625) -- (3,2) (0,1.375) -- (3,1)
+ (0,1) -- (3,.625) (0,0) -- (3,.375);
\end{tikzpicture}
\end{codeexample}
\end{key}%
@@ -783,7 +1332,7 @@ the paths.
\end{key}%
\begin{stylekey}{/pgf/decoration/shape end size=\meta{length}}
- Set both the the end height and end width simultaneously.
+ Set both the end height and end width simultaneously.
\end{stylekey}
\end{decoration}
@@ -795,7 +1344,7 @@ the paths.
\begin{pgflibrary}{decorations.text}
The decoration in this library decorates the path with some
- text. This can be used to draw text that follows a curve.
+ text. This can be used to draw text that follows a curve.
\end{pgflibrary}
\begin{decoration}{text along path}
@@ -808,7 +1357,7 @@ the paths.
\begin{codeexample}[]
\catcode`\|12
\begin{tikzpicture}[decoration={text along path,
- text={Some long text along a ridiculously long curve that}}]
+ text={Some long text along a ridiculously long curve that}}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
@@ -820,44 +1369,44 @@ the paths.
\item
Each character in the text is typeset in a separate |\hbox|. This
means that if you want fancy things like kerning or ligatures you
- will have to manually annotate the characters in the decoration
- text within a group, for example, |W{\kern-1ptA}TER|.
+ will have to manually annotate the characters in the decoration
+ text within a group, for example, |W{\kern-1ptA}TER|.
\item
Each character is positioned using the center of its baseline. To
- move the text vertcally (relative to the path), the additional
+ move the text vertically (relative to the path), the additional
transform key should be used.
\item
No attempt is made to ensure characters do not overlap when
the angle between segments is considerably less than 180\textdegree{}
(this is tricky to do in \TeX{} without a huge processing
- overhead). In general this should not be too much of a problem,
- but, once again, kerning can be used in most cases to overcome
+ overhead). In general this should not be too much of a problem,
+ but, once again, kerning can be used in most cases to overcome
any undesirable effects.
\item
It is only possible to typeset text in math mode under considerable
restrictions. Math mode is entered and exited using any character
of category code 3 (e.g., in plain \TeX{} this is |$|). %$
- Math subscripts and superscripts need to be contained within braces
- (e.g., |{^y_i}|) as do commands like |\times| or |\cdot|.
- However, even modestly complex mathematical typesetting is unlikely
- to be sucessful along a path (or even desirable).
+ Math subscripts and superscripts need to be contained within braces
+ (e.g., |{^y_i}|) as do commands like |\times| or |\cdot|.
+ However, even modestly complex mathematical typesetting is unlikely
+ to be successful along a path (or even desirable).
\item
Some inaccuracies in positioning may be particularly apparent
- at input segment boundaries. This can (unfortunately) only be solved
- on case by case basis by individually kerning the offending
+ at input segment boundaries. This can (unfortunately) only be solved
+ on case by case basis by individually kerning the offending
characters within a group.
\end{itemize}
-
+
The following keys are used by the |text| decoration:
\begin{key}{/pgf/decoration/text=\meta{text}
(initially \normalfont empty)}
- Set the text to typeset along the curve.
- Consecutive spaces are ignored, so |\ | (or |\space| in \LaTeX)
+ Set the text to typeset along the curve.
+ Consecutive spaces are ignored, so |\ | (or |\space| in \LaTeX)
should be used to insert multiple spaces. It is possible to
- format the text using normal formating commands, such as |\it|, |\bf|
- and |\color|, within customisable delimiters. Initially these
- delimiters are both {\tt\char`\|} (however, care will be needed
- regarding the category codes of delimiters --- see below).
+ format the text using normal formatting commands, such as |\it|, |\bf|
+ and |\color|, within customizable delimiters. Initially these
+ delimiters are both {\tt\char`\|} (however, care will be needed
+ regarding the category codes of delimiters --- see below).
{\catcode`\|12
\begin{codeexample}[]
@@ -865,13 +1414,13 @@ the paths.
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\path [decorate,decoration={text along path,
- text={a big |\color{green}|green|| juicy apple.}}]
+ text={a big |\color{green}|green|| juicy apple.}}]
(0,0) .. controls (0,2) and (3,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
}
By following the first delimiter
- with |+|, the formatting commands are added to any exisiting
+ with |+|, the formatting commands are added to any existing
formatting.
{\catcode`\|12
@@ -879,16 +1428,16 @@ the paths.
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\path [decorate,decoration={text along path,
- text={a |\large|big |+\bf\color{red}|red|| juicy apple.}}]
+ text={a |\large|big |+\bf\color{red}|red|| juicy apple.}}]
(0,0) .. controls (0,2) and (3,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
}
- Internally, the text is stored in the macro |\pgfdecorationtext|.
- Any characters that have not been typeset when the end of the
+ Internally, the text is stored in the macro |\pgfdecorationtext|.
+ Any characters that have not been typeset when the end of the
path has been reached will be stored in |\pgfdecorationrestoftext|.
-
+
\end{key}
{\catcode`\|12
@@ -896,21 +1445,21 @@ the paths.
\catcode`\|13
- Set the characters that the text decoration will use to parse
- formatting commands.
+ Set the characters that the text decoration will use to parse
+ formatting commands.
If \meta{after} is empty, then \meta{before} will be used for both
delimiters.
- In general you should stick to characters whose category codes are
+ In general you should stick to characters whose category codes are
|11| or |12|.
- As |+| is used to indicate that the specifed format commands
- are added to any exisiting ones, you should avoid using |+| as
- a delimiter.
+ As |+| is used to indicate that the specified format commands
+ are added to any existing ones, you should avoid using |+| as
+ a delimiter.
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
- \path [decorate, decoration={text along path,text format delimiters={[}{]},
- text={A big [\color{red}]red[] and [\color{green}]green[] apple.}}]
+ \path [decorate, decoration={text along path,text format delimiters={[}{]},
+ text={A big [\color{red}]red[] and [\color{green}]green[] apple.}}]
(0,0) .. controls (0,2) and (3,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
@@ -920,170 +1469,107 @@ the paths.
\begin{key}{/pgf/decoration/text color=\meta{color} (initially black)}
The color of the text.
\end{key}
-\end{decoration}
-
+\begin{key}{/pgf/decoration/reverse path=\meta{boolean} (initially false)}
+ This key reverses the path. This is especially useful for typesetting
+ text along different sides of curves.
-\subsection{Mark Decorations: Adding Arrow Tips and Nodes on a Path}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [help lines] grid (3,2);
+ \draw [gray, ->]
+ [postaction={decoration={text along path,
+ text={a big juicy apple}, text color=red}, decorate}]
+ [postaction={decoration={text along path,
+ text={a big juicy apple}, text color=blue, reverse path}, decorate}]
+ (3,0) .. controls (3,2) and (0,2) .. (0,0);
+\end{tikzpicture}
+\end{codeexample}
-\begin{pgflibrary}{decorations.markings}
- Markings are arbitrary ``marks'' that can be put on a path. Marks
- can be arrow tips or nodes or even whole pictures.
-\end{pgflibrary}
+\end{key}
-\begin{decoration}{markings}
- A \emph{marking} can be thought of a ``little picture'' or a more
- precisely of ``some scope contents'' that is placed ``on'' a path at
- a certain position. Suppose the marking should be a simple cross. We
- can produce this with the following code:
-\begin{codeexample}[code only]
-\draw (-2pt,-2pt) -- (2pt,2pt);
-\draw (2pt,-2pt) -- (-2pt,2pt);
-\end{codeexample}
- If we use this code as a marking at position |2cm| on a path, then
- the following happens: \pgfname\ determines the position on the path
- that is 2cm along the path. Then is translates the coordiante system
- to this position and rotates it such that the positive $x$-axis is
- tangent to the path. Then a protective scope is created, inside
- which the above code is executed -- resulting in a little cross on
- the path.
+\begin{key}{/pgf/decoration/text align={\ttfamily\char`\{}\meta{alignment options}{\ttfamily\char`\}}}
+ This changes the key path to |/pgf/decoration/text align| and
+ executes \meta{alignment options}.
+\end{key}
- The |markings| decoration allows you to place one or more such
- markings on a path. The decoration destroys the input path, which
- means that it uses the path for determining positions on the path,
- but after the decoration is done this path is gone. You typically
- need to use a |postaction| to add markings.
+\begin{key}{/pgf/decoration/text align/align=\meta{alignment} (initially left)}
+ Aligns the text according to \meta{alignment}, which should
+ be one of |left|, |right|, or |center|.
- Let us start with the above example in real code:
\begin{codeexample}[]
-\begin{tikzpicture}[decoration={
- markings,% switch on markings
- mark=% actually add a mark
- at position 2cm
- with
- {
- \draw (-2pt,-2pt) -- (2pt,2pt);
- \draw (2pt,-2pt) -- (-2pt,2pt);
- }
- }
- ]
+\begin{tikzpicture}
\draw [help lines] grid (3,2);
- \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+ \draw [red, dashed]
+ [postaction={decoration={text along path, text={a big juicy apple},
+ text align={align=right}}, decorate}]
+ (0,0) .. controls (0,2) and (3,2) .. (3,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
- The |mark| decoration option is used to specify a marking. It has
- the following syntax:
- \begin{key}{/pgf/decoration/mark=|at position|
- \meta{pos}| with |\meta{code}}
- The options specifies that when a |marking| decoration is applied,
- there should be a marking at position \meta{pos} on the path whose
- code is given by \meta{code}.
+\end{key}
- The \meta{pos} can have four different forms:
- \begin{enumerate}
- \item It can be a non-negative dimension like |0pt| or |2cm| or
- |5cm/2|. In this case, it refers to the position along the path
- that is this far removed from the start.
- \item It can be a negative dimesion like |-1cm-2pt| or |-1sp|. In
- this case, the position is taken from the end of the path. Thus,
- |-1cm| is the position that is $-1$cm removed from the end of
- the path.
- \item It can be a dimensionless non-negative number like |1/2| or
- |0.333+2*0.1|. In this case, the \meta{pos} is interpreted as a
- factor of the total path lenght. Thus, a \meta{pos} or |0.5|
- refers to the middle of the path, |0.1| is near the start, and
- so on.
- \item It can be a dimensionless negative number like |-0.1|. Then,
- again, the fraction of the path length counts ``from the end.''
- \end{enumerate}
+\begin{stylekey}{/pgf/decoration/text align/left}
+ Aligns the text to the left end of the path.
- The \meta{pos} determines a position on the path. When the marking
- is applied, the (high level) coordinate system will have been
- transformed so that the origin lies at this position and the
- positive $x$-axis points along the path. For this coordinate
- system, the \meta{code} is executed. It can contains all sorts of
- graphic drawing commands, including (even named) nodes.
+\end{stylekey}
- If the position position lies past the end of the path (for
- instance if \meta{pos} is set to |1.2|), the marking will not be
- drawn.
+\begin{stylekey}{/pgf/decoration/text align/right}
+ Aligns the text to the right end of the path.
+\end{stylekey}
- It is possible to give the |mark| option several times, which
- causes several markings to be applied. In this case, however, it
- is necessary that the positions on the path are in increasing
- order. That is, it is not allowed (and will result in chaos) to
- have a marking that lies earlier on the path to follow a marking
- that is later on the path.
+\begin{stylekey}{/pgf/decoration/text align/center}
+ Aligns the text to the center of the path.
+\end{stylekey}
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={
- markings,% switch on markings
- mark=at position 1cm with \node[red]{1cm};,
- mark=at position .5 with \node[green]{mid};,
- mark=at position -1cm with {\node[blue,transform shape]{1cm from end};}}
- ]
- \draw [help lines] grid (3,2);
- \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
-\end{tikzpicture}
-\end{codeexample}
+\begin{key}{/pgf/decoration/text align/left indent=\meta{length} (initially 0pt)}
+ Specify a distance which the automaton should move along
+ before it starts typesetting the text.
+\end{key}
+
+\begin{key}{/pgf/decoration/text align/right indent=\meta{length} (initially 0pt)}
+ Specify a distance before the end of the path, where
+ the automaton should stop typesetting the text.
+\end{key}
+
+\begin{key}{/pgf/decoration/text align/fit to path=\meta{boolean} (initially false)}
+ This key makes the decoration automaton try to fit the text
+ to the length of the path. The automaton shifts forward
+ by a small amount between each character in order to fit the
+ text to the path. If, however, the length of the text is longer
+ than the length of the path (i.e., the automaton would have to
+ shift \emph{backwards} between characters) this key will
+ have no effect.
- Here is an example that shows how markings can be used to place text
- on plots:
\begin{codeexample}[]
-\begin{tikzpicture}[domain=0:4,label/.style={postaction={
- decorate,
- decoration={
- markings,
- mark=at position .75 with \node #1;}}}]
- \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
-
- \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
- \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
-
- \draw[red,label={[above left]{$f(x)=x$}}] plot (\x,\x);
- \draw[blue,label={[below left]{$f(x)=\sin x$}}] plot (\x,{sin(\x r)});
- \draw[orange,label={[right]{$f(x)= \frac{1}{20} \mathrm e^x$}}] plot (\x,{0.05*exp(\x)});
+\begin{tikzpicture}
+ \draw [help lines] grid (3,2);
+ \draw [red, dashed]
+ [postaction={decoration={text along path, text={a big juicy apple},
+ text align=fit to path}, decorate}]
+ (0,0) .. controls (0,2) and (3,2) .. (3,0);
\end{tikzpicture}
\end{codeexample}
- Frequent markings that are hard to create correctly are arrow
- tips. For them, inside the \meta{code} two special commands can be
- useful, which are only defined in this code:
- \begin{command}{\arrow\opt{\oarg{options}}\marg{arrow end tip}}
- This command simply draws the \meta{arrow end tip} at the origin,
- pointing right. This is exactly what you need when you want to
- draw an arrow tip as a marking.
-
- The \meta{options} can only be given when \tikzname\ is used. In
- this case, they are executed in a scope that contains the arrow
- tip.
+\end{key}
+
+\begin{key}{/pgf/decoration/text align/fit to path stretching spaces=\meta{boolean} (initially false)}
+ This key works like the previous key except the automaton
+ shifts forward only for space characters (including |\space|, but
+ \emph{excluding} |\ |).
+
\begin{codeexample}[]
-\begin{tikzpicture}[decoration={
- markings,% switch on markings
- mark=at position 1cm with {\node[red]{1cm};},
- mark=at position .75 with {\arrow[blue,line width=2mm]{>}},
- mark=at position -1cm with {\arrowreversed[black]{stealth};}}
- ]
+\begin{tikzpicture}
\draw [help lines] grid (3,2);
- \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1);
+ \draw [red, dashed]
+ [postaction={decoration={text along path, text={a big juicy apple},
+ text align={fit to path stretching spaces}}, decorate}]
+ (0,0) .. controls (0,2) and (3,2) .. (3,0);
\end{tikzpicture}
-\end{codeexample}
- \end{command}
- \begin{command}{\arrowreversed\opt{\oarg{options}}\marg{arrow end tip}}
- As above, only the arrow end tip is flipped and points in the
- other direction.
- \end{command}
- \end{key}
+\end{codeexample}
+\end{key}
- \begin{key}{/pgf/decoration/reset marks}
- Since |mark| options accumulate, there needs to be a way to
- ``reset'' things, so that any |mark| options set in an enclosing
- scope do not interfere. This option does exactly this. Note that
- when the \meta{code} of a marking is executed, the markings are
- automatically reset.
- \end{key}
\end{decoration}
@@ -1141,7 +1627,7 @@ the paths.
\begin{decoration}{Cantor set}
This decoration replaces a straight line by a ``line with a whole in
the middle.'' The Hausdorff dimension of the Cantor set is $\log
- 2/\log 3$.
+ 2/\log 3$.
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Cantor set,very thick]
\draw decorate{ (0,0) -- (3,0) };
@@ -1155,82 +1641,5 @@ the paths.
-\subsection{Footprint Decorations}
-
-
-\begin{pgflibrary}{decorations.footprints}
- The decorations of this library can be used to decorate a path with
- little footprints, as if someone had ``walked'' along the path.
-\end{pgflibrary}
-
-
-\begin{decoration}{footprints}
- The footprint decoration adds little footprints around the
- path. They start with the left foot.
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={footprints,foot length=5pt,stride length=10pt}]
- \draw [help lines] grid (3,3);
- \fill [decorate] (0,0) -- (3,2) arc (0:180:1.5 and 1);
-\end{tikzpicture}
-\end{codeexample}
- You can influence the way this decoration looks using the following
- options:
- \begin{key}{/pgf/decoration/foot length (initially 10pt)}
- The length or size of the footprint itself. A larger value makes
- the footprint larger, but does not change the stride length.
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={footprints,foot length=20pt}]
- \fill [decorate] (0,0) -- (3,0);
-\end{tikzpicture}
-\end{codeexample}
- \end{key}
- \begin{key}{/pgf/decoration/stride length (initially 30pt)}
- The length of strides. This is the distance between the beginnings
- of left footprints along the path.
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={footprints,stride length=50pt}]
- \fill [decorate] (0,0) -- (3,0);
-\end{tikzpicture}
-\end{codeexample}
- \end{key}
- \begin{key}{/pgf/decoration/foot sep (initially 4pt)}
- The separation in the middle between the footprints. The
- footprints are moved away from the path by half this amount.
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={footprints,foot sep=10pt}]
- \fill [decorate] (0,0) -- (3,0);
-\end{tikzpicture}
-\end{codeexample}
- \end{key}
- \begin{key}{/pgf/decoration/foot angle (initially 10)}
- Footprints are rotate by this much.
-\begin{codeexample}[]
-\begin{tikzpicture}[decoration={footprints,foot angle=60}]
- \fill [decorate] (0,0) -- (3,0);
-\end{tikzpicture}
-\end{codeexample}
- \end{key}
- \begin{key}{/pgf/decoration/foot of (initially human)}
- The species whose footprints are shown. Possible values are:
-
- \def\render#1{
- \texttt{#1} &
- \tikz [baseline,decoration={footprints,foot of=#1}]
- \fill [decorate] (0,0) -- (6,0); \\[3em]
- }
- \begin{tabular}{ll}
- \emph{Species} & \emph{Result} \\[1em]
- \render{gnome}
- \render{human}
- \render{bird}
- \render{felis silvestris}
- \end{tabular}
- \end{key}
-\end{decoration}
-
-
\endinput
-
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
index a0ecfec5c36..5a280cd94a9 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
@@ -35,6 +35,21 @@ from the start coordinate to the target coordinate.
\end{key}
+\subsection{Move-Tos}
+
+The following style installs a to path that simply ``jumps'' to the
+target coordinate.
+
+\begin{key}{/tikz/move to}
+ Causes a move to be added to the path upon a |to| or an
+ |edge| operation.
+\begin{codeexample}[]
+\tikz \draw (0,0) to[line to] (1,0)
+ to[move to] (2,0) to[line to] (3,0);
+\end{codeexample}
+\end{key}
+
+
\subsection{Curves}
The |curve to| style causes the to path to be set to a curve. The
@@ -49,7 +64,7 @@ exact way this curve looks can be influenced via a number of options.
that is computed in different ways, depending on which options are
set.
- All of the following options implictly cause the |curve to| style to
+ All of the following options implicitly cause the |curve to| style to
be installed.
\begin{key}{/tikz/out=\meta{angle}}
@@ -108,8 +123,8 @@ exact way this curve looks can be influenced via a number of options.
\begin{key}{/tikz/bend left=\meta{angle} (default \normalfont last value)}
This option sets |out=|\meta{angle}|,in=|$180-\meta{angle}$|,relative|. If no
\meta{angle} is given, the last given |bend left| or |bend right|
- angle is used.
-
+ angle is used.
+
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid]
\node[state,initial] (q_0) {$q_0$};
@@ -183,7 +198,7 @@ exact way this curve looks can be influenced via a number of options.
above \meta{distance}, then \meta{distance} is used instead.
\end{key}
\begin{key}{/tikz/out min distance=\meta{distance}}
- The mininimum distance set only for the start coordinate.
+ The minimum distance set only for the start coordinate.
\end{key}
\begin{key}{/tikz/out max distance=\meta{distance}}
The maximum distance set only for the start coordinate.
@@ -224,7 +239,7 @@ exact way this curve looks can be influenced via a number of options.
\end{key}
\begin{key}{/tikz/controls=\meta{coordinate}| and |\meta{coordinate}}
This option causes the \meta{coordinate}s to be used as control
- points.
+ points.
\begin{codeexample}[]
\tikz \draw (0,0) to [controls=+(90:1) and +(90:1)] (3,0);
\end{codeexample}
@@ -237,7 +252,7 @@ exact way this curve looks can be influenced via a number of options.
\begin{key}{/tikz/loop}
This key is similar to the |curve to| key, but differs in the
following ways: First, the actual target coordinate is ignored and the
- start coordiante is used as the target coordinate. Thus, it is
+ start coordinate is used as the target coordinate. Thus, it is
allowed not to provide any target coordinate, which can be useful
with unnamed nodes. Second, the |looseness| is set to |8| and the
|min distance| to |5mm|. These settings result in rather nice loops
@@ -245,7 +260,7 @@ exact way this curve looks can be influenced via a number of options.
30$^\circ$.
\begin{codeexample}[]
\begin{tikzpicture}
- \node [circle,draw] {a} edge [in=30,out=60,loop] ();
+ \node [circle,draw] {a} edge [in=30,out=60,loop] ();
\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -253,10 +268,10 @@ exact way this curve looks can be influenced via a number of options.
\begin{stylekey}{/tikz/loop above}
Sets the |loop| style and sets in and out angles such that
loop is above the node. Furthermore, the |above| option is set,
- which causes a node label to be placed at the correct position.
+ which causes a node label to be placed at the correct position.
\begin{codeexample}[]
\begin{tikzpicture}
- \node [circle,draw] {a} edge [loop above] node {x} ();
+ \node [circle,draw] {a} edge [loop above] node {x} ();
\end{tikzpicture}
\end{codeexample}
\end{stylekey}
@@ -276,7 +291,7 @@ exact way this curve looks can be influenced via a number of options.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
index b3503a60108..177a9611d39 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
@@ -12,7 +12,7 @@
\begin{tikzlibrary}{er}
This packages provides styles for drawing entity-relationship
- diagrams.
+ diagrams.
\end{tikzlibrary}
This library is intended to help you in creating E/R-diagrams. It defines
@@ -44,7 +44,7 @@ The package defines a simple style for drawing entities:
\end{stylekey}
\begin{stylekey}{/tikz/every entity}
- This stype is envoked by the style |entity|. To change the
+ This style is evoked by the style |entity|. To change the
appearance of entities, you can change this style.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -64,13 +64,13 @@ styles for entities.
\begin{stylekey}{/tikz/relationship}
This style works like |entity|, only it is to be used for
- relationships. Again, |relationship|s are actually relationship types.
+ relationships. Again, |relationship|s are actually relationship types.
\begin{codeexample}[]
\begin{tikzpicture}
\node[entity] (sheep) at (0,0) {Sheep};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
- edge (sheep)
+ edge (sheep)
edge (genome);
\end{tikzpicture}
\end{codeexample}
@@ -85,7 +85,7 @@ styles for entities.
\node[entity] (sheep) at (0,0) {Sheep};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
- edge (sheep)
+ edge (sheep)
edge (genome);
\end{tikzpicture}
\end{codeexample}
@@ -98,7 +98,7 @@ styles for entities.
\begin{stylekey}{/tikz/attribute}
This style is used to indicate that a node is an attribute. To
connect an attribute to its entity, you can use, for example, the
- |child| command or the |pin| option.
+ |child| command or the |pin| option.
\begin{codeexample}[]
\begin{tikzpicture}
\node[entity] (sheep) {Sheep}
@@ -107,7 +107,7 @@ styles for entities.
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[]
-\begin{tikzpicture}[every pin edge/.style=draw]
+\begin{tikzpicture}[every pin edge/.style=draw]
\node[entity,pin={[attribute]60:name},pin={[attribute]120:color}] {Sheep};
\end{tikzpicture}
\end{codeexample}
@@ -115,7 +115,7 @@ styles for entities.
\begin{stylekey}{/tikz/key attribute}
This style is intended for key attributes. By default, the will
- cause the attribute to be typeset in italics. Typcially, underlining
+ cause the attribute to be typeset in italics. Typically, underlining
is used instead, but that looks ugly and it is difficult to
implement in \TeX.
\end{stylekey}
@@ -134,14 +134,14 @@ styles for entities.
child {node [key attribute] {name}};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
- edge (sheep)
+ edge (sheep)
edge (genome);
\end{tikzpicture}
\end{codeexample}
\end{stylekey}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex
new file mode 100644
index 00000000000..7399ed6f185
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex
@@ -0,0 +1,720 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+\section{Externalization Library}
+{
+\pgfkeys{
+ /pdflinks/search key prefixes in/.add={/tikz/external/,}{}
+}
+\label{section-libs-external}
+{\noindent {\emph{by Christian Feuers\"anger}}}
+
+\begin{tikzlibrary}{external}
+ This library provides a high-level automatic or semi--automatic export feature for \tikzname\ pictures.
+ Its purpose is to convert each picture to a separate \pdf\ without changing the document as such.
+
+ It also externalizes |\label| information (and other aux file related stuff) using auxiliary files.
+\end{tikzlibrary}
+
+\subsection{Overview}
+
+There are several reasons why external images for at least some pictures are of interest:
+\begin{enumerate}
+ \item Larger picture require a considerable amount of time, which is necessary for every compilation. However, only few images will change from run to run. It can simply save time to export finished images and include them as final graphics.
+ \item It may be desirable to have final images for some graphics, for example to include them in third--party programs or to communicate them electronically.
+ \item It may be necessary to typeset a file in environments where \pgfname\ and \tikzname\ are not available. In this case, external images are the only way to ensure compatibility.
+\end{enumerate}
+The purpose of this library is to provide a way to export any \tikzname-picture to separate \pdf\ (or \eps) images without changing the main document. It is actually a simple user interface to the |\beginpgfgraphicnamed| $\dotsc$ |\endpgfgraphicnamed| framework of \pgfname\ which is discussed in section~\ref{section-external}.
+
+\subsection{Requirements}
+For most users, the library does not need special attention since requirements are met anyway. It collects all tokens between |\begin{tikzpicture}| and the next following |\end{tikzpicture}| and replaces them by the appropriate graphics or it takes steps to generate such an image.% For Con\TeX t and plain \TeX\ users, the appropriate begin and end picture statements apply.
+
+It can't expand macros during this step, so the only requirement is that every picture's end is directly reachable from its beginning, without further macro expansion. Furthermore, the library assumes that all \LaTeX\ pictures are ended with |\end{tikzpicture}|.% In Con\TeX t, the end command is assumed to be |\stoptikzpicture| and for plain \TeX\ it is |\endtikzpicture|.
+
+The library always searches for the \emph{next} picture's end, |\end{tikzpicture}|. As a consequence, you can't use nested pictures directly. You \emph{can} nest pictures, but you have to avoid that the nested picture's |\end| command is found before the outer |\end| command (for example using bracing constructs or by writing the nested picture into a separate macro call).
+
+Consider using the |\tikzexternaldisable| method in case you'd like to skip selected pictures which do not meet the requirements.
+
+\subsection{A Word About Con\TeX t And Plain \TeX}
+Currently, the basic layer backend |\beginpgfgraphicnamed| $\dotsc$ |\endpgfgraphicnamed| relies on \LaTeX\ only, so externalization is only supported for \LaTeX\ yet.
+%The library comes in three different versions, one for \LaTeX, one for Con\TeX t and one for plain \TeX. For reasons of simplicity, examples in this manual only refer to \LaTeX\ (especially |pdflatex|).
+
+\subsection{Externalizing Graphics}
+After loading the library, a call to |\tikzexternalize| is necessary to activate the externalization.
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
+
+\usetikzlibrary{external}
+\tikzexternalize % activate!
+
+\begin{document}
+\begin{tikzpicture}
+ \node {root}
+ child {node {left}}
+ child {node {right}
+ child {node {child}}
+ child {node {child}}
+ };
+\end{tikzpicture}
+
+A simple image is \tikz \fill (0,0) circle(5pt);.
+\end{document}
+\end{codeexample}
+
+The method works as follows: if the document is typeset normally, the library searches for replacement images for every picture. Filenames are generated automatically in the default configuration. In our case, the two file names will be |main-figure0| and |main-figure1|. If they exist, those images are simply included and the pictures as such are not processed. If graphics files do not exist, steps are taken to generate the missing ones. Since (currently) only one output file can be set, each missing image needs to be generated by a separate run of \LaTeX\ in which the |\jobname| is set to the desired image file name.
+In the default configuration |mode=convert with system call|, these commands are issued automatically by using the |\write18| method to call system commands. It is also possible to output every required file name or to generate a |makefile|; users will need to issue the required commands manually (or with |make|). The probably most comfortable way is to use the default configuration with
+\begin{codeexample}[code only]
+pdflatex -shell-escape main
+\end{codeexample}
+\noindent which authorizes |pdflatex| to call itself recursively to generate the images. When it finishes, all images are generated and the document already includes them.
+
+
+From this point on, successive runs of \LaTeX\ will use the final graphics files, the pictures won't be used anymore. Section~\ref{section-libs-external-nopgf} contains details about how to submit such a file to environments where \pgfname\ is not available.
+
+\begin{command}{\tikzexternalize\oarg{optional arguments}}
+ This command activates the externalization. It installs commands to replace every \tikzname-picture. It needs to be called before |\begin{document}| because it may need to install its separate shipout routine.
+
+
+ The \meta{optional arguments} can be any of the keys described below.
+
+ Note that the generation/modification of auxiliary files like |.aux|, |.toc| etc.\ is usually suppressed while a single image is externalized (details for |\label| support follow).
+
+ It is also possible to write |\tikzexternalize|\marg{main job name} if the argument is delimited by curly braces. This case is mainly for backwards compatibility and is no longer necessary. Since it might be useful in rare circumstances, it is documented in section~\ref{sec:external:detail}.
+
+ A detailed description about the process of externalization is provided in section~\ref{sec:external:detail}.
+
+ \begin{command}{\tikzexternalrealjob}%
+ After the library is loaded, this macro will \emph{always} contain the correct main job's name (in the example above, it is |main|). It is to be used instead of |\jobname| when the externalization is in effect.
+ \end{command}
+ \begin{command}{\pgfactualjobname}
+ Once |\tikzexternalize| has been called, |\pgfactualjobname| contains the name of the currently generated output file (which may be |main| or |main-figure0| or |main-figure1| in our example above).
+ \end{command}
+ \begin{command}{\jobname}
+ The value of |\jobname| is one of |\tikzexternalrealjob| or |\pgfactualjobname|, depending on the configuration. In short: if auxiliary file support (|\label| and |\ref|) is activated, |\jobname=\tikzexternalrealjob| (since that's the base file name of auxiliary files).
+ \end{command}
+\end{command}
+
+\begin{key}{/tikz/external/system call=\marg{template}}
+\label{extlib:systemcall:option}
+ A template string used to generate system calls. Inside of \marg{template}, the macro |\image| can be used as placeholder for the image which is about to be generated while |\texsource| contains the main file name (in truth, it contains |\input|\marg{main file name}, but that doesn't matter).
+
+ The default is
+\begin{codeexample}[code only]
+\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error
+ -interaction=batchmode -jobname "\image" "\texsource"}
+\end{codeexample}
+ \noindent where \declareandlabel{\tikzexternalcheckshellescape} inserts the value of the configuration key |shell escape|
+ if and only if the current document has been typeset with |-shell-escape|\footnote{Note that this is always true for the default configuration. This security consideration applies mainly for \texttt{mode=list and make} which will also work \emph{without} shell escapes.}.
+
+ For |eps| output, you can (and need to) use
+\begin{codeexample}[code only]
+\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error
+ -interaction=batchmode -jobname "\image" "\texsource";
+ dvips -o "\image".ps "\image".dvi}}
+\end{codeexample}
+
+ The argument \marg{template} will be expanded using |\edef|, so any control sequences will be expanded. During this evaluation, `|\\|' will result in a normal backslash, `|\|'. Furthermore, double quotes `|"|', single quotes `|'|', semicolons and dashes `|-|' will be made to normal characters if any package uses them as macros. This ensures compatibility with the |german| package, for example.
+\end{key}
+
+\begin{key}{/tikz/external/shell escape=\marg{command-line arg} (initially -shell-escape)}
+ Contains the command line option for |latex| which enables the |\write18| feature. For \TeX-Live, this is |-shell-escape|. For Mik\TeX, you should use |\tikzexternalize[shell escape=-enable-write18]|.
+\end{key}
+
+\subsubsection{Support for Labels and References In External Files}
+The |external| library comes with extra support for |\label| and |\ref| (and other commands which usually store information in the |.aux| file) inside of external files.
+
+There are, however, some points which need your attention when you try to use
+\begin{enumerate}
+ \item[a)] |\ref| to something in the main document inside of an externalized graphics or
+ \item[b)] |\label| in the externalized graphics which is referenced in the main document.
+\end{enumerate}
+
+For point a), a |\ref| inside of an externalized graphics works \emph{only} if you issue the required system call \emph{manually} or by |make|. The initial configuration |mode=convert with system call| does \emph{not} support |\ref|. But you can copy--paste the system call generated by |mode=convert with system call| and issue it manually. The reason is that |\ref| information is stored in the main |.aux| file -- but this auxiliary file is not completely written when |mode=convert with system call| is invoked (there is a race condition). Note that |\pageref| is not supported (sorry). Thus: if you have |\ref| inside of external graphics, consider using |mode=list and make| or copy--paste the system call for the image(s) and issue it manually.
+
+Point b) is realized automatically by the external library. In detail, a |\label| inside of an externalized graphics causes the external library to generate separate auxiliary files for every external image. These files are called \meta{imagename}|.dpth|. The extension |.dpth| indicates that the file also contains the image's depth (the |baseline| key of \tikzname). Furthermore, anything which would have been written to an |.aux| file will be redirected to the |.dpth| file -- but only things which occur inside of the externalized |tikzpicture| environment. When the main document loads the image, it will copy the |.dpth| file into the main |.aux| file. Then, successive compilations of the main document contain the external |\label| information. In other words, a |\label| in an external graphics needs the following work flow:
+\begin{enumerate}
+ \item The external graphics needs to be generated together with its |.dpth| (usually automatically by \tikzname).
+ \item The main document includes the external graphics and copies the |.dpth| content into its main |.aux| file.
+ \item The main document needs to be translated one further time to re-read its |.aux| file\footnote{Note that it is not possible to activate the content of an auxiliary file after \texttt{\textbackslash begin\{document\}} in \LaTeX.}.
+\end{enumerate}
+There is just one special case: if a |\label|/|\ref| combination is realized itsself by a |tikzpicture| which should be externalized, you need to proceed as for case a) since |mode=convert with system call| can't handle that stuff on its own. Thus, |\label| works automatically, just translate the main document often enough.
+
+
+
+\subsubsection{Customizing the Generated File Names}
+The default filename for externalized graphics is `\meta{real file name}|-figure_|\meta{number}' where \meta{number} ranges from $0$ to whatever is required. However, there are a couple of ways to change the generated filenames:
+\begin{itemize}
+ \item Changing the overall file name using a |prefix|,
+ \item Changing the file name for a single figure using |\tikzsetnextfilename|,
+ \item Changing the file name for a restricted set of figures using |figure name|.
+\end{itemize}
+
+\begin{key}{/tikz/external/prefix=\marg{file name prefix} (initially empty)}
+ A shortcut for |\tikzsetexternalprefix|\marg{file name prefix}, see below.
+\end{key}
+
+\begin{command}{\tikzsetexternalprefix\marg{file name prefix}}
+ Assigns a common prefix used by all file names. For example,
+\begin{codeexample}[code only]
+\tikzsetexternalprefix{figures/}
+\end{codeexample}
+ will prepend |figures/| to every external graphics file name.
+
+ Please note that |\tikzsetexternalprefix| is the \emph{only} way to assign a prefix in case you want to prepare your document for environments where \pgfname\ is not installed (see section~\ref{section-libs-external-nopgf}).
+\end{command}
+
+\begin{command}{\tikzsetnextfilename\marg{file name}}
+ Sets the file name for the \emph{next} \tikzname\ picture or |\tikz| short command. It will \emph{only} be used for the next picture.
+
+ Pictures for which no explicit file name has been set (or the next file name is empty) will get automatically generated file names.
+
+ Please note that |prefix| will still be prepended to \marg{file name}.
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
+
+\usetikzlibrary{external}
+\tikzexternalize[prefix=figures/] % activate
+
+\begin{document}
+
+\tikzsetnextfilename{trees}
+\begin{tikzpicture} % will be written to 'figures/trees.pdf'
+ \node {root}
+ child {node {left}}
+ child {node {right}
+ child {node {child}}
+ child {node {child}}
+ };
+\end{tikzpicture}
+
+\tikzsetnextfilename{simple}
+A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'figures/simple.pdf'
+
+\begin{tikzpicture} % will be written to 'figures/main-figure0.pdf'
+ \draw[help lines] (0,0) grid (5,5);
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+\begin{codeexample}[code only]
+pdflatex -shell-escape main
+\end{codeexample}
+\end{command}
+
+\begin{key}{/tikz/external/figure name=\marg{name}}
+ Same as |\tikzsetfigurename|\marg{name}.
+\end{key}
+\begin{command}{\tikzsetfigurename\marg{name}}
+ Changes the names of \emph{all} following figures. It is possible to change |figure name| during the document either using |\tikzset{external/figure name|=\marg{name}|}| or with this command. A unique counter will be used for each different \marg{name}, and each counter will start at $0$.
+
+ The value of |prefix| will be applied after |figure name| has been evaluated.
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
+
+\usetikzlibrary{external}
+\tikzexternalize % activate
+
+\begin{document}
+
+\begin{tikzpicture} % will be written to 'main-figure0.pdf'
+ \node {root}
+ child {node {left}}
+ child {node {right}
+ child {node {child}}
+ child {node {child}}
+ };
+\end{tikzpicture}
+
+{
+ \tikzsetfigurename{subset_}
+ A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'subset_0.pdf'
+
+ \begin{tikzpicture} % will be written to 'subset_1.pdf'
+ \draw[help lines] (0,0) grid (5,5);
+ \end{tikzpicture}
+}% here, the old file name will be restored:
+
+\begin{tikzpicture} % will be written to 'main-figure1.pdf'
+ \draw (0,0) -- (5,5);
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+ The scope of |figure name| ends with the next closing brace.
+
+ Remark: Use |\tikzset{external/figure name/.add={prefix_}{_suffix_}}| to add a |prefix_| and a |_suffix_| to the actual value of |figure name|.
+\end{command}
+
+\begin{command}{\tikzappendtofigurename\marg{suffix}}
+ Appends \meta{suffix} to the actual value of |figure name|.
+
+ It is a shortcut for |\tikzset{external/figure name/.add={}|\marg{suffix}|}| (a shortcut which is also supported if \tikzname\ is not installed, see below).
+\end{command}
+
+
+\subsubsection{Remaking Figures or Skipping Figures}
+\begin{command}{\tikzpicturedependsonfile\marg{file name}}
+ Adds a dependency for the \emph{next} picture which is about to be externalized. If the command is invoked within a picture environment, it adds a dependency for the surrounding picture. Dependencies are written into \meta{target file}|.dep| in the format
+
+ \meta{target file}|.\tikzexternalimgextension: |\meta{file name}.
+
+ The effect is that if \meta{file name} changes, the external graphics associated with the picture shall be remade.
+
+ This command uses the contents of \declareandlabel{\tikzexternalimgextension} to check for graphics. If you encounter difficulties with image extensions, consider redefining this macro (after |\tikzexternalize|).
+
+ \paragraph{Limitations:} this command is currently only supported for |mode=list and make| and the generated |makefile|.
+\end{command}
+\begin{command}{\tikzexternalfiledependsonfile\marg{external graphics}\marg{file name}}
+ A variant of |\tikzpicturedependsonfile| which adds a dependency for an \meta{external graphics}. The argument \meta{external graphics} must be the path as it would have been generated by the external library, i.e.\ without file extension but including any prefixes.
+\end{command}
+
+\begin{key}{/tikz/external/force remake=\marg{boolean} (default true)}
+ A boolean which is used to customize the up-to-date checks of all following figures. Every up-to-date check will fail, resulting in automatic regeneration of every following figure.
+
+\begin{codeexample}[code only]
+\tikzset{external/force remake}
+\begin{tikzpicture}
+ \draw (0,0) circle(5pt);
+\end{tikzpicture}
+\end{codeexample}
+ You can also use |force remake| inside of a local \TeX\ group to remake only selected pictures. The example
+\begin{codeexample}[code only]
+\tikz \draw (0,0) -- (1,1);
+
+{
+\tikzset{external/force remake}
+\begin{tikzpicture}
+ \draw (0,0) circle(5pt);
+\end{tikzpicture}
+}
+
+\tikz \draw (0,0) -- (1,1);
+\end{codeexample}
+ will only apply |force remake| to the second figure.
+
+ Up-to-date checks are applied for |mode=convert with system call| and the makefile generated by |mode=list and make|.
+\end{key}
+
+\begin{key}{/tikz/external/remake next=\marg{boolean} (default true)}
+ A variant of |force remake| which applies only to the next image.
+\end{key}
+
+\begin{key}{/tikz/external/export next=\marg{boolean} (default true)}
+ A boolean which can be used to disable the export mechanism for single pictures.
+\end{key}
+
+\begin{key}{/tikz/external/export=\marg{boolean} (initially true)}
+ A boolean which can be used to disable the export mechanism for all pictures inside of the current \TeX-scope.
+
+\begin{codeexample}[code only]
+\begin{document}
+\begin{tikzpicture} % will be exported
+ ...
+\end{tikzpicture}
+
+{
+\tikzset{external/export=false}
+\begin{tikzpicture} % won't be exported
+ ...
+\end{tikzpicture}
+...
+}
+
+\begin{tikzpicture} % will be exported
+ ...
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+ For \LaTeX, the feature lasts until the next |\end|\marg{$\cdot$} (this holds for every call to |\tikzset|).
+\end{key}
+
+\begin{command}{\tikzexternaldisable}
+ Allows to disable the complete externalization. While |export next| will still collect the contents of picture environments, this command uninstalls the hooks for the external library completely. Thus, nested picture environments or environments where |\end{tikzpicture}| is not directly reachable won't produce compilation failures -- although it is not possible to externalize them automatically.
+
+ The externalization remains disabled until the end of the next \TeX\ group (or environment) or until the next call to |\tikzexternalenable|.
+\end{command}
+
+\begin{command}{\tikzexternalenable}
+ Re-enables a previously running externalization after |\tikzexternaldisable|.
+\end{command}
+
+
+\subsubsection{Customizing the Externalization}
+\begin{key}{/tikz/external/figure list=\marg{boolean} (initially true)}
+ A boolean which configures whether a figure list shall be generated. A figure list is an output file named \marg{jobname}|.figlist| which is filled with file names of each figure, one per line.
+
+ This file is not used by \TeX\ anymore, its purpose is to issue the required conversion commands |pdflatex -jobname |\marg{picture file name} \marg{main file} manually (or in a script). See section~\ref{sec:external:detail} for the details about the expected system call (or activate |mode=convert with system call| and inspect you log file).
+
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+\usepackage{tikz}
+
+\usetikzlibrary{external}
+\tikzexternalize[
+ mode=graphics if exists,
+ figure list=true,
+ prefix=figures/]
+
+\begin{document}
+
+\tikzsetnextfilename{trees}
+\begin{tikzpicture}
+ \node {root}
+ child {node {left}}
+ child {node {right}
+ child {node {child}}
+ child {node {child}}
+ };
+\end{tikzpicture}
+
+\tikzsetnextfilename{simple}
+A simple image is \tikz \fill (0,0) circle(5pt);.
+
+\begin{tikzpicture}
+ \draw[help lines] (0,0) grid (5,5);
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+
+\begin{codeexample}[code only]
+pdflatex main
+\end{codeexample}
+generates |main.figlist| containing
+\begin{codeexample}[code only]
+figures/trees
+figures/simple
+figures/main-figure0
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/external/mode=\marg{choice} (initially convert with system call)}
+ Configures what to do with \tikzname\ pictures (unless we are currently externalizing one particular image, in that case, these modes are ignored).
+
+ The preconfigured mode |convert with system call| checks whether external graphics files are up-to-date and includes them if that is the case. Any picture which is not up-to-date will be generated automatically using a system call. The system call can be configured using the |system call| template. The up-to-date check is simple: if the file does not exist, it is not up-to-date. Furthermore, if one of the |force remake| or |remake next| keys is true, the figure is not up-to-date. In all other case, the file is considered to be up-to-date. As soon as |convert with system call| is set, the |figure list| will be disabled -- such a file is not required. In case you still need or want it, you can enable it after setting |mode|.
+
+ Please note that system calls may be disabled for security reasons. For pdflatex, they can be enabled using
+\begin{codeexample}[code only]
+pdflatex -shell-escape
+\end{codeexample}
+ while other \TeX\ variants may need other switches. The feature is sometimes called |\write18|.
+
+ The choice |only graphics| always tries to replace pictures with external graphics. It is an error if the graphics file does not exist.
+
+ The choice |no graphics| (or, equivalently, |only pictures|) typesets \tikzname\ pictures without checking for external graphics.
+
+ A mixture is |graphics if exists|, it checks whether a suitable graphics file exists and includes it if that is the case. If it does not exist, the picture is typeset using \TeX.
+
+ Mode |list only| skips every \tikzname\ picture; it only generates the file \marg{main file}|.figlist| containing file names for every picture, the contents of any picture environment is thrown away and a replacement text is shown. This implies |figure list=true|. See also the |list and make| mode which includes available graphics.
+
+ The mode |list and make| is similar to |list only|: it generates the same file \marg{main file}|.figlist|, but any images which exist already are included as graphics instead of ignoring them. Furthermore, this mode generates an additional file: \marg{main file}.makefile. This allows to use a work flow like
+\begin{codeexample}[code only]
+% step 1: generate main.makefile:
+pdflatex main
+% step 2: generate ALL graphics on 2 processors:
+make -j 2 main.makefile
+% step 3: include the graphics:
+pdflatex main
+\end{codeexample}
+ \noindent This last make method is, however unnecessary: |list and make| just assumes that images are generated somehow (not necessarily with the generated makefile). The generated makefile allows parallel externalization of graphics on multi-core systems and it supports any file dependencies configured with |\tikzpicturedependsonfile|. Furthermore, it respects the |force remake| and |remake next| keys.
+
+
+\end{key}
+
+
+\begin{key}{/tikz/external/verbose IO=\marg{boolean} (initially true)}
+ A boolean which configures whether I/O operations shall be listed in the logfile.
+\end{key}
+\begin{key}{/tikz/external/verbose optimize=\marg{boolean} (initially true)}
+ A boolean which configures whether optimization operations shall be listed in the logfile.
+\end{key}
+\begin{key}{/tikz/external/verbose=\marg{boolean} (initially true)}
+ Sets all verbosity flags to \meta{boolean}.
+\end{key}
+
+\begin{key}{/tikz/external/optimize=\marg{boolean} (initially true)}
+ Configures whether the conversion process shall be optimized. This affects only the case when |\jobname| differs from the main file name, i.e. when single pictures are converted.
+
+ In that case, the main file is compiled as usual - but everything except the selected picture is thrown away. If optimization is enabled, all other pictures won't be processed at all. Furthermore, expensive commands which do not contribute to the selected picture will be thrown away as well.
+
+ The default implementation discards |\includegraphics| commands which are \emph{not} inside of the selected picture to reduce conversion time.
+
+ It is possible to add commands which shall be optimized away, see below.
+\end{key}
+
+\begin{key}{/tikz/external/optimize command away=\meta{\textbackslash command}\marg{required argument count}}
+ Installs commands to optimize \meta{\textbackslash command} away. As is described above, optimization applies to the case when single pictures are converted: one usually doesn't need to process (probably expensive) commands which do not contribute to the selected picture.
+
+ The argument \marg{required argument count} is either empty or a non-negativ integer between $0$ and $9$. It denotes the number of arguments which should be consumed after \meta{\textbackslash command}. In any case, one argument in square brackets after the command will be recognized as well. To be more precise, the following cases for arguments of \meta{\textbackslash command} are supported:
+ \begin{enumerate}
+ \item If \marg{required argument count} is empty (the default), \meta{\textbackslash command} may take one optional argument in square brackets and one in curly braces (which is also optional).
+ \item If \marg{required argument count} is not empty, \marg{\textbackslash command} may take one optional argument in square brackets. Furthermore, it expects exactly \marg{required argument count} following arguments.
+ \end{enumerate}
+
+ Example:
+\begin{codeexample}[code only]
+\tikzset{external/optimize command away=\includegraphics}
+\end{codeexample}
+
+\begin{codeexample}[code only]
+\newcommand{\myExpensiveMacro}[1]{Very expensive!}
+
+\tikzset{external/optimize command away=\myExpensiveMacro}
+\end{codeexample}
+
+\begin{codeexample}[code only]
+\newcommand{\myExpensiveMacroWithThreeArgs}[3]{Very expensive!}
+
+\tikzset{external/optimize command away={\myExpensiveMacroWithThreeArgs}{3}}
+\end{codeexample}
+\begin{codeexample}[code only]
+% A command with optional argument:
+\newcommand{\aFurtherExample}[3][]{Very expensive!}
+
+% consume only two arguments: the first optional one will be processed
+% anyway:
+\tikzset{external/optimize command away={\myExpensiveMacroWithThreeArgs}{2}}
+\end{codeexample}
+ The argument \meta{\textbackslash command} must be the name of a single macro. Any occurrence of this macro, together with its arguments, will be removed.
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ % this picture is currently converted!
+\end{tikzpicture}
+
+This here is outside of the converted picture and contains \myExpensiveMacro. It will be discarded.
+
+This call: \myExpensiveMacro[argument=value]{Argument} as well.
+And this here: \myExpensiveMacro{Argument} also.
+\end{codeexample}
+
+ The default is to optimize |\includegraphics| away.
+
+ This key is actually a style which sets the |optimize/install| and |optimize/restore| keys.
+\end{key}
+
+\begin{key}{/tikz/external/optimize/install}
+ A command key which contains code to install optimizations. You can append code here (or clear the macro) if you need to modify the optimization.
+\end{key}
+\begin{key}{/tikz/external/optimize/restore}
+ A command key which contains code to undo optimizations. You can append code here (or clear the macro) if you need to modify the optimization.
+\end{key}
+
+\begin{key}{/tikz/external/only named=\marg{boolean} (initially false)}
+ If enabled, only pictures for which file names have been set explicitly using |\tikzsetnextfilename| will be considered, no file names will be generated automatically.
+\end{key}
+
+\begin{key}{/pgf/images/include external (initially \textbackslash pgfimage\{\#1\})}
+\index{External Graphics!Bounding Box Issues}
+ This command key constitutes the public interface to exchange the |\includegraphics| command used for the image inclusion. If can be overwritten using |include external/.code=|\marg{\TeX\ code}.
+
+ Its description can be found in the corresponding basic layer documentation on page~\pageref{pgf:includeexternalkey}.
+
+ Just one example here: you can use
+\begin{codeexample}[code only]
+\pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}}
+\end{codeexample}
+ to manually change the viewport (bounding box) for included graphics.
+
+ Another example (of probably limited use) is
+\begin{codeexample}[code only]
+\pgfkeys{/pgf/images/include external/.code={\href{file:#1}{\pgfimage{#1}}}}
+\end{codeexample}
+ \noindent which will generate a clickable hyperlink around the image. Clicking on it opens the single exported file\footnote{This requires all external graphics files in the same base directory as the main |.pdf| file.}.
+
+ If you want to limit the effects of this key to just one externalized figure, use
+\begin{codeexample}[code only]
+{
+ \pgfkeys{/pgf/images/include external/.code={\includegraphics[viewport=0 0 211.28 175.686]{#1}}}
+ \begin{tikzpicture}
+ ...
+ \end{tikzpicture}
+}% this brace ends the effect of `include external'
+\end{codeexample}
+\end{key}
+
+\begin{command}{\tikzifexternalizing\marg{true code}\marg{false code}}
+ This command can be used to check whether an image is currently written to its separate graphics file (if the ``grab'' procedure is running). If so, the \marg{true code} will be executed. If not, that means if the main document is being typeset normally, the \marg{false code} will be invoked.
+
+ This command must be used \emph{after} |\tikzexternalize|.
+\end{command}
+
+\begin{command}{\tikzifexternalizingnext\marg{true code}\marg{false code}}
+ Like |\tikzifexternalizing|, but this variant also checks if the next following figure is the one which is about to be written to its separate graphics file.
+\end{command}
+
+\subsubsection{Details About The Process}
+\label{sec:external:detail}
+The standard run |pdflatex |\meta{main document} causes the |external| library to check every occurrence of |\begin{tikzpicture}| and every |\tikz| shortcommand. If it finds a picture which shall be exported, it queries the respective file name and checks whether the file exists already. If so, it includes the external graphics. If not, it requires an externalization which can be done automatically (the default), semi--automatically (with |mode=list and make|) or manually (by issuing the requires system calls somehow).
+
+The library can detect whether it runs in ``conversion mode'', i.e.\ if it should only process a single image. To do so, it checks whether the internal macro \declareandlabel{\tikzexternalrealjob} exists. If so, its contents is assumed to be \meta{main document} (without the suffix |.tex|). Usually, this macro is set by the conversion system call,
+\begin{codeexample}[code only]
+pdflatex -jobname "main-figure0" "\def\tikzexternalrealjob{main}\input{main}"
+\end{codeexample}
+\noindent where |main-figure0| is the picture we are currently externalizing and |main.tex| is the main document.
+
+As soon as ``conversion mode'' has been detected, \pgfname\ changes the output routine. The complete file |main.tex| is processed as normal, but only the part of the desired picture will be written to the output file, in our case |main-figure0.pdf|. The rest of the document is silently thrown away. Of course, such a conversion process is quite expensive since we need to do it for every picture. Since everything except the current picture is thrown away, the library skips all other pictures. Furthermore, any |\includegraphics| commands which are outside of the converted \tikzname-picture will be skipped as well. Thus, the conversion process should be much faster than typesetting the complete document, but it still requires its time.
+Eventually, the call |\input{main}| returns and the picture is ready. From this point on, the external graphics will be used.
+
+There is another possibility to communicate \meta{main document} to the subprocess performing the externalization: namely to write `|\tikzexternalize{main}|' into the document. In this case, the conversion system call will be
+\begin{codeexample}[code only]
+pdflatex -jobname "main-figure0" "main"
+\end{codeexample}
+\noindent and the contents of |\tikzexternalrealjob| is set automatically. This case is detected by |\tikzexternalize|, and the |system call| is updated automatically (by patching its |\texsource| template argument). It is not necessary to change the |system call| manually.
+
+
+The sequence in which system calls are performed and the decision whether they are issued automatically is governed by the |mode| key, consult its documentation for details.
+
+
+\subsection{Using External Graphics Without \textmd{\pgfname}\ Installed}
+\label{section-libs-external-nopgf}
+Given that every picture has been exported correctly, one may want to compile a file without \pgfname\ and \tikzname\ installed. \tikzname\ comes with a minimal package which contains just enough commands to replace every |tikzpicture| environment and the |\tikz| short command with the appropriate external graphics. It can be found at
+\begin{codeexample}[code only]
+latex/pgf/utilities/tikzexternal.sty
+\end{codeexample}
+\noindent and needs to be used instead of |\usepackage{tikz}|. So, we uncomment |\usepackage{tikz}| and our example from the beginning becomes
+\begin{codeexample}[code only]
+\documentclass{article}
+% main document, called main.tex
+%\usepackage{tikz}
+
+\usepackage{graphicx}
+\usepackage{tikzexternal}
+
+%\usetikzlibrary{external}
+\tikzexternalize
+
+\begin{document}
+\begin{tikzpicture}
+ \node {root}
+ child {node {left}}
+ child {node {right}
+ child {node {child}}
+ child {node {child}}
+ };
+\end{tikzpicture}
+
+A simple image is \tikz \fill (0,0) circle(5pt);.
+
+Furthermore, we might want to draw \tikz[baseline]\draw (0,-1) rectangle (1,1);
+\end{document}
+\end{codeexample}
+\noindent where the following files are necessary to compile the document:
+\begin{codeexample}[code only]
+tikzexternal.sty
+main.tex
+main-figure0.pdf
+main-figure1.pdf
+main-figure2.pdf
+\end{codeexample}
+\noindent If there are any `|.dpth|' files, for example |main-figure2.dpth|, these files are also required. They contain information for the \tikzname\ |baseline| option (or |\label|s inside of external graphics).
+
+Just copy the |.sty| file into the directory of your |main.tex| file and use it as part of your document.
+
+Please keep in mind, that only |tikzpicture| environments and |\tikz| short images are available within the externalization framework. Additionally, calls to |\tikzset| and |\pgfkeys| won't lead to compilation errors because they are simply ignored. But since |pgfkeys| is not available, any option supplied to |\tikzexternalize| is \emph{ignored}.
+
+\paragraph{Attention:} Since the simple replacement |\usepackage{tikzexternal}| doesn't support the key--value interface, you \emph{need} to use |\tikzsetexternalprefix| instead of the |prefix| option and |\tikzsetfigurename| instead of the |figure name| option since |\tikzset| is not available in such a context.
+
+\paragraph{Remark:} Some of the features of this library are mainly useful to improve the speed of successive document compilations. In other words: you can't use all features in this context, Keep it simple.
+
+\subsection{\eps\ Graphics Export}
+It is also possible to use \eps\ graphics instead of \pdf\ files. There are different ways to produce them, for example to use |pdflatex| and call |pdftops -eps |\marg{pdf file} \marg{eps file} afterwards. You could add this command to the |system call| option.
+
+Alternatively, you can use |latex| and |dvips| for image conversion as is explained for the |system call| option, see page~\pageref{extlib:systemcall:option}. See the documentation for the basic level externalization in section~\ref{section-external} for restrictions of other drivers.
+
+\subsection{Bitmap Graphics Export}
+Occasionally, you may have an extremely large graphics which takes long times to render. It might be interesting to generate a bitmap (raster) image, which displays much faster (for example in a presentation). I have used this feature to speed-up the display of large shadings.
+
+The |external| library can be customized to export bitmap images -- with the help of external programs. Due to the dependence of external programs, you may need to adjust these commands manually. For example, on my computer, the ImageMagick Suite is installed which comes with the |convert| tool. Together with |pdflatex|, I can define the following style:
+\begin{codeexample}[code only]
+\tikzset{
+ % Defines a custom style which generates BOTH, .pdf and .png export
+ % but prefers the .png on inclusion.
+ %
+ % This style is not pre-defined, you may need to copy-paste and
+ % adjust it.
+ png export/.style={
+ external/system call/.add=
+ {}
+ {; convert -density 300 -transparent white "\image.pdf" "\image.png"},
+ %
+ /pgf/images/external info,
+ /pgf/images/include external/.code={%
+ \includegraphics
+ [width=\pgfexternalwidth,height=\pgfexternalheight]
+ {##1.png}%
+ },
+ }
+}
+\end{codeexample}
+\noindent The example above defines a new style called `|png export|' which, when it is set with |\tikzset{png export}| somewhere in the document, modifies the configuration for both, file generation and file input. The file generation is modified by appending the ImageMagick command to |system call| (separated by `|;|' as usual on Linux). This is, in principle, enough to generate a |.png| file. The |include external| command is overwritten such that it uses the |.png| file instead of the |.pdf| file (which exists as well in the configuration above). But since a |.png| file can have a much higher resolution than the desired image dimensions, we have to add |width| and |height| explicitly. Usually, the |external| library does not provide size information (it is unnecessary for |.pdf| or |.eps| since these formats have their bounding box information). To enable size information, the style uses the |external info| key which, in turn, provides the |\pgfexternalwidth| and |\pgfexternalheight| commands.
+
+Now, we can use |\tikzset{png export}| either document--wide or just for one particular image. The configuration remains in effect until the end of the actual environment (or until the next closing curly brace `|}|').
+
+\begin{key}{/pgf/images/external info=\mchoice{true,false} (initially false)}
+ If this key is activated, the size for any externalized image will be stored explicitly into the associated |.dpth| file.
+
+ When the file is included by |\pgfincludeexternalgraphics| (or automatically by the |external| library), the width is available as \declareandlabel{\pgfexternalwidth} and the height as \declareandlabel{\pgfexternalheight}.
+\end{key}
+
+\subsection{Compatibility Issues}
+\subsubsection{References In External Pictures}
+It is allowed if a picture contains references, for example |\tikz \node {Reference to \ref{a:label}};|.
+
+There is just one issue: if the main job is currently compiling, its |.aux| file is not in its final state (even worse: it may not be readable at all). The picture externalization, however, needs the main |.aux| file to query any references.
+
+Thus, you \emph{will} need to invoke |pdflatex -jobname |\meta{image}| |\meta{mainfile} \emph{manually} for any image which contains references.
+
+This problem arises only for |mode=convert with system call|. In this case, the |external| library creates a special |\jobname.auxlock| file to check whether the main |.aux| file is currently usable.
+
+\subsubsection{Compatibility With Other Libraries or Packages}
+The |external| library has the following compatibility issues:
+\begin{enumerate}
+ \item The |external| library comes with special support for |\usetikzlibrary{fadings}|: the |fadings| library may define local pictures which would be externalized (although they shouldn't). There is special handling to suppress this bug if |\tikzexternalize| is called \emph{after} |\usetikzlibrary{fadings}| or if all fadings are defined \emph{before} |\tikzexternalize|.
+
+ \item Problems have been reported when using |\tikzexternalize| (or the basic layer externalization) together with |\usepackage{glossary}|. This problem disappears if |\tikzexternalize| is called \emph{before} |\usepackage{glossary}|.
+
+ \item Problems with |\usepackage{pdfpages}| and |\usepackage{vmargin}|: The |external| library replaces the current shipout routine of \TeX\ during its externalization. This might raise problems with other packages which also manipulate the shipout routine (like the mentioned ones).
+
+ To fix those problems, use
+\begin{codeexample}[code only]
+
+\usetikzlibrary{external}
+
+\tikzifexternalizing{%
+ % don't include package XYZ here
+}{%
+ \usepackage{pdfpages}
+ \usepackage{vmargin}
+ ...
+}%
+\end{codeexample}
+ This uses the requested packages for the main document, but not for the single, exported graphics.
+\end{enumerate}
+
+In general, the |\tikzifexternalizing| feature might be used to solve package conflicts and the |\tikzexternaldisable| and |\tikzexternalenable| features can be used to solve problems with single pictures.
+
+\subsubsection{Compatibility With Bounding Box Restrictions}
+Bounding box restrictions provide no problem when used with \eps\ graphics. However, they pose problems for |pdflatex|, so you may need to use the |latex| / |dvips| combination if you use bounding box restrictions and externalization. Currently, the only possibility for bounding box restrictions and |pdflatex| is to use a combination of |trim left| / |trim right| / |baseline|: these keys do not \emph{really} truncate the bounding box, they only store horizontal and vertical shifts (also see the |trim lowlevel| key in this context).
+
+\subsubsection{Interoperability With The Basic Layer Externalization}
+This library is fully compatible with |\beginpgfgraphicnamed|$\dotsc$|\endpgfgraphicnamed| environments. However, you will need to use the |export next=false| key to avoid conflicts:
+\begin{codeexample}[code only]
+\beginpgfgraphicnamed{picture4}
+\tikzset{external/export next=false}
+\begin{tikzpicture}
+ \draw (0,0) -- (4,4);
+\end{tikzpicture}
+\endpgfgraphicnamed
+\end{codeexample}
+Please keep in mind that file prefixes do not apply to the basic layer.
+}
+\endinput
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
index 2108e77e333..5e0dab698db 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
@@ -12,11 +12,11 @@
\label{section-library-fit}
\begin{tikzlibrary}{fit}
- The library defines (currently only one) option for fitting a node
+ The library defines (currently only two) options for fitting a node
so that it contains a set of coordinates.
\end{tikzlibrary}
-When you load this library, the following option becomes available:
+When you load this library, the following options become available:
\begin{key}{/tikz/fit=\meta{coordinates or nodes}}
This option must be given to a |node| path command. The
@@ -49,7 +49,7 @@ When you load this library, the following option becomes available:
\node[draw=red, fit=(a) (b) (c) (d) (e)] {box};
\node[draw,circle,fit=(a) (b) (c) (d) (e)] {};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
Every time the |fit| option is used, the following style is also
@@ -61,14 +61,14 @@ When you load this library, the following option becomes available:
The exact effects of the |fit| option are the following:
\begin{enumerate}
- \item A minimal bounding box containg all coordinates is
+ \item A minimal bounding box containing all coordinates is
computed. Note that if a coordinate like |(a)| is used that
contain a node name, this has the same effect as explicitly
providing the |(a.north)| and |(a.south)| and |(a.west)| and
|(a.east)|. If you wish to refer only to the center of the |a|
node, use |(a.center)| instead.
\item The |text width| option is set to the width of this bounding box.
- \item The |text centered| option is set.
+ \item The |align=center| option is set.
\item The |anchor| is set to |center|.
\item The |at| position of the node is set to the center of the
computed bounding box.
@@ -85,11 +85,11 @@ When you load this library, the following option becomes available:
|fit| option that does not contain any text, give it a name, and
then use normal nodes to add text at the desired
positions. Alternatively, consider using the |label| or |pin|
- options.
+ options.
Suppose, for instance, that in the above example we want the word
``box'' to appear inside the box, but at its top. This can be
- achieved as follows:
+ achieved as follows:
\begin{codeexample}[]
\begin{tikzpicture}[inner sep=0pt,thick,
dot/.style={fill=blue,circle,minimum size=3pt}]
@@ -102,10 +102,10 @@ When you load this library, the following option becomes available:
\node[draw=red,fit=(a) (b) (c) (d) (e)] (fit) {};
\node[below] at (fit.north) {box};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
- Here is a real-life example that uses fitting:
+ Here is a real-life example that uses fitting:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -125,17 +125,36 @@ When you load this library, the following option becomes available:
child { node [vertex,leaf=b] {} } }
child { node [vertex,leaf=a] {} } }
child { node [coordinate] {}
- child[missing]
+ child[missing]
child { node [vertex] (f's parent) {}
child { node [vertex,leaf=c] {} }
child { node [vertex,leaf=f] {} } } }
edge from parent node {$\rho$} };
-
+
\node [fit=(d) (e) (b) (b's parent),label=above left:$F^{(b,R)}$] {};
\node [fit=(c) (f) (f's parent),label=above right:$F^{(c,R)}$] {};
\end{tikzpicture}
\end{codeexample}
-
\end{key}
+\begin{key}{/tikz/rotate fit=\meta{angle} (initially 0)}
+ This key fits \meta{coordinates or nodes} inside a node that is
+ rotated by \meta{angle}. As a side effect, it also sets the
+ |/tikz/rotate| key.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[inner sep=0pt,thick,
+ dot/.style={fill=blue,circle,minimum size=3pt}]
+ \draw[help lines] (0,0) grid (3,2);
+ \node[dot] (a) at (1,1) {};
+ \node[dot] (b) at (2,2) {};
+ \node[dot] (c) at (1,2) {};
+ \node[dot] (d) at (1.25,0.25) {};
+ \node[dot] (e) at (1.75,1.5) {};
+ \node[draw, fit=(a) (b) (c) (d) (e)] {};
+ \node[draw=red, rotate fit=30, fit=(a) (b) (c) (d) (e)] {};
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex
new file mode 100644
index 00000000000..335bac3ed2d
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex
@@ -0,0 +1,151 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Fixed Point Arithmetic Library}
+
+\begin{pgflibrary}{fixedpointarithmetic}
+ This library provides an interface to the \LaTeX{} package
+ |fp| for fixed point arithmetic. In addition to loading this
+ library you must ensure |fp| is loaded otherwise errors
+ will occur.
+\end{pgflibrary}
+
+\subsection{Overview}
+
+ Whilst the mathematical engine that comes with \pgfname{} is
+ reasonably fast and flexible when it comes to parsing, the accuracy
+ tends to be fairly low, particularly for expressions involving many
+ operations chained together. In addition the range of values that
+ can be computed is very small: $\pm16383.99999$.
+ Conversely, the |fp| package has a reasonably high accuracy, and
+ can perform computations over a wide range of
+ values (approximately $\pm9.999\times10^{17}$), but is comparatively
+ slow and not very
+ flexible, particularly regarding parsing.
+
+ This library enables the combination of the two: the flexible parser
+ of the \pgfname{} mathematical engine with the evaluation accuracy
+ of |fp|. There are, however, a number of important points to
+ bear in mind:
+
+\begin{itemize}
+
+ \item
+
+ Whilst |fp| supports very large numbers, \pgfname{} and
+ \tikzname{} do not. It is possible to calculate the result of
+ |2^20| or |1.2e10+3.4e10|, but it is not possible to use these
+ results in pictures directly without some ``extra work''.
+
+ \item
+
+ The \pgfname{} mathematical engine will still be used to evaluate
+ lengths, such as |10pt| or |3em|, so it is not possible for an
+ length to exceed the range of values supported by
+ \TeX-dimensions ($\pm16383.99999$pt), even though the resulting
+ expression is within the range of |fp|. So, for example, one can
+ calculate |3cm*10000|, but not |3*10000cm|.
+
+ \item
+
+ Not all of the functions listed in Section~\ref{pgfmath-syntax},
+ have been mapped onto |fp| equivalents. Of those that have been,
+ it is not guaranteed that functions will perform in the same way as
+ they do in \pgfname. Reference should be made to the documentation
+ for |fp|.
+
+ \item
+
+ In \pgfname, trigonometric functions such as |sin| and |cos| assume
+ arguments are in degrees, and functions such as |asin| and |acos|
+ return results in degrees. Although |fp| uses radians for such
+ functions, \pgfname{} automatically converts arguments from degrees
+ to radians, and converts results from radians to degrees, to ensure
+ everything ``works properly''.
+
+ \item
+
+ The overall speed will actually be slower than using
+ \pgfname{} mathematical engine. The calculating power of |fp|
+ comes at the cost of an increased processing time.
+
+
+\end{itemize}
+
+\subsection{Using Fixed Point Arithmetic in PGF and \tikzname}
+
+ The following key is provided to use |fp| in \pgfname{}
+ and \tikzname:
+
+\begin{key}{/pgf/fixed point arithmetic=\meta{options}}
+\keyalias{tikz}
+
+ This key will set the key path to |/pgf/fixed point|, and
+ execute \meta{options}. Then it will install the necessary
+ commands so that the \pgfname{} parser will use |fp| to perform
+ calculations.
+ The best way to use this key is as an argument to a scope or
+ picture. This means that |fp| does not always have to be used,
+ and \pgfname{} can use its own mathematical engine at other times,
+ which can lead to a significant reduction in the time for a document
+ to compile.
+
+\end{key}
+
+ Currently there are only a few keys key supported for \meta{options}:
+
+\begin{key}{/pgf/fixed point/scale results=\meta{factor}}
+
+ As noted above, |fp| can process a far greater range of numbers
+ than \pgfname{} and \tikzname{}. In order to use results from
+ |fp| in a |{pgfpicture}| or a |{tikzpicture}| they need to be
+ scaled. When this key is used \pgfname{} will scale results
+ of any evaluation by \meta{factor}. However, as it is not
+ desirable for every part of every expression to be scaled,
+ scaling will only take place if a special prefix |*| is used.
+ If |*| is used at the beginning of an expression the evaluation
+ of the expression will evaluated and then multiplied by
+ \meta{factor}.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[fixed point arithmetic={scale results=10^-6}]
+\draw [help lines] grid (3,2);
+\draw (0,0) -- (2,2);
+\draw [red, line width=4pt] (*1.0e6,0) -- (*3.0e6,*2.0e6);
+\end{tikzpicture}
+\end{codeexample}
+
+ A special case of scaling involves plots of data containing
+ large numbers from files.
+ It is possible to ``pre-process'' a file, typically using the
+ application that generates the data, to either precede
+ the relevant column with |*| or to perform the scaling as part
+ of the calculation process. However, it may be desirable for
+ the data in a plot to appear in a table as well, so, two files would
+ be required, one pre-processed for plotting, and one not. This
+ extra work may be undesirable so the following keys are provided:
+
+\begin{key}{/pgf/fixed point/scale file plot x=\meta{factor}}
+ This key will scale the first column of data read from
+ a file before it is plotted. It is independent of the
+ |scale results| key.
+\end{key}
+
+\begin{key}{/pgf/fixed point/scale file plot y=\meta{factor}}
+ This key will scale the second column of data read from
+ a file before it is plotted.
+\end{key}
+
+\begin{key}{/pgf/fixed point/scale file plot z=\meta{factor}}
+ This key will scale the third column of data read from
+ a file before it is plotted.
+\end{key}
+
+\end{key}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
new file mode 100644
index 00000000000..88784f3b9be
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
@@ -0,0 +1,477 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Floating Point Unit Library}
+{\noindent {\emph{by Christian Feuers\"anger}}}
+\label{pgfmath-floatunit}
+\label{section-library-fpu}
+
+\begingroup
+\pgfqkeys{/pgf/number format}{sci}
+\pgfkeys{/pgf/fpu}
+
+\begin{pgflibrary}{fpu}
+ The floating point unit (fpu) allows the full data range of scientific computing for use in \pgfname. Its core is the \pgfname\ math routines for mantissa operations, leading to a reasonable trade--of between speed and accuracy. It does not require any third--party packages or external programs.
+\end{pgflibrary}
+
+\subsection{Overview}
+The fpu provides a replacement set of math commands which can be installed in isolated placed to achieve large data ranges at reasonable accuracy. It provides at least\footnote{To be more precise, the FPU's exponent is currently a 32 bit integer. That means it supports a significantly larger data range than an IEEE double precision number -- but if a future \TeX\ version may provide lowlevel access to doubles, this may change.} the IEEE double precision data range, $\pgfmathprintnumber{-1e+324}, \dotsc, \pgfmathprintnumber{+1e324}$. The absolute smallest number bigger than zero is $\pgfmathprintnumber{1e-324}$. The FPU's relative precision is at least $\pgfmathprintnumber{1e-4}$ although operations like addition have a relative precision of $\pgfmathprintnumber{1e-6}$.
+
+Note that the library has not really been tested together with any drawing operations. It should be used to work with arbitrary input data which is then transformed somehow into \pgfname\ precision. This, in turn, can be processed by \pgfname.
+
+\subsection{Usage}
+\begin{key}{/pgf/fpu=\marg{boolean} (default true)}
+ This key installs or uninstalls the FPU. The installation exchanges any routines of the standard math parser with those of the FPU: |\pgfmathadd| will be replaced with |\pgfmathfloatadd| and so on. Furthermore, any number will be parsed with |\pgfmathfloatparsenumber|.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/fpu}
+\pgfmathparse{1+1}\pgfmathresult
+\end{codeexample}
+\noindent The FPU uses a lowlevel number representation consisting of flags, mantissa and exponent\footnote{Users should \emph{always} use high level routines to manipulate floating point numbers as the format may change in a future release.}. To avoid unnecessary format conversions, |\pgfmathresult| will usually contain such a cryptic number. Depending on the context, the result may need to be converted into something which is suitable for \pgfname\ processing (like coordinates) or may need to be typeset. The FPU provides such methods as well.
+
+%--------------------------------------------------
+% \begin{codeexample}[]
+% \begin{tikzpicture}
+% \fill[red,fpu,/pgf/fpu/scale results=1e-10] (*1.234e10,*1e10) -- (*2e10,*2e10);
+% \end{tikzpicture}
+% \end{codeexample}
+%--------------------------------------------------
+
+ Use |fpu=false| to deactivate the FPU. This will restore any change. Please note that this is not necessary if the FPU is used inside of a \TeX\ group -- it will be deactivated afterwards anyway.
+
+ It does not hurt to call |fpu=true| or |fpu=false| multiple times.
+
+ Please note that if the |fixed point arithmetics| library of \pgfname\ will be activated after the FPU, the FPU will be deactivated automatically.
+\end{key}
+
+\begin{key}{/pgf/fpu/output format=\mchoice{float,sci,fixed} (initially float)}
+ This key allows to change the number format in which the FPU assigns |\pgfmathresult|.
+
+ The predefined choice |float| uses the low-level format used by the FPU. This is useful for further processing inside of any library.
+\begin{codeexample}[]
+\pgfkeys{/pgf/fpu,/pgf/fpu/output format=float}
+\pgfmathparse{exp(50)*42}\pgfmathresult
+\end{codeexample}
+
+ The choice |sci| returns numbers in the format \meta{mantissa}|e|\meta{exponent}. It provides almost no computational overhead.
+\begin{codeexample}[]
+\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci}
+\pgfmathparse{4.22e-8^-2}\pgfmathresult
+\end{codeexample}
+
+ The choice |fixed| returns normal fixed point numbers and provides the highest compatibility with the \pgfname\ engine. It is activated automatically in case the FPU scales results.
+\begin{codeexample}[]
+\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}
+\pgfmathparse{sqrt(1e-12)}\pgfmathresult
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/fpu/scale results=\marg{scale}}
+ A feature which allows semi--automatic result scaling. Setting this key has two effects: first, the output format for \emph{any} computation will be set to |fixed| (assuming results will be processed by \pgfname's kernel). Second, any expression which starts with a star, |*|, will be multiplied with \marg{scale}.
+\end{key}
+
+\begin{keylist}{
+ /pgf/fpu/scale file plot x=\marg{scale},%
+ /pgf/fpu/scale file plot y=\marg{scale},%
+ /pgf/fpu/scale file plot z=\marg{scale}}%
+ These keys will patch \pgfname's |plot file| command to automatically scale single coordinates by \marg{scale}.
+
+ The initial setting does not scale |plot file|.
+\end{keylist}
+
+\begin{command}{\pgflibraryfpuifactive\marg{true-code}\marg{false-code}}
+ This command can be used to execute dependent on whether the FPU has been activated or not.
+\end{command}
+
+\subsection{Comparison to the fixed point arithmetics library}
+There are other ways to increase the data range and/or the precision of \pgfname's math parser. One of them is the |fp| package, preferable combined with \pgfname's |fixed point arithmetic| library. The differences between the FPU and |fp| are:
+\begin{itemize}
+ \item The FPU supports at least the complete IEEE double precision number range, while |fp| covers only numbers of magnitude $\pm\pgfmathprintnumber{1e17}$.
+ \item The FPU has a uniform relative precision of about 4--5 correct digits. The fixed point library has an absolute precision which may perform good in many cases -- but will fail at the ends of the data range (as every fixed point routines does).
+ \item The FPU has potential to be faster than |fp| as it has access to fast mantissa operations using \pgfname's math capabilities (which use \TeX\ registers).
+\end{itemize}
+
+\subsection{Command Reference and Programmer's Manual}
+
+\subsubsection{Creating and Converting Floats}
+\begin{command}{\pgfmathfloatparsenumber\marg{x}}
+ Reads a number of arbitrary magnitude and precision and stores its result into |\pgfmathresult| as floating point number $m \cdot 10^e$ with mantissa and exponent base~$10$.
+
+ The algorithm and the storage format is purely text-based. The number is stored as a triple of flags, a positive mantissa and an exponent, such as
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{2}
+\pgfmathresult
+\end{codeexample}
+ Please do not rely on the low-level representation here, use |\pgfmathfloattomacro| (and its variants) and |\pgfmathfloatcreate| if you want to work with these components.
+
+ The flags encoded in |\pgfmathresult| are represented as a digit where `$0$' stands for the number $\pm 0\cdot 10^0$, `$1$' stands for a positive sign, `$2$' means a negative sign, `$3$' stands for `not a number', `$4$' means $+\infty$ and `$5$' stands for $-\infty$.
+
+ The mantissa is a normalized real number $m \in \mathbb{R}$, $1 \le m < 10$. It always contains a period and at least one digit after the period. The exponent is an integer.
+
+ Examples:
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{0}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{0.2}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{42}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{20.5E+2}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{1e6}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{5.21513e-11}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E.
+\end{codeexample}
+ The argument \marg{x} may be given in fixed point format or the scientific `e' (or `E') notation. The scientific notation does not necessarily need to be normalized. The supported exponent range is (currently) only limited by the \TeX-integer range (which uses 31 bit integer numbers).
+\end{command}
+
+\begin{key}{/pgf/fpu/handlers/empty number=\marg{input}\marg{unreadable part}}
+ This command key is invoked in case an empty string is parsed inside of |\pgfmathfloatparsenumber|. You can overwrite it to assign a replacement |\pgfmathresult| (in float!).
+
+ The initial setting is to invoke |invalid number|, see below.
+\end{key}
+\begin{key}{/pgf/fpu/handlers/invalid number=\marg{input}\marg{unreadable part}}
+ This command key is invoked in case an invalid string is parsed inside of |\pgfmathfloatparsenumber|. You can overwrite it to assign a replacement |\pgfmathresult| (in float!).
+
+ The initial setting is to generate an error message.
+\end{key}
+\begin{key}{/pgf/fpu/handlers/wrong lowlevel format=\marg{input}\marg{unreadable part}}
+ This command key is invoked whenever |\pgfmathfloattoregisters| or its variants encounter something which is no properly formatted lowlevel floating point number. As for |invalid number|, this key may assign a new |\pgfmathresult| (in floating point) which will be used instead of the offending \marg{input}.
+
+ The initial setting is to generate an error message.
+\end{key}
+
+\begin{command}{\pgfmathfloatqparsenumber\marg{x}}
+ The same as |\pgfmathfloatparsenumber|, but does not perform sanity checking.
+\end{command}
+
+\begin{command}{\pgfmathfloattofixed{\marg{x}}}
+ Converts a number in floating point representation to a fixed point number. It is a counterpart to |\pgfmathfloatparsenumber|. The algorithm is purely text based and defines |\pgfmathresult| as a string sequence which represents the floating point number \marg{x} as a fixed point number (of arbitrary precision).
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{0.00052}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E
+$\to$
+\pgfmathfloattofixed{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{123.456e4}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E
+$\to$
+\pgfmathfloattofixed{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfmathfloattoint\marg{x}}
+ Converts a number from low-level floating point representation to an integer (by truncating the fractional part).
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{123456}
+\pgfmathfloattoint{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+
+ See also |\pgfmathfloatint| which returns the result as float.
+\end{command}
+
+\begin{command}{\pgfmathfloattosci\marg{float}}
+ Converts a number from low-level floating point representation to scientific format, $1.234e4$. The result will be assigned to the macro |\pgfmathresult|.
+\end{command}
+\begin{command}{\pgfmathfloatvalueof\marg{float}}
+ Expands a number from low-level floating point representation to scientific format, $1.234e4$.
+
+ Use |\pgfmathfloatvalueof| in contexts where only expandable macros are allowed.
+\end{command}
+
+\begin{command}{\pgfmathfloatcreate{\marg{flags}}{\marg{mantissa}}{\marg{exponent}}}
+ Defines |\pgfmathresult| as the floating point number encoded by
+ \marg{flags}, \marg{mantissa} and \marg{exponent}.
+
+ All arguments are characters and will be expanded using |\edef|.
+\begin{codeexample}[]
+\pgfmathfloatcreate{1}{1.0}{327}
+\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
+Flags: \F; Mantissa \M; Exponent \E
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfmathfloatifflags\marg{floating point number}\marg{flag}\marg{true-code}\marg{false-code}}
+ Invokes \marg{true-code} if the flag of \marg{floating point number} equals \marg{flag} and \marg{false-code} otherwise.
+
+ The argument \marg{flag} can be one of
+ \begin{description}
+ \item[0] to test for zero,
+ \item[1] to test for positive numbers,
+ \item[+] to test for positive numbers,
+ \item[2] to test for negative numbers,
+ \item[-] to test for negative numbers,
+ \item[3] for ``not-a-number'',
+ \item[4] for $+\infty$,
+ \item[5] for $-\infty$.
+ \end{description}
+
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{42}
+\pgfmathfloatifflags{\pgfmathresult}{0}{It's zero!}{It's not zero!}
+\pgfmathfloatifflags{\pgfmathresult}{1}{It's positive!}{It's not positive!}
+\pgfmathfloatifflags{\pgfmathresult}{2}{It's negative!}{It's not negative!}
+
+% or, equivalently
+\pgfmathfloatifflags{\pgfmathresult}{+}{It's positive!}{It's not positive!}
+\pgfmathfloatifflags{\pgfmathresult}{-}{It's negative!}{It's not negative!}
+\end{codeexample}
+\end{command}
+
+
+\begin{command}{\pgfmathfloattomacro{\marg{x}}{\marg{flagsmacro}}{\marg{mantissamacro}}{\marg{exponentmacro}}}
+ Extracts the flags of a floating point number \marg{x} to \marg{flagsmacro}, the mantissa to \marg{mantissamacro} and the exponent to \marg{exponentmacro}.
+\end{command}
+
+\begin{command}{\pgfmathfloattoregisters{\marg{x}}{\marg{flagscount}}{\marg{mantissadimen}}{\marg{exponentcount}}}
+ Takes a floating point number \marg{x} as input and writes flags to count
+ register \marg{flagscount}, mantissa to dimen register \marg{mantissadimen} and exponent to count
+ register \marg{exponentcount}.
+
+ Please note that this method rounds the mantissa to \TeX-precision.
+\end{command}
+
+\begin{command}{\pgfmathfloattoregisterstok{\marg{x}}{\marg{flagscount}}{\marg{mantissatoks}}{\marg{exponentcount}}}
+ A variant of |\pgfmathfloattoregisters| which writes the mantissa into a token register. It maintains the full input precision.
+\end{command}
+
+\begin{command}{\pgfmathfloatgetflags{\marg{x}}{\marg{flagscount}}}
+ Extracts the flags of \marg{x} into the count register \marg{flagscount}.
+\end{command}
+
+\begin{command}{\pgfmathfloatgetflagstomacro{\marg{x}}{\marg{\textbackslash macro}}}
+ Extracts the flags of \marg{x} into the macro \meta{\textbackslash macro}.
+\end{command}
+
+\begin{command}{\pgfmathfloatgetmantissa{\marg{x}}{\marg{mantissadimen}}}
+ Extracts the mantissa of \marg{x} into the dimen register \marg{mantissadimen}.
+\end{command}
+\begin{command}{\pgfmathfloatgetmantissatok{\marg{x}}{\marg{mantissatoks}}}
+ Extracts the mantissa of \marg{x} into the token register \marg{mantissatoks}.
+\end{command}
+\begin{command}{\pgfmathfloatgetexponent{\marg{x}}{\marg{exponentcount}}}
+ Extracts the exponent of \marg{x} into the count register \marg{exponentcount}.
+\end{command}
+
+\subsubsection{Symbolic Rounding Operations}
+Commands in this section constitute the basic level implementations of the rounding routines. They work symbolically, i.e.\ they operate on text, not on numbers and allow arbitrarily large numbers.
+
+\begin{command}{\pgfmathroundto{\marg{x}}}
+ Rounds a fixed point number to prescribed precision and writes the result to |\pgfmathresult|.
+
+ The desired precision can be configured with |/pgf/number format/precision|, see section~\ref{pgfmath-numberprinting}. This section does also contain application examples.
+
+ Any trailing zeros after the period are discarded. The algorithm is purely text based and allows to deal with precisions beyond \TeX's fixed point support.
+
+ As a side effect, the global boolean |\ifpgfmathfloatroundhasperiod| will be set to true if and only if the resulting mantissa has a period. Furthermore, |\ifpgfmathfloatroundmayneedrenormalize| will be set to true if and only if the rounding result's floating point representation would have a larger exponent than \marg{x}.
+\begin{codeexample}[]
+\pgfmathroundto{1}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathroundto{4.685}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathroundto{19999.9996}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfmathroundtozerofill{\marg{x}}}
+ A variant of |\pgfmathroundto| which always uses a fixed number of digits behind the period. It fills missing digits with zeros.
+\begin{codeexample}[]
+\pgfmathroundtozerofill{1}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathroundto{4.685}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathroundtozerofill{19999.9996}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfmathfloatround{\marg{x}}}
+ Rounds a normalized floating point number to a prescribed precision and writes the result to |\pgfmathresult|.
+
+ The desired precision can be configured with |/pgf/number format/precision|, see section~\ref{pgfmath-numberprinting}.
+
+ This method employs |\pgfmathroundto| to round the mantissa and applies renormalization if necessary.
+
+ As a side effect, the global boolean |\ifpgfmathfloatroundhasperiod| will be set to true if and only if the resulting mantissa has a period.
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{52.5864}
+\pgfmathfloatround{\pgfmathresult}
+\pgfmathfloattosci{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{9.995}
+\pgfmathfloatround{\pgfmathresult}
+\pgfmathfloattosci{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfmathfloatroundzerofill{\marg{x}}}
+ A variant of |\pgfmathfloatround| produces always the same number of digits after the period (it includes zeros if necessary).
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{52.5864}
+\pgfmathfloatroundzerofill{\pgfmathresult}
+\pgfmathfloattosci{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathfloatparsenumber{9.995}
+\pgfmathfloatroundzerofill{\pgfmathresult}
+\pgfmathfloattosci{\pgfmathresult}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\subsubsection{Math Operations Commands}
+This sections describes some of the replacement commands in more details.
+
+Please note that these commands can be used even if the |fpu| as such has not been activated -- it is sufficient to load the library.
+
+\begin{command}{\pgfmathfloat\meta{op}}
+ Methods of this form constitute the replacement operations where \meta{op} can be any of the well--known math operations.
+
+ Thus, \declareandlabel{\pgfmathfloatadd} is the counterpart for |\pgfmathadd| and so on. The semantics and number of arguments is the same, but all input and output arguments are \emph{expected} to be floating point numbers.
+\end{command}
+
+\begin{command}{\pgfmathfloattoextentedprecision{\marg{x}}}
+Renormalizes \marg{x} to extended precision mantissa, meaning
+$100 \le m < 1000$ instead of $1 \le m < 10$.
+
+The `extended precision' means we have higher accuracy when we apply pgfmath operations to mantissas.
+
+The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision).
+
+The operation is supposed to be very fast.
+\end{command}
+
+\begin{command}{\pgfmathfloatsetextprecision\marg{shift}}
+ Sets the precision used inside of |\pgfmathfloattoextentedprecision| to \marg{shift}.
+
+ The different choices are
+
+ \begin{tabular}{llrll}
+ 0 & normalization to & $0$ & $\le m < 1$ & (disable extended precision)\\
+ 1 & normalization to & $10$ & $\le m < 100$ \\
+ 2 & normalization to & $100$ & $\le m < 1000$ & (default of |\pgfmathfloattoextentedprecision|)\\
+ 3 & normalization to & $1000$ & $\le m < 10000$ \\
+ \end{tabular}
+\end{command}
+
+\begin{command}{\pgfmathfloatlessthan{\marg{x}}{\marg{y}}}
+ Defines |\pgfmathresult| as $1.0$ if $\meta{x} < \meta{y}$, but $0.0$ otherwise. It also sets the global \TeX-boolean |\pgfmathfloatcomparison| accordingly. The arguments \marg{x} and \marg{y} are expected to be numbers which have already been processed by |\pgfmathfloatparsenumber|. Arithmetics is carried out using \TeX-registers for exponent- and mantissa comparison.
+\end{command}
+
+\begin{command}{\pgfmathfloatmultiplyfixed\marg{float}\marg{fixed}}
+ Defines |\pgfmathresult| to be $\meta{float} \cdot \meta{fixed}$ where \meta{float} is a floating point number and \meta{fixed} is a fixed point number. The computation is performed in floating point arithmetics, that means we compute $m \cdot \meta{fixed}$ and renormalizes the result where $m$ is the mantissa of \meta{float}.
+
+ This operation renormalizes \meta{float} with |\pgfmathfloattoextentedprecision| before the operation, that means it is intended for relatively small arguments of \meta{fixed}. The result is a floating point number.
+\end{command}
+
+\begin{command}{\pgfmathfloatifapproxequalrel\marg{a}\marg{b}\marg{true-code}\marg{false-code}}
+ Computes the relative error between \meta{a} and \meta{b} (assuming \meta{b}$\neq 0$) and
+ invokes \meta{true-code} if the relative error is below |/pgf/fpu/rel thresh| and
+ \meta{false-code} if that is not the case.
+
+ The input arguments will be parsed with |\pgfmathfloatparsenumber|.
+
+ \begin{key}{/pgf/fpu/rel thresh=\marg{number} (initially 1e-4)}
+ A threshold used by |\pgfmathfloatifapproxequalrel| to decide whether numbers are approximately equal.
+ \end{key}
+\end{command}
+
+
+\begin{command}{\pgfmathfloatshift{\marg{x}}{\marg{num}}}
+ Defines |\pgfmathresult| to be $\meta{x} \cdot 10^{\meta{num}}$. The operation is an arithmetic shift base ten and modifies only the exponent of \marg{x}. The argument \marg{num} is expected to be a (positive or negative) integer.
+\end{command}
+
+
+\begin{command}{\pgfmathfloatabserror\marg{x}\marg{y}}
+ Defines |\pgfmathresult| to be the absolute error between two floating point numbers $x$ and $y$, $\lvert x - y\rvert $ and returns the result as floating point number.
+\end{command}
+
+\begin{command}{\pgfmathfloatrelerror\marg{x}\marg{y}}
+ Defines |\pgfmathresult| to be the relative error between two floating point numbers $x$ and $y$, $\lvert x - y\rvert / \lvert y \rvert $ and returns the result as floating point number.
+\end{command}
+
+
+\begin{command}{\pgfmathfloatint\marg{x}}
+Returns the integer part of the floating point number \marg{x}, by truncating any digits after the period. This methods is applied to the absolute value $\rvert x \lvert$, so negative numbers are treated in the same way as positive ones.
+
+The result is returned as floating point number as well.
+
+See also |\pgfmathfloattoint| which returns the number in integer format.
+\end{command}
+
+\begin{command}{\pgfmathlog{\marg{x}}}
+ Defines |\pgfmathresult| to be the natural logarithm of \marg{x}, $\ln(\meta{x})$. This method is logically the same as |\pgfmathln|, but it applies floating point arithmetics to read number \marg{x} and employs the logarithm identity
+ \[ \ln(m \cdot 10^e) = \ln(m) + e \cdot \ln(10) \]
+ to get the result. The factor $\ln(10)$ is a constant, so only $\ln(m)$ with $1 \le m < 10$ needs to be computed. This is done using standard pgf math operations.
+
+ Please note that \marg{x} needs to be a number, expression parsing is not possible here.
+
+ If \marg{x} is \emph{not} a bounded positive real number (for example $\meta{x} \le 0$), |\pgfmathresult| will be \emph{empty}, no error message will be generated.
+\begin{codeexample}[]
+\pgfmathlog{1.452e-7}
+\pgfmathresult
+\end{codeexample}
+\begin{codeexample}[]
+\pgfmathlog{6.426e+8}
+\pgfmathresult
+\end{codeexample}
+\end{command}
+
+\subsubsection{Accessing the Original Math Routines for Programmers}
+As soon as the library is loaded, every private math routine will be copied to a new name.
+This allows library and package authors to access the \TeX-register based math routines even if the FPU is activated. And, of course, it allows the FPU as such to perform its own mantissa computations.
+
+The private implementations of \pgfname\ math commands, which are of the form |\pgfmath|\meta{name}|@|, will be available as|\pgfmath@basic@|\meta{name}|@| as soon as the library is loaded.
+
+
+\endgroup
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex
new file mode 100644
index 00000000000..0aeb8113b01
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex
@@ -0,0 +1,411 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+
+\section{Lindenmayer System Drawing Library}
+\subsection{Overview}
+
+Lindenmayer systems (also commonly known as ``L-systems''), were
+originally developed by Aristid Lindenmayer as a theory of algae
+growth patterns and then subsequently used to model branching
+patterns in plants and produce fractal patterns.
+Typically, an L-system consists of a set of symbols, each of which
+is associated with some graphical action (such as ``turn left'' or
+``move forward'') and a set of rules (``production'' or ``rewrite''
+rules). Given a string of symbols, the rewrite rules are applied
+several times and the when resulting string is processed the action
+associated with each symbol is executed.
+
+In \pgfname, L-systems can be used to create simple 2-dimensional
+fractal patterns\ldots
+\begin{codeexample}[pre={\expandafter\let\csname pgf@lsystem@Koch curve\endcsname=\relax}]
+\begin{tikzpicture}
+\pgfdeclarelindenmayersystem{Koch curve}{
+ \rule{F -> F-F++F-F}
+}
+
+\shadedraw [top color=white, bottom color=blue!50, draw=blue!50!black]
+ [l-system={Koch curve, step=2pt, angle=60, axiom=F++F++F, order=3}]
+ lindenmayer system -- cycle;
+\end{tikzpicture}
+\end{codeexample}
+
+\noindent\ldots and ``plant like'' patterns\ldots
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+\draw [green!50!black, rotate=90]
+ [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4, step=2pt,
+ randomize step percent=25, angle=30, randomize angle percent=5}]
+ lindenmayer system;
+\end{tikzpicture}
+\end{codeexample}
+
+\noindent
+\ldots but it is important to bear in mind that even moderately
+complex L-systems can exceed the available memory of \TeX,
+and can be very slow.
+If possible, you are advised to increase the main memory and save
+stack to their maximum possible values for your particular
+\TeX{} distribution.
+However, even by doing this you may find you still run out of memory
+quite quickly.
+
+For an excellent introduction to L-systems (containing some
+``really cool'' pictures -- many of which are sadly not possible in
+\pgfname)
+see \emph{The Algorithmic Beauty of Plants} by
+Przemyslaw Prusinkiewicz and Aristid Lindenmayer (which is freely
+available via the internet).
+
+\begin{pgflibrary}{lindenmayersystems}
+ This \pgfname-library provides basic commands for defining and using
+ simple L-systems. The \tikzname-library provides, furthermore, a
+ front end for using L-systems in \tikzname.
+\end{pgflibrary}
+
+
+
+\subsubsection{Declaring L-systems}
+ Before an L-system can be used, it must be declared using the
+ following command:
+
+\begin{command}{\pgfdeclarelindenmayersystem\marg{name}\marg{specification}}
+
+This command declares a Lindenmayer system called \meta{name}.
+The \meta{specification} argument contains a description of the
+L-system's symbols and rules. Two commands |\symbol| and |\rule| are
+only defined when the \meta{specification} argument is executed.
+
+\begin{command}{\symbol\marg{name}\marg{code}}
+ This defines a symbol called \meta{name} for a specific L-system,
+ and associates it with \meta{code}.
+
+ A symbol should consist of a single
+ alpha-numeric character (i.e., |A|-|Z|, |a|-|z| or |0|-|9|).
+ The symbols
+ |F|, |f|, |+|, |-|, |[| and |]| are available by default so do
+ not need to be defined for each L-system. However, if you are
+ feeling adventurous, they can be redefined for specific L-systems
+ if required. The L-system treats the default symbols as follows
+ (the commands they execute are described below):
+
+ \begin{itemize}
+ \item
+ |F| move forward a certain distance, drawing a line. Uses
+ |\pgflsystemdrawforward|.
+
+ \item
+ |f| move forward a certain distance, without drawing a line.
+ Uses |\pgflsystemmoveforward|.
+
+ \item
+ |+| turn left by some angle.
+ Uses |\pgflsystemturnleft|.
+
+ \item
+ |-| turn right by some angle.
+ Uses |\pgflsystemturnright|.
+
+ \item
+ |[| save the current state (i.e., the position and direction).
+ Uses |\pgflsystemsavestate|.
+
+ \item
+ |]| restore the last saved state.
+ Uses |\pgflsystemrestorestate|.
+
+ \end{itemize}
+
+ The symbols |[| and |]| act like a stack: |[| pushes the state of the
+ L-system on to the stack, and |]| pops a state off the stack.
+
+ When \meta{code} is executed the transformation matrix is set up
+ so that the origin is at the current position and the positive
+ x-axis ``points forward'', so |\pgfpathlineto{\pgfpoint{1cm}{0cm}}|
+ draws a line 1cm forward.
+
+The following keys can alter the production of an L-system. However,
+thy do not store values in themselves.
+
+\begin{key}{/pgf/lindenmayer system/step=\meta{length} (initially 5pt)}
+ How far the L-system moves forward if required. This key sets the
+ \TeX{} dimension |\pgflsystemstep|.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/randomize step percent=\meta{percentage} (initially 0)}
+ If the step is to be randomized, this key specifies by how much.
+ The value is stored in the \TeX{} macro |\pgflsystemrandomizesteppercent|.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/left angle=\meta{angle} (initially 90)}
+ This key sets the angle through which the L-system turns when it
+ turns left.
+ The value is stored in the \TeX{} macro |\pgflsystemrleftangle|.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/right angle=\meta{angle} (initially 90)}
+ This key sets the angle through which the L-system turns when it
+ turns right.
+ The value is stored in the \TeX{} macro |\pgflsystemrrightangle|.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/randomize angle percent=\meta{percentage} (initially 0)}
+ If the angles are to be randomized, this key specifies by how much.
+ The value is stored in the \TeX{} macro |\pgflsystemrandomizeanglepercent|.
+\end{key}
+
+For speed and convenience, when the code for a symbol is executed the
+following commands are available.
+
+\begin{command}{\pgflsystemcurrentstep}
+ The current ``step'' of the L-system (i.e., how far the system
+ will move forward if required). This is initially set to the
+ value in the \TeX-dimensions |\pgflsystemstep|, but the actual
+ value may be changed if |\pgflsystemrandomizestep| is used
+ (see below).
+\end{command}
+
+\begin{command}{\pgflsystemcurrentleftangle}
+ The angle the L-system will turn when it turns left.
+ The value stored in this macro may be changed if
+ |\pgflsystemrandomizeleftangle| is used.
+\end{command}
+
+\begin{command}{\pgflsystemcurrentrightangle}
+ The angle the L-system will turn when it turns right.
+ The value stored in this macro may be changed if
+ |\pgflsystemrandomizerightangle| is used.
+\end{command}
+
+
+The following commands may be useful if you wish to define your own
+symbols.
+
+\begin{command}{\pgflsystemrandomizestep}
+ Randomizes the value in |\pgflsystemcurrentstep| according to the
+ value of the |randomize| |step| |percent| key.
+\end{command}
+
+\begin{command}{\pgflsystemrandomizeleftangle}
+ Randomizes the value in |\pgflsystemcurrentleftangle| according to
+ the value of the |randomize| |angle| |percent| key.
+\end{command}
+
+\begin{command}{\pgflsystemrandomizerightangle}
+ Randomizes the value in |\pgflsystemcurrentrightangle| according
+ to the value of the |randomize| |angle| key.
+\end{command}
+
+\begin{command}{\pgflsystemdrawforward}
+ Move forward in the current direction, by |\pgflsystemcurrentstep|,
+ drawing a line in the process. This macro calls
+ |\pgflsystemrandomizestep|. Internally, \pgfname{} simply
+ shifts the transformation matrix in the positive direction of
+ the current (transformed) x-axis by |\pgflsystemstep|
+ and then executes a line-to to the (newly transformed) origin.
+\end{command}
+
+\begin{command}{\pgflsystemmoveforward}
+ Move forward in the current direction, by |\pgflsystemcurrentstep|,
+ without drawing a line. This macro calls
+ |\pgflsystemrandomizestep|. \pgfname{} executes a transformation
+ as above, but executes a move-to to the (newly transformed)
+ origin.
+\end{command}
+
+\begin{command}{\pgflsystemturnleft}
+ Turn left by |\pgflsystemcurrentleftangle|. Internally, \pgfname{}
+ simply rotates the transformation matrix. This macro calls
+ |\pgflsystemrandomizeleftangle|.
+\end{command}
+
+\begin{command}{\pgflsystemturnright}
+ Turn right by |\pgflsystemcurrentrightangle|. Internally, \pgfname{}
+ simply rotates the transformation matrix. This macro calls
+ |\pgflsystemrandomizerightangle|.
+\end{command}
+
+\begin{command}{\pgflsystemsavestate}
+ Save the current position and orientation. Internally,
+ \pgfname{} simply starts a new \TeX-group.
+\end{command}
+
+\begin{command}{\pgflsystemrestorestate}
+ Restore the last saved position and orientation. Internally,
+ \pgfname{} closes a \TeX-group, restoring the transformation
+ matrix of the outer scope, and a move-to command is executed to
+ the (transformed) origin.
+\end{command}
+
+
+\end{command}
+
+\begin{command}{\rule{\ttfamily\char`\{}\meta{head}{\ttfamily->}\meta{body}{\ttfamily\char`\}}}
+ Declare a rule. \meta{head} should consist of a single symbol, which
+ need not have been declared using |\symbol| or exist as a default
+ symbol (in fact, the more interesting L-systems depend on using
+ symbols with no corresponding code, to control the ``growth'' of the
+ system).
+ \meta{body} consists of a string of symbols, which again need not
+ necessarily have any code associated with them.
+
+\end{command}
+
+ As an example, the following shows an L-system that uses
+ some of these commands. This example illustrates the point
+ that some symbols, in this case |A| and |B|, do not have to
+ have code associated with them. They simply control the
+ growth of the system.
+
+\begin{codeexample}[pre={\nullfont\expandafter\let\csname pgf@lsystem@Hilbert curve\endcsname=\relax}]
+\pgfdeclarelindenmayersystem{Hilbert curve}{
+ \symbol{X}{\pgflsystemdrawforward}
+ \symbol{+}{\pgflsystemturnright} % Explicitly define + and - symbols.
+ \symbol{-}{\pgflsystemturnleft}
+ \rule{A -> +BX-AXA-XB+}
+ \rule{B -> -AX+BXB+XA-}
+}
+\tikz\draw[lindenmayer system={Hilbert curve, axiom=A, order=4, angle=90}]
+ lindenmayer system;
+\end{codeexample}
+
+
+\end{command}
+
+\subsection{Using Lindenmayer Systems}
+\subsubsection{Using L-Systems in PGF}
+
+The following command is used to run an L-system in \pgfname:
+\begin{command}{\pgflindenmayersystem\marg{name}\marg{axiom}\marg{order}}
+ Runs the L-system called \meta{name} using the input string \meta{axiom}
+ for \meta{order} iterations.
+ In general, prior to calling this command the
+ transformation matrix should be set appropriately for shifting and
+ rotating, and a move-to to the (transformed) origin should be
+ executed. This origin will be where the L-system starts.
+ In addition the relevant keys should be set appropriately.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [help lines] grid (3,2);
+ \pgfset{lindenmayer system/.cd, angle=60, step=2pt}
+ \foreach \x/\y in {0cm/1cm, 1.5cm/1.5cm, 2.5cm/0.5cm, 1cm/0cm}{
+ \pgftransformshift{\pgfqpoint{\x}{\y}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgflindenmayersystem{Koch curve}{F++F++F}{2}
+ \pgfusepath{stroke}
+ }
+\end{tikzpicture}
+\end{codeexample}
+
+ Note that, it is perfectly feasible for an L-system to define
+ special symbols which perform the move-to and use-path
+ operations.
+
+\end{command}
+
+\subsubsection{Using L-Systems in Ti\emph{k}Z}
+
+ In \tikzname, an L-system is created using a path operation.
+ However, \tikzname{} is more flexible regarding the positioning
+ of the L-system and also provides keys to create L-systems
+ ``on-line''.
+
+\begin{pathoperation}{lindenmayer system}{ \opt{|[|\meta{keys}|]|}}
+ This will run an L-system according to the parameters
+ specified in \meta{keys} (which can also contain normal \tikz{} keys
+ such as |draw| or |thin|). The syntax is flexible
+ regarding the L-system parameters and the following all do
+ the same thing:
+
+\begin{codeexample}[code only]
+\draw lindenmayer system [lindenmayer system={Hilbert curve, axiom=4, order=3}];
+\end{codeexample}
+
+\begin{codeexample}[code only]
+\draw [lindenmayer system={Hilbert curve, axiom=4, order=3}] lindenmayer system;
+\end{codeexample}
+
+\begin{codeexample}[code only]
+\tikzset{lindenmayer system={Hilbert curve, axiom=4, order=3}}
+\draw lindenmayer system;
+\end{codeexample}
+
+\end{pathoperation}
+
+\begin{pathoperation}{l-system}{ \opt{|[|\meta{keys}|]|}}
+ A more compact version of the |lindenmayer system| path command.
+\end{pathoperation}
+
+This library adds some additional keys for specifying L-systems.
+These keys only work in \tikzname{} and all
+have the same path, namely, |/pgf/lindenmayer| |system|, but so
+you do not have to keep repeating this path the following keys are
+provided:
+
+\begin{stylekey}{/pgf/lindenmayer system=\marg{keys}}
+\keyalias{tikz}
+This key changes the key path to |/pgf/lindenmayer systems| and
+executes \meta{keys}.
+\end{stylekey}
+
+\begin{stylekey}{/pgf/l-system=\marg{keys}}
+\keyalias{tikz}
+A more compact version of the previous key.
+\end{stylekey}
+
+\begin{key}{/pgf/lindenmayer system/name=\marg{name}}
+ Set the name for the L-system.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/axiom=\marg{string}}
+ Set the axiom (or input string) for the L-system.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/order=\marg{integer}}
+ Set the number of iterations the L-system will perform.
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/rule set=\marg{list}}
+ This key allows an (anonymous) L-system to be declared ``on-line''.
+ There is, however, a restriction that only the default symbols can be
+ used for drawing (empty symbols can still be used to control
+ the growth of the system). The rules in \meta{list} should
+ be separated by commas.
+
+\begin{codeexample}[]
+\tikz[rotate=65]\draw [green!60!black] l-system
+ [l-system={rule set={F -> F[+F]F[-F]}, axiom=F, order=4, angle=25,step=3pt}];
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/lindenmayer system/anchor=\meta{anchor}}
+ Be default, when this key is not used, the L-system will start from
+ the last specified coordinate. By using this key, the L-system
+ will be placed inside a special (rectangle) node which can be
+ positioned using \meta{anchor}.
+
+
+\begin{codeexample}[]
+\begin{tikzpicture}[l-system={step=1.75pt, order=5, angle=60}]
+ \pgfdeclarelindenmayersystem{Sierpinski triangle}{
+ \symbol{X}{\pgflsystemdrawforward}
+ \symbol{Y}{\pgflsystemdrawforward}
+ \rule{X -> Y-X-Y}
+ \rule{Y -> X+Y+X}
+ }
+ \draw [help lines] grid (3,2);
+ \draw [red] (0,0) l-system
+ [l-system={Sierpinski triangle, axiom=+++X, anchor=south west}];
+ \draw [blue] (3,2) l-system
+ [l-system={Sierpinski triangle, axiom=X, anchor=north east}];
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
index 57cf67f4abb..a50f1179d7b 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
@@ -30,7 +30,7 @@ cell. The following key simplifies typesetting such matrices.
where the name is set to \meta{matrix name}|-|\meta{row
number}|-|\meta{column number}. For example, if the matrix has
the name |my matrix|, then the node in the upper left cell will get
- the name |my matrix-1-1|.
+ the name |my matrix-1-1|.
\begin{codeexample}[]
\begin{tikzpicture}
\matrix (magic) [matrix of nodes]
@@ -61,7 +61,7 @@ cell. The following key simplifies typesetting such matrices.
};
\end{tikzpicture}
\end{codeexample}
-
+
\item At the beginning of a cell, you can use a special syntax. If a
cell starts with a vertical bar, then everything between this bar
and the next bar is passed on to the |node| command.
@@ -82,7 +82,7 @@ cell. The following key simplifies typesetting such matrices.
Note that the |&| character also takes an optional argument, which
is an extra column skip.
-{\catcode`\|=12
+{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of nodes]
@@ -191,7 +191,7 @@ Since \TeX\ is not clairvoyant, the following rules are used:
then inside this first group the |\\| command retains the meaning of
``end of line'' character. Note that this special rule works only
for the first group in a cell and this group must be at the
- beginning.
+ beginning.
\end{enumerate}
The net effect of these rules is the following: Normally, |\\| is an
@@ -225,7 +225,7 @@ not balanced with respect to the number of braces).
\subsection{Delimiters}
-Delimiters are parantheses or braces to the left and right of a
+Delimiters are parentheses or braces to the left and right of a
formula or a matrix. The matrix library offers options for adding such
delimiters to a matrix. However, delimiters can actually be added to
any node that has the standard anchors |north|, |south|, |north west|
@@ -256,7 +256,7 @@ some after node magic.
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every delimiter (initially \normalfont empyt)}
+ \begin{stylekey}{/tikz/every delimiter (initially \normalfont empty)}
This style is executed for every delimiter. You can use it to shift
or color delimiters or do whatever.
\end{stylekey}
@@ -316,7 +316,7 @@ some after node magic.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
index f9396ccf335..4a88719792c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
@@ -17,7 +17,7 @@
This library is intended to make the creation of mindmaps or concept
maps easier. A \emph{mindmap} is a graphical representation of a
-concept together
+concept together
with related concepts and annotations. Mindmaps are, essentially,
trees, possibly with a few extra edges added, but they are usually
drawn in a special way: The root concept is placed in the middle of
@@ -47,14 +47,14 @@ Every mindmap should be put in a scope or a picture where the
\begin{stylekey}{/tikz/mindmap}
Use this style with all pictures or at least scopes that contain a
mindmap. It installs a whole bunch of settings that are useful for
- drawing mindmaps.
+ drawing mindmaps.
\begin{codeexample}[]
\tikz[mindmap,concept color=red!50]
\node [concept] {Root concept}
child[grow=right] {node[concept] {Child concept}};
\end{codeexample}
The sizes of concepts are predefined in such a way that a
- medium-size mindmap will fit on an A4 page (more or less).
+ medium-size mindmap will fit on an A4 page (more or less).
\begin{stylekey}{/tikz/every mindmap}
This style is included by the |mindmap| style. Change this style to
add special settings to your mindmaps.
@@ -64,16 +64,32 @@ Every mindmap should be put in a scope or a picture where the
child[grow=right] {node[concept] {Child concept}};
\end{codeexample}
\end{stylekey}
+
+ \paragraph{Remark:} Note that |mindmap| re-defines |font| sizes and |sibling angle| depending on the current concept level (i.e. inside of |level 1 concept|, |level 2 concept| etc.). Thus, if you need to redefine these variables, use
+
+ |\tikzset{level 1 concept/.append style={font=\small}}|
+
+ \noindent or
+
+ |\tikzset{level 2 concept/.append style={sibling distance=90}}|
+
+ \noindent \emph{after} the |mindmap| style.
\end{stylekey}
+\begin{stylekey}{/tikz/small mindmap}
+ This style includes the |mindmap| style, but additionally changes
+ the default size of concepts, fonts and distances so that a medium-sized
+ mindmap will fit on an A5 page (A5 pages are half as large as A4
+ pages). Mindmaps with |small mindmap| will also fit onto a standard frame of the |beamer| package.
+\end{stylekey}
\begin{stylekey}{/tikz/large mindmap}
This style includes the |mindmap| style, but additionally changes
- the default size of concepts and of distances so that a medium-sized
+ the default size of concepts, fonts and distances so that a medium-sized
mindmap will fit on an A3 page (A3 pages are twice as large as A4
pages).
\end{stylekey}
\begin{stylekey}{/tikz/huge mindmap}
- This style causes conepts to be even bigger and it is best used with
+ This style causes concepts to be even bigger and it is best used with
A2 paper and above.
\end{stylekey}
@@ -93,7 +109,7 @@ The following styles influence how isolated concepts are rendered:
This style should be used with all nodes that are concepts, although
some styles like |extra concept| install this style automatically.
- Bascially, this style makes the concept node circular and installs a
+ Basically, this style makes the concept node circular and installs a
uniform color called |concept color|, see below. Additionally, the
style |every concept| is called.
\begin{codeexample}[]
@@ -145,7 +161,7 @@ The following styles influence how isolated concepts are rendered:
As pointed out earlier, \tikzname\ assumes that your mindmap is build
using the |child| facilities of \tikzname. There are numerous options
that influence how concepts are rendered at the different levels of a
-tree.
+tree.
\begin{stylekey}{/tikz/root concept}
This style is used for the roots of mindmap trees. By adding
@@ -165,7 +181,7 @@ tree.
\begin{stylekey}{/tikz/level 1 concept}
The |mindmap| style adds this style to the |level 1| style. This
means that the first level children of a mindmap tree will use this
- style.
+ style.
\begin{codeexample}[]
\tikz
[root concept/.append style={concept color=blue!80},
@@ -185,8 +201,8 @@ tree.
\begin{stylekey}{/tikz/level 4 concept}
Works like |level 1 concept|. Note that there are not fifth and
higher level styles, you need to modify |level 5| directly in such
- cases.
-\end{stylekey}
+ cases.
+\end{stylekey}
\begin{key}{/tikz/concept color=\meta{color}}
We saw already that this option is used to change the color of
@@ -196,7 +212,7 @@ tree.
|child| operation (and not to the |node| operation and also not as
an option to all children via the |level 1| style), \tikzname\ will
smoothly change the concept color from the parent's color to the
- color of the child concept.
+ color of the child concept.
Here is an example:
\begin{codeexample}[]
@@ -285,7 +301,7 @@ in the mindmap library:
first circle at the specified angle relative to the line connecting
the centers of the circles. The path then changes into a rectangle
whose thickness is given by the amplitude. Finally, the path ends
- with the same angles on the second circle.
+ with the same angles on the second circle.
Here is an example that should make this clearer:
\begin{codeexample}[]
@@ -321,7 +337,7 @@ in the mindmap library:
good idea to make the circles slightly larger to cover up such
problems. When using nodes of shape |circle|, you can just add the
|draw| option with a |line width| or one or two points (for very
- large distances you may need line width up to 4pt).
+ large distances you may need line width up to 4pt).
\begin{codeexample}[]
\begin{tikzpicture}
[blue!50,decoration={start radius=1cm,
@@ -361,11 +377,11 @@ necessary computations for you.
from the |center| anchor to some anchor on the border) and will set
the |start circle| keys accordingly. Next, the |fill| option
is set to the |concept color| while |draw=none| is set. The decoration is
- set to |circle conncetion bar|. Finally, the following style is
+ set to |circle connection bar|. Finally, the following style is
included:
\begin{stylekey}{/tikz/every circle connection bar}
- Redefine this sytle to change the appearance of circle connection
- bar to-paths.
+ Redefine this style to change the appearance of circle connection
+ bar to-paths.
\end{stylekey}
\begin{codeexample}[]
\begin{tikzpicture}[concept color=blue!50,blue!50,outer sep=0pt]
@@ -398,7 +414,7 @@ library provides a special option for facilitating this procedure.
\node (n2) at (30:2.5) [circle,minimum size=1cm,fill,draw,thick,blue] {};
\path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2);
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -416,7 +432,7 @@ path that uses the to-path |circle connection bar| to connect the parent node
and the child node. The |concept color| option (locally) changes this
by using |circle connection bar switch color| instead with the
from-color set to the old (parent's) concept color and the to-color
-set to the new (child's) concept color. This menas that when you
+set to the new (child's) concept color. This means that when you
provide the |concept color| option to a |child| command, the color
will change from the parent's concept color to the specified color.
@@ -427,6 +443,8 @@ Here is an example of a tree build in this way:
\path[mindmap,concept color=black,text=white]
node[concept] {Computer Science}
[clockwise from=0]
+ % note that `sibling angle' can only be defined in
+ % `level 1 concept/.append style={}'
child[concept color=green!50!black] {
node[concept] {practical}
[clockwise from=90]
@@ -434,7 +452,7 @@ Here is an example of a tree build in this way:
child { node[concept] {data structures} }
child { node[concept] {pro\-gramming languages} }
child { node[concept] {software engineer\-ing} }
- }
+ }
child[concept color=blue] {
node[concept] {applied}
[clockwise from=-30]
@@ -477,7 +495,7 @@ in an annotation node.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
index c558acca9ed..befc36b9e0f 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
@@ -11,14 +11,14 @@
\section{Petri-Net Drawing Library}
\begin{tikzlibrary}{petri}
- This packages provides shapes and styles for drawing Petri nets.
+ This packages provides shapes and styles for drawing Petri nets.
\end{tikzlibrary}
\subsection{Places}
-The package defines a style for drawing places of Petri nets.
+The package defines a style for drawing places of Petri nets.
\begin{stylekey}{/tikz/place}
This style indicates that a node is a place of a Petri net. Usually,
@@ -27,16 +27,16 @@ The package defines a style for drawing places of Petri nets.
like its name or its capacity. You should use the |tokens| options,
explained in Section~\ref{section-tokens}, to add tokens inside the
place.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,label=above:$p_1$,tokens=2] (p1) {};
\node[place,label=below:$p_2\ge1$,right=of p1] (p2) {};
\end{tikzpicture}
\end{codeexample}
-
+
\begin{stylekey}{/tikz/every place}
- This stype is envoked by the style |place|. To change the
+ This style is evoked by the style |place|. To change the
appearance of places, you can change this style.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -55,7 +55,7 @@ The package defines a style for drawing places of Petri nets.
\subsection{Transitions}
Transitions are also nodes. They should be drawn using the following
-style:
+style:
\begin{stylekey}{/tikz/transition}
This style indicates that a node is a transition. As for places, the
@@ -64,7 +64,7 @@ style:
To connect a transition to places, you can use the |edge| command as
in the following example:
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,tokens=2,label=above:$p_1$] (p1) {};
@@ -75,9 +75,9 @@ style:
edge[post] node[auto] {2} (p2);
\end{tikzpicture}
\end{codeexample}
-
+
\begin{stylekey}{/tikz/every transition}
- This style is envoked by the style |transition|.
+ This style is evoked by the style |transition|.
\end{stylekey}
\begin{stylekey}{/tikz/pre}
@@ -116,7 +116,7 @@ simple style for typesetting them.
text will be typeset in a tiny font and in white on black
(naturally, you can easily change this by setting the style
|every token|).
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,label=above:$p_1$] (p1) {};
@@ -127,7 +127,7 @@ simple style for typesetting them.
\end{tikzpicture}
\end{codeexample}
\begin{stylekey}{/tikz/every token}
- Change this style to chagne the appearance of tokens.
+ Change this style to change the appearance of tokens.
\end{stylekey}
\end{stylekey}
@@ -271,7 +271,7 @@ affect how these options depict tokens.
every place/.style={draw=blue,fill=blue!20,minimum size=6mm}]
\foreach \i in {1,...,6} {
- \node[place,label=left:$p_\i$] (p\i) at (0,\i) {};
+ \node[place,label=left:$p_\i$] (p\i) at (0,\i) {};
\node[place,label=right:$q_\i$] (q\i) at (8,\i) {};
}
\foreach \name/\var/\vala/\valb/\height/\x in
@@ -311,7 +311,7 @@ affect how these options depict tokens.
\node[transition] at (6.5,5.5) {} edge [pre] (q5) edge [pre] (m2t)
edge [post] (q6) edge [post] (m2f);
\node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west);
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
Here is the same net once more, but with these styles changes:
@@ -326,7 +326,7 @@ Here is the same net once more, but with these styles changes:
every place/.style={draw,thick,minimum size=6mm}]
\foreach \i in {1,...,6} {
- \node[place,label=left:$p_\i$] (p\i) at (0,\i) {};
+ \node[place,label=left:$p_\i$] (p\i) at (0,\i) {};
\node[place,label=right:$q_\i$] (q\i) at (8,\i) {};
}
\foreach \name/\var/\vala/\valb/\height/\x in
@@ -368,7 +368,7 @@ Here is the same net once more, but with these styles changes:
\node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west);
\end{tikzpicture}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
index efe70ab6975..fd58176b7a2 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
@@ -97,6 +97,76 @@
\end{codeexample}
\end{command}
+\subsection{Constant Plot Handlers}
+There are three plot handlers which produce piecewise constant interpolations between successive points.
+
+\begin{command}{\pgfplothandlerconstantlineto}
+ This handler works like the line-to plot handler, only it will
+ produce a connected, piecewise constant path to connect the points.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerconstantlineto
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfplothandlerconstantlinetomarkright}
+A variant of |\pgfplothandlerconstantlineto| which places its mark on
+the right line ends.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerconstantlinetomarkright
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfplothandlerjumpmarkleft}
+ This handler works like the line-to plot handler, only it will
+ produce a non-connected, piecewise constant path to connect the points. If there are any plot marks, they will be placed on the left open pieces.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerjumpmarkleft
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfplothandlerjumpmarkright}
+ This handler works like the line-to plot handler, only it will
+ produce a non-connected, piecewise constant path to connect the points. If there are any plot marks, they will be placed on the right open pieces.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerjumpmarkright
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
\subsection{Comb Plot Handlers}
@@ -162,6 +232,202 @@ that the plots they produce look like ``combs'' (more or less).
\end{codeexample}
\end{command}
+\pgfname\ bar or comb plots usually draw something from zero to the
+current plot's coordinate. The ``zero'' offset can be changed using an
+input stream which returns the desired offset successively for each
+processed coordinate.
+
+There are two such streams, which can be configured independently.
+The first one returns ``zeros'' for coordinate~$x$, the second one
+returns ``zeros'' for coordinate~$y$. They are used as follows.
+
+\begin{codeexample}[code only]
+\pgfplotxzerolevelstreamstart
+\pgfplotxzerolevelstreamnext % assigns \pgf@x
+\pgfplotxzerolevelstreamnext
+\pgfplotxzerolevelstreamnext
+\pgfplotxzerolevelstreamend
+\end{codeexample}
+%
+\begin{codeexample}[code only]
+\pgfplotyzerolevelstreamstart
+\pgfplotyzerolevelstreamnext % assigns \pgf@x
+\pgfplotyzerolevelstreamend
+\end{codeexample}
+Different zero level streams can be implemented by overwriting these macros.
+
+\begin{command}{\pgfplotxzerolevelstreamconstant\marg{dimension}}
+ This zero level stream always returns \marg{dimension} instead of
+ $x=0$pt.
+
+ It is used for |xcomb| and |xbar|.
+\end{command}
+
+\begin{command}{\pgfplotyzerolevelstreamconstant\marg{dimension}}
+ This zero level stream always returns \marg{dimension} instead of
+ $y=0$pt.
+
+ It is used for |ycomb| and |ybar|.
+\end{command}
+
+\subsection{Bar Plot Handlers}
+\label{section-plotlib-bar-handlers}
+
+While comb plot handlers produce a line-to operation to generate
+combs, bar plot handlers employ rectangular shapes, allowing filled
+bars (or pattern bars).
+
+\begin{command}{\pgfplothandlerybar}
+ This handler converts each point in the plot stream into a rectangle
+ from the $x$-axis to the point's coordinate. The rectangle is placed
+ centered at the $x$-axis.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerybar
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfplothandlerxbar}
+ This handler converts each point in the plot stream into a rectangle
+ from the $y$-axis to the point's coordinate. The rectangle is placed
+ centered at the $y$-axis.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
+ \pgfplothandlerxbar
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+
+\label{key-bar-width}%
+\begin{key}{/pgf/bar width=\marg{dimension} (initially 10pt)}
+ \keyalias{tikz}
+ Sets the width of |\pgfplothandlerxbar| and |\pgfplothandlerybar| to
+ \marg{dimension}. The argument \marg{dimension} will be evaluated
+ using the math parser.
+\end{key}
+
+\label{key-bar-shift}%
+\begin{key}{/pgf/bar shift=\marg{dimension} (initially 0pt)}
+ \keyalias{tikz}
+ Sets a shift used by |\pgfplothandlerxbar| and |\pgfplothandlerybar|
+ to \marg{dimension}. It has the same effect as |xshift|, but it
+ applies only to those bar plots. The argument \marg{dimension} will
+ be evaluated using the math parser.
+\end{key}
+
+\begin{command}{\pgfplotbarwidth}
+ Expands to the value of |/pgf/bar width|.
+\end{command}
+
+
+\begin{command}{\pgfplothandlerybarinterval}
+ This handler is a variant of |\pgfplothandlerybar| which works with
+ intervals instead of points.
+
+ Bars are drawn between successive input coordinates and the width is
+ determined relatively to the interval length.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw[gray] (0,2) node {$x_1$} (1,1) node {$x_2$} (2,.5) node {$x_3$} (4,0.7) node {$x_4$};
+ \pgfplothandlerybarinterval
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{2cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}}
+ \pgfplotstreamend
+ \pgfusepath{stroke}
+\end{tikzpicture}
+\end{codeexample}
+
+In more detail, if $(x_i,y_i)$ and $(x_{i+1},y_{i+1})$ denote
+successive input coordinates, the bar will be placed above the
+interval $[x_i,x_{i+1}]$, centered at \[ x_i + \text{\meta{bar
+ interval shift}} \cdot (x_{i+1} - x_i) \] with width \[
+\text{\meta{bar interval width}} \cdot (x_{i+1} - x_i). \] Here,
+\meta{bar interval shift} and \meta{bar interval width} denote the
+current values of the associated options.
+
+If you have $N+1$ input points, you will get $N$ bars (one for each
+interval). The $y$~value of the last point will be ignored.
+\end{command}
+
+\begin{command}{\pgfplothandlerxbarinterval}
+ As |\pgfplothandlerybarinterval|, this handler provides bar plots
+ with relative bar sizes and offsets, one bar for each
+ $y$~coordinate interval.
+\end{command}
+
+\label{key-bar-interval-shift}%
+\begin{key}{/pgf/bar interval shift=\marg{shift} (initially 0.5)}
+ \keyalias{tikz}
+ Sets the \emph{relative} shift of |\pgfplothandlerxbarinterval| and
+ |\pgfplothandlerybarinterval| to \marg{shift}. As
+ |/pgf/bar interval width|, the argument is relative to the interval
+ length of the input coordinates.
+
+ The argument \marg{scale} will be evaluated using the math parser.
+\end{key}
+
+\label{key-bar-interval-width}%
+\begin{key}{/pgf/bar interval width=\marg{scale} (initially 1)}
+ \keyalias{tikz}
+ Sets the \emph{relative} width of |\pgfplothandlerxbarinterval| and
+ |\pgfplothandlerybarinterval| to \marg{scale}. The argument is
+ relative to $(x_{i+1} - x_i)$ for $y$~bar plots and relative to
+ $(y_{i+1}-y_i)$ for $x$~bar plots.
+
+ The argument \marg{scale} will be evaluated using the math parser.
+\begin{codeexample}[]
+\begin{tikzpicture}[bar interval width=0.5]
+ \draw[gray]
+ (0,3) -- (0,-0.1)
+ (1,3) -- (1,-0.1)
+ (2,3) -- (2,-0.1)
+ (4,3) -- (4,-0.1);
+ \pgfplothandlerybarinterval
+ \begin{scope}[bar interval shift=0.25,fill=blue]
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{2cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}}
+ \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}}
+ \pgfplotstreamend
+ \pgfusepath{fill}
+ \end{scope}
+ \begin{scope}[bar interval shift=0.75,fill=red]
+ \pgfplotstreamstart
+ \pgfplotstreampoint{\pgfpoint{0cm}{3cm}}
+ \pgfplotstreampoint{\pgfpoint{1cm}{0.2cm}}
+ \pgfplotstreampoint{\pgfpoint{2cm}{0.7cm}}
+ \pgfplotstreampoint{\pgfpoint{4cm}{0.2cm}}
+ \pgfplotstreamend
+ \pgfusepath{fill}
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+ Please note that bars are always centered, so we have to use shifts
+ $0.25$ and $0.75$ instead of $0$ and $0.5$.
+\end{key}
+
\subsection{Mark Plot Handler}
\label{section-plot-marks}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
index 19db2308f44..b953be6a25e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
@@ -31,6 +31,7 @@ dark yellow):
\plotmarkentry{o}
\plotmarkentry{asterisk}
\plotmarkentry{star}
+ \plotmarkentry{10-pointed star}
\plotmarkentry{oplus}
\plotmarkentry{oplus*}
\plotmarkentry{otimes}
@@ -41,13 +42,61 @@ dark yellow):
\plotmarkentry{triangle*}
\plotmarkentry{diamond}
\plotmarkentry{diamond*}
+ \plotmarkentry{halfdiamond*}
+ \plotmarkentry{halfsquare*}
+ \plotmarkentry{halfsquare right*}
+ \plotmarkentry{halfsquare left*}
\plotmarkentry{pentagon}
\plotmarkentry{pentagon*}
+ \plotmarkentry{Mercedes star}
+ \plotmarkentry{Mercedes star flipped}
+ \plotmarkentry{halfcircle}
+ \plotmarkentry{halfcircle*}
+ \plotmarkentry{heart}
+ \plotmarkentry{text}
\end{tabular}
}
+Note that each of the provided marks can be rotated freely by means of |mark options={rotate=90}| or |every mark/.append style={rotate=90}|.
-%%% Local Variables:
+\begin{key}{/pgf/mark color=\marg{color} (initially empty)}
+ Defines the additional fill color for the |halfcircle|, |halfcircle*|, |halfdiamond*| and |halfsquare*| markers. An empty value uses |white| (which is the initial configuration). The special value |none| disables filling of the respective parts.
+
+ Note that |halfsquare| will be filled with |mark color|, and the starred variant |halfsquare*| will be filled half with |mark color| and half with the actual |fill| color.
+\end{key}
+
+
+
+{
+\def\showit#1{%
+ \tikz\draw[color=black!25] plot[#1,mark options={fill=examplefill,draw=black}] coordinates{(0,0) (.5,0.2) (1,0) (1.5,0.2)};}%
+
+\begin{key}{/pgf/text mark=\marg{text} (initially p)}
+ Changes the text shown by |mark=text|.
+
+ With |/pgf/text mark=m|: \pgfkeys{/pgf/text mark=m}\showit{mark=text}
+
+ With |/pgf/text mark=A|: \pgfkeys{/pgf/text mark=A}\showit{mark=text}
+
+ There is no limitation about the number of characters or whatever. In fact, any \TeX\ material can be inserted as \marg{text}, including images.
+\end{key}
+\begin{key}{/pgf/text mark style=\marg{options for \texttt{mark=text}}}
+ Defines a set of options which control the appearance of |mark=text|.
+
+ If |/pgf/text mark as node=false| (the default), \marg{options} is provided as argument to |\pgftext| -- which provides only some basic keys like |left|, |right|, |top|, |bottom|, |base| and |rotate|.
+
+ If |/pgf/text mark as node=true|, \marg{options} is provided as argument to |\node|. This means you can provide a very powerful set of options including |anchor|, |scale|, |fill|, |draw|, |rounded corners| etc.
+\end{key}
+\begin{key}{/pgf/text mark as node=\mchoice{true,false} (initially false)}
+ Configures how |mark=text| will be drawn: either as |\node| or as |\pgftext|.
+
+ The first choice is highly flexible and possibly slow, the second is very fast and usually enough.
+\end{key}
+
+}
+
+
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex
new file mode 100644
index 00000000000..74fbea14558
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex
@@ -0,0 +1,151 @@
+% Copyright 2010 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\section{Profiler Library}
+{\noindent {\emph{by Christian Feuers\"anger}}}
+
+\begin{pgflibrary}{profiler}
+ A library to simplify the optimization of runtime speed of \TeX\ programs.
+
+ It relies on the |pdftex| primitive \declareandlabel{\pdfelapsedtime} to count (fractional) seconds and counts total time and self time for macro invocations.
+\end{pgflibrary}
+
+\subsection{Overview}
+The intended audience for this library are people writing \TeX\ code which should be optimized. It is certainly \emph{not} useful for the end-user.
+
+The work flow for the optimization is simple: the preamble contains configuration commands like
+\begin{codeexample}[code only]
+\usepgflibrary{profiler}
+\pgfprofilenewforenvironment{tikzpicture}
+\pgfprofilenewforcommand{\pgfkeys}{1}
+\end{codeexample}
+\noindent and then, the time between |\begin{tikzpicture}| and |\end{tikzpicture}| and the time required to call |\pgfkeys| will be collected.
+
+At the end, a short usage summary like
+\begin{codeexample}[code only]
+ pgflibraryprofiler(main job) {total time=1.07378sec; (100.0122%) self time=0.034sec; (3.1662%)}
+ pgflibraryprofiler(<ENV>tikzpicture) {total time=1.03978sec; (96.84601%) self time=1.00415sec; (93.52722%)}
+ pgflibraryprofiler(<CS>pgfkeys) {total time=0.03563sec; (3.31726%) self time=0.03563sec; (3.31726%)}
+\end{codeexample}
+\noindent will be provided in the log file, furthermore, the same information is available in a text table called |\jobname.profiler.|\meta{datetime}|.dat| which is of the form:
+\begin{codeexample}[code only]
+profilerentry totaltime[s] totaltime[percent] selftime[s] selftime[percent]
+main job 1.07378 100.0122 0.034 3.1662
+<ENV>tikzpicture 1.03978 96.84601 1.00415 93.52722
+<CS>pgfkeys 0.03563 3.31726 0.03563 3.31726
+\end{codeexample}
+Here, the |totaltime| means the time used for all invocations of the respective profiler entry (one row in the table). The |selftime| measures time which is not already counted for in another profiler entry which has been invoked within the current one. The example above is not very exiting: the main job consists only of several (quite complex) pictures and nothing else. Thus, its total time is large. However, the self time is very small because the |tikzpicture|s are counted separately, and they have been invoked within the |main job|. The |\pgfkeys| control sequence has been invoked within the |tikzpicture|, that's why the |selftime| for the |tikzpicture| is a little bit smaller than its |totaltime|.
+
+\subsection{Requirements}
+The library doesn't work without |pdftex|. Furthermore, it requires a more or less recent version which supports the |\pdfelapsedtime| directive.
+
+\subsection{Defining Profiler Entries}
+Unlike profilers for C/C++ or java, this library doesn't extract information about every \TeX\ macro automatically, nor does it collect information for each of them. Instead, every profiler entry needs to be defined explicitly. Only defined profiler entries will be processed.
+
+\begin{command}{\pgfprofilenew\marg{name}}
+ Defines a new profiler entry named \meta{name}.
+
+ This updates a set of internal registers used to track the profiler entry. The \meta{name} can be arbitrary, it doesn't need to be related to any \TeX\ macro.
+
+ The actual job of counting seconds is accomplished using |\pgfprofilestart|\marg{name} followed eventually by the command |\pgfprofileend|\marg{name}.
+
+ It doesn't hurt if |\pgfprofilenew| is called multiple times with the same name.
+\end{command}
+
+\begin{command}{\pgfprofilenewforcommand\oarg{profiler entry name}\marg{\textbackslash macro}\marg{arguments}}
+ Defines a new profiler entry which will measure the time spent in \meta{\textbackslash macro}. This calls |\pgfprofilenew| and replaces the current definition of \meta{\textbackslash macro} with a new one.
+
+ If \oarg{profiler entry name} has been provided, this defines the argument for |\pgfprofilenew|. It is allowed to use the same name for multiple commands; in this case, they are treated as if it where the same command. If the optional argument is not used, the profiler entry will be called `\declareandlabel{\pgfprofilecs}\meta{macro}' (\meta{macro} without backslash) where |\pgfprofilecs| is predefined to be |<CS>|.
+
+ The replacement macro will collect all required arguments, start counting, invoke the original macro definition and stop counting.
+
+ The following macro types are supported within |\pgfprofilenewforcommand|:
+ \begin{itemize}
+ \item commands which take one (optional) argument in square brackets
+ followed by one optional argument which has to be delimited by
+ curly braces (use an empty argument for \meta{arguments} in this case),
+ \item commands which take one (optional) argument in square brackets
+ and \emph{exactly} \meta{arguments} arguments afterwards.
+ \end{itemize}
+
+ Take a look at |\pgfprofilenewforcommandpattern| in case you have more complicated commands.
+
+
+ Note that the library can't detect if a command has been redefined somewhere.
+\end{command}
+
+\begin{command}{\pgfprofilenewforcommandpattern\oarg{profiler entry name}\marg{\textbackslash macro}\marg{argument pattern}\marg{invocation pattern}}
+ A variant of |\pgfprofilenewforcommand| which can be used with arbitrary \meta{argument patterns}. Example:
+\begin{codeexample}[code only]
+\def\mymacro#1\to#2\in#3{ ... }
+\pgfprofilenewforcommandpattern{\mymacro}{#1\to#2\in#3}{{#1}\to{#2}\in{#3}}
+\end{codeexample}
+
+Note that |\pgfprofilenewforcommand| is a special case of |\pgfprofilenewforcommandpattern|:
+\begin{codeexample}[code only]
+\def\mymacro#1#2{ ... }
+\pgfprofilenewforcommand\macro{2}
+\pgfprofilenewforcommandpattern{\mymacro}{#1#2}{{#1}{#2}}
+\end{codeexample}
+ Thus, \meta{argument pattern} is a copy-paste from the definition of your command. The \meta{invocation pattern} is used by the profiler library to invoke the \emph{original} command, so it is closely related to \meta{argument pattern}, but it needs extra curly braces around each argument.
+
+ The behavior of |\pgfprofilenewforcommandpattern| is the same as discussed above: it defines a new profiler entry which will measure the time spent in \meta{\textbackslash macro}. The details about this definition has already been described. Note that up to one optional argument in square brackets is also checked automatically.
+
+
+ If you like to profile a command which doesn't match here for whatever reasons, you'll have to redefine it manually and insert |\pgfprofilestart| and |\pgfprofileend| in appropriate places.
+\end{command}
+
+\begin{command}{\pgfprofileshowinvocationsfor\marg{profiler entry name}}
+ Enables verbose output for \emph{every} invocation of \meta{profiler entry name}.
+
+ This is only available for profiler entries for commands (those created by |\pgfprofilenewforcommand| for example). It will also show any arguments.
+\end{command}
+\begin{command}{\pgfprofileshowinvocationsexpandedfor\marg{profiler entry name}}
+ A variant of |\pgfprofileshowinvocationsfor| which will expand all arguments for \meta{profiler entry name} before showing them. The invocation as such is not affected by this expansion.
+
+ This expansion (with |\edef|) might yield unrecoverable errors for some commands. Handle with care.
+\end{command}
+
+\begin{command}{\pgfprofilenewforenvironment\oarg{profiler entry name}\marg{environment name}}
+ Defines a new profiler entry which measures time spent in the environment \meta{environment name}.
+
+ This calls |\pgfprofilenew| and handles the begin/end of the environment automatically.
+
+ The argument for |\pgfprofilenew| is \meta{profiler entry name}, or, if this optional argument is not used, it is `\declareandlabel{\pgfprofileenv}\meta{environment name}' where |\pgfprofileenv| is predefined as |<ENV>|. Again, it is permitted to use the same \meta{profiler entry name} multiple times to merge different commands into one output section.
+
+\end{command}
+
+
+\begin{command}{\pgfprofilestart\marg{profiler entry name}}
+ Starts (or resumes) timing of \meta{profiler entry name}. The argument must have been declared in the preamble using |\pgfprofilenew|.
+
+ Nested calls of |\pgfprofilestart| with the same argument will be ignored.
+
+ The invocation of this command doesn't change the environment: it doesn't introduce any \TeX\ groups nor does it modify the token list.
+\end{command}
+
+\begin{command}{\pgfprofileend\marg{profiler entry name}}
+ Stops (or interrupts) timing of \meta{profiler entry name}.
+
+ This command finishes a preceding call to |\pgfprofilestart|.
+\end{command}
+
+\begin{command}{\pgfprofilepostprocess}
+ For \LaTeX, this command is installed automatically in |\end{document}|. It stops all running timings, evaluates them and returns the result into the logfile. Furthermore, it generates a text table called |\jobname.profiler.|\meta{YYYY}|-|\meta{MM}|-|\meta{DD}|_|\meta{HH}|h_|\meta{MM}|m.dat| with the same information.
+
+ Note that the profiler library predefines two profiler entries, namely |main job| which counts time from the beginning of the document until |\pgfprofilepostprocess| and |preamble| which counts time from the beginning of the document until |\begin{document}|.
+\end{command}
+
+\begin{command}{\pgfprofilesetrel\marg{profiler entry name} (initially main job)}
+ Sets the profiler entry whose total time will be used to compute all other relative times. Thus, \meta{profiler entry name} will use $100\%$ of the total time per definition, all other relative times are relative to this one.
+\end{command}
+
+\begin{command}{\pgfprofileifisrunning\marg{profiler entry name}\marg{true code}\marg{false code}}
+ Invokes \marg{true code} if \marg{profiler entry name} is currently running and \marg{false code} otherwise.
+\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex
new file mode 100644
index 00000000000..cf4a008aebe
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex
@@ -0,0 +1,225 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Shadings Library}
+\label{section-library-shadings}
+
+\begin{pgflibrary}{shadings}
+ The package defines a number of shadings in addition to the ball and
+ axis shadings that are available by default.
+\end{pgflibrary}
+
+In the following, the shadings defined in the library are listed in
+alphabetical order. The colors of some of these shadings can be
+configured using special options (like |left color|). These options
+implicitly select the shading.
+
+The three shadings |axis|, |ball|, and |radial| are always defined,
+even when this library is not used.
+
+
+\begin{shading}{axis}
+ In this always-defined shading the colors change gradually
+ between three horizontal lines. The top line is at the top
+ (uppermost) point of the path, the middle is in the middle, the
+ bottom line is at the bottom of the path.
+
+ \begin{key}{/tikz/top color=\meta{color}}
+ This option prescribes the color to be used at the top in an |axis|
+ shading. When this option is given, several things happen:
+ \begin{enumerate}
+ \item
+ The |shade| option is selected.
+ \item
+ The |shading=axis| option is selected.
+ \item
+ The middle color of the axis shading is set to the average of the
+ given top color \meta{color} and of whatever color is currently
+ selected for the bottom.
+ \item
+ The rotation angle of the shading is set to 0.
+ \end{enumerate}
+
+\begin{codeexample}[]
+\tikz \draw[top color=red] (0,0) rectangle (2,1);
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/bottom color=\meta{color}}
+ This option works like |top color|, only for the bottom color.
+ \end{key}
+
+ \begin{key}{/tikz/middle color=\meta{color}}
+ This option specifies the color for the middle of an axis
+ shading. It also sets the |shade| and |shading=axis| options, but it
+ does not change the rotation angle.
+
+ \emph{Note:} Since both |top color| and |bottom color| change the
+ middle color, this option should be given \emph{last} if all of
+ these options need to be given:
+
+\begin{codeexample}[]
+\tikz \draw[top color=white,bottom color=black,middle color=red]
+ (0,0) rectangle (2,1);
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/left color=\meta{color}}
+ This option does exactly the same as |top color|, except that the
+ shading angle is set to $90^\circ$.
+ \end{key}
+
+ \begin{key}{/tikz/right color=\meta{color}}
+ Works like |left color|.
+ \end{key}
+\end{shading}
+
+
+\begin{shading}{ball}
+ This always-defined shading fills the path with a shading that ``looks like a
+ ball.'' The default ``color'' of the ball is blue (for no
+ particular reason).
+
+ \begin{key}{/tikz/ball color=\meta{color}}
+ This option sets the color used for the ball shading. It sets the
+ |shade| and |shading=ball| options. Note that the ball will never
+ ``completely'' have the color \meta{color}. At its ``highlight'' spot
+ a certain amount of white is mixed in, at the border a certain
+ amount of black. Because of this, it also makes sense to say
+ |ball color=white| or |ball color=black|
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \shade[ball color=white] (0,0) circle (2ex);
+ \shade[ball color=red] (1,0) circle (2ex);
+ \shade[ball color=black] (2,0) circle (2ex);
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+\end{shading}
+
+
+
+\begin{shading}{bilinear interpolation}
+ This shading fills a rectangle with colors that a bilinearly
+ interpolated between the colors in the four corners of the
+ rectangle. These four colors are called |lower left|, |lower right|,
+ |upper left|, and |upper right|. By changing these color, you can
+ change the way the shading looks. The library also defines four
+ options, called the same way, that can be used to set these colors
+ and select the shading implicitly.
+
+\begin{codeexample}[]
+\tikz
+ \shade[upper left=red,upper right=green,
+ lower left=blue,lower right=yellow]
+ (0,0) rectangle (3,2);
+\end{codeexample}
+
+ \begin{key}{/tikz/lower left=\meta{color} (initially white)}
+ Sets the color to be used in a |bilinear interpolation| shading
+ for the lower left corner. Also, this options selects this shading
+ and sets the |shade| option.
+ \end{key}
+
+ \begin{key}{/tikz/upper left=\meta{color} (initially white)}
+ Like |lower left|.
+ \end{key}
+ \begin{key}{/tikz/upper right=\meta{color} (initially white)}
+ Like |lower left|.
+ \end{key}
+ \begin{key}{/tikz/lower left=\meta{color} (initially white)}
+ Like |lower left|.
+ \end{key}
+\end{shading}
+
+
+\begin{shading}{color wheel}
+ \label{shading-color-wheel}
+ This shading fills the path with a color wheel.
+\begin{codeexample}[]
+\tikz \shade[shading=color wheel] (0,0) circle (1.5);
+\end{codeexample}
+ To produce a color ring, cut out a circle from the color wheel:
+\begin{codeexample}[]
+\tikz \shade[shading=color wheel] [even odd rule]
+ (0,0) circle (1.5)
+ (0,0) circle (1);
+\end{codeexample}
+\end{shading}
+
+
+\begin{shading}{color wheel black center}
+ This shading looks like a color wheel, but the brightness drops to
+ zero in the center.
+\begin{codeexample}[]
+\tikz \shade[shading=color wheel black center] (0,0) circle (1.5);
+\end{codeexample}
+\end{shading}
+
+
+\begin{shading}{color wheel white center}
+ This shading looks like a color wheel, but the saturation drops to
+ zero in the center.
+\begin{codeexample}[]
+\tikz \shade[shading=color wheel white center] (0,0) circle (1.5);
+\end{codeexample}
+\end{shading}
+
+
+
+\begin{shading}{Mandelbrot set}
+ This shading is just for fun. It fills the path with a zoomable
+ Mandelbrot set. Note that this is \emph{not} a bitmap
+ graphic. Rather, the Mandelbrot set is \emph{computed by the
+ \textsc{pdf} renderer} and can be zoomed arbitrarily (give it a
+ try, if you have a fast computer).
+
+\begin{codeexample}[]
+\tikz \shade[shading=Mandelbrot set] (0,0) rectangle (2,2);
+\end{codeexample}
+\end{shading}
+
+
+
+\begin{shading}{radial}
+ This always-defined shading fills the path with a gradual sweep from
+ a certain color in the middle to another color at the border. If the path is
+ a circle, the outer color will be reached exactly at the
+ border. If the shading is not a circle, the outer color will
+ continue a bit towards the corners. The default inner color is
+ gray, the default outer color is white.
+
+ \begin{key}{/tikz/inner color=\meta{color}}
+ This option sets the color used at the center of a |radial|
+ shading. When this option is used, the |shade| and |shading=radial|
+ options are set.
+
+\begin{codeexample}[]
+\tikz \draw[inner color=red] (0,0) rectangle (2,1);
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/outer color=\meta{color}}
+ This option sets the color used at the border and outside of a
+ |radial| shading.
+
+\begin{codeexample}[]
+\tikz \draw[outer color=red,inner color=white]
+ (0,0) rectangle (2,1);
+\end{codeexample}
+ \end{key}
+\end{shading}
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual-pdftex-version"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
index affa75dd8b4..4c99d465083 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
@@ -16,7 +16,7 @@
In addition to the standard shapes |rectangle|, |circle| and
|coordinate|, there exist a number of additional shapes defined in
-different shape libraries. Most of these shapes have been
+different shape libraries. Most of these shapes have been
contributed by Mark Wibrow. In the present section, these shapes are
described. Note that the library |shapes| is provided for
compatibility only. Please include sublibraries like
@@ -24,13 +24,13 @@ compatibility only. Please include sublibraries like
The appearance of shapes is influenced by numerous parameters like
|minimum height| or |inner xsep|. These general parameters are documented in
-Section~\ref{section-shape-common-options}
+Section~\ref{section-shape-common-options}
\subsection{Predefined Shapes}
\label{section-predefined-shapes}
-The three shapes |rectangle|, |circle|, and |coordiante| are always
+The three shapes |rectangle|, |circle|, and |coordinate| are always
defined and no library needs to be loaded for them. While the
|coordinate| shape defines only the |center| anchor, the other two
shapes define a standard set of anchors.
@@ -38,17 +38,17 @@ shapes define a standard set of anchors.
\begin{shape}{circle}
This shape draws a tightly fitting circle around the text. The
following figure shows the anchors this shape defines; the anchors
- |10| and |130| are example of border anchors.
+ |10| and |130| are example of border anchors.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
\node[name=s,shape=circle,shape example] {Circle\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/above, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
text/left, 10/right, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -67,11 +67,11 @@ shapes define a standard set of anchors.
\begin{tikzpicture}
\node[name=s,shape=rectangle,shape example] {Rectangle\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/above, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
text/left, 10/right, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -93,29 +93,29 @@ shapes define a standard set of anchors.
This shape is a diamond tightly fitting the text box. The ratio
between width and height is 1 by default, but can be changed by
setting the shape aspect ratio using the following \pgfname{}
- key (to use this key in \tikzname{} simply remove the
- \declare{|/pgf/|} path).
+ key (to use this key in \tikzname{} simply remove the
+ \declare{|/pgf/|} path).
\begin{key}{/pgf/aspect=\meta{value} (initially 1.0)}
- The aspect is a recommendation for the quotient of the width and
+ The aspect is a recommendation for the quotient of the width and
the height of a shape. This key calls the macro
|\pgfsetshapeaspect|.
\end{key}
-
+
The following figure shows the anchors this
shape defines; the anchors |10| and |130| are example of border
anchors.
-
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
\node[name=s,shape=diamond,shape example] {Diamond\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid/above,
- base/below,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/above, east/right,
+ mid/above,
+ base/below,
+ south west/below left, south/below, south east/below right,
text/left, 10/right, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -132,11 +132,11 @@ shapes define a standard set of anchors.
\begin{tikzpicture}
\node[name=s,shape=ellipse,shape example] {Ellipse\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/above, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
text/left, 10/right, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -151,11 +151,11 @@ shapes define a standard set of anchors.
\begin{shape}{trapezium}
This shape is a trapezium, that is, a quadrilateral with a single
pair of parallel lines (this can sometimes be known as a trapezoid).
- The trapezium shape supports the rotation of the shape border, as
- described in Section~\ref{section-rotating-shape-borders}.
-
- The lower internal angles at the lower corners of the trapezium can
- be specified independently, and the resulting extensions are in
+ The trapezium shape supports the rotation of the shape border, as
+ described in Section~\ref{section-rotating-shape-borders}.
+
+ The lower internal angles at the lower corners of the trapezium can
+ be specified independently, and the resulting extensions are in
addition to the natural dimensions of the node contents (which
includes any |inner sep|.
@@ -170,45 +170,45 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
-
- The \pgfname{} keys to set the lower internal angles of the trapezium
- are shown below.
+
+ The \pgfname{} keys to set the lower internal angles of the trapezium
+ are shown below.
To use these keys in \tikzname, simply remove the \declare{|/pgf/|} path.
\begin{key}{/pgf/trapezium left angle=\meta{angle} (initially 60)}
- Set the lower internal angle of the left side.
+ Set the lower internal angle of the left side.
\end{key}
-
+
\begin{key}{/pgf/trapezium right angle=\meta{angle} (initially 60)}
- Set the lower internal angle of the right side.
+ Set the lower internal angle of the right side.
\end{key}
-
+
\begin{stylekey}{/pgf/trapezium angle=\meta{angle}}
This key stores no value itself, but sets the value of the
- previous two keys to \meta{angle}.
+ previous two keys to \meta{angle}.
\end{stylekey}
-
+
Regardless of the rotation of the shape border, the width
and height of the trapezium are as follows:
\begin{codeexample}[]
-\begin{tikzpicture}[>=stealth, every node/.style={text=black},
+\begin{tikzpicture}[>=stealth, every node/.style={text=black},
shape border uses incircle, shape border rotate=60]
\node [trapezium, fill=gray!25, minimum width=2cm] (t) {};
- \draw [red, <->] (t.bottom left corner) -- (t.bottom right corner)
+ \draw [red, <->] (t.bottom left corner) -- (t.bottom right corner)
node [midway, below right] {width};
- \draw [red, <->] (t.top side) -- (t.bottom side)
+ \draw [red, <->] (t.top side) -- (t.bottom side)
node [at start, above] {height};
\end{tikzpicture}
\end{codeexample}
\begin{key}{/pgf/trapezium stretches=\meta{boolean} (default true)}
This key controls whether \pgfname{} allows the width and the height
- of the trapezium to be enlarged independently,
- when considering any minimum size specification. This is initially
- |false|, ensuring that the shape ``looks the same but bigger'' when
+ of the trapezium to be enlarged independently,
+ when considering any minimum size specification. This is initially
+ |false|, ensuring that the shape ``looks the same but bigger'' when
enlarged.
-
+
\begin{codeexample}[]
\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}}
\begin{tikzpicture}
@@ -217,11 +217,11 @@ shapes define a standard set of anchors.
\node [my node=green, minimum height=1.5cm] at (1, 1.25) {B};
\node [my node=blue, minimum width=1.5cm] at (2, 0) {C};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
By setting \meta{boolean} to |true|, the trapezium can be stretched
horizontally or vertically.
-
+
\begin{codeexample}[]
\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}}
\begin{tikzpicture}
@@ -235,18 +235,18 @@ shapes define a standard set of anchors.
\end{key}
\begin{key}{/pgf/trapezium stretches body=\meta{boolean} (default true)}
- This is similar to the |trapezium stretches| key execept that
- when \meta{boolean} is |true|, \pgfname{} enlarges only the body
+ This is similar to the |trapezium stretches| key except that
+ when \meta{boolean} is |true|, \pgfname{} enlarges only the body
of the trapezium when applying minimum width.
-
+
\begin{codeexample}[]
\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}}
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\node [my node=red] at (1.5,.25) {A};
- \node [my node=green, minimum width=3cm, trapezium stretches]
+ \node [my node=green, minimum width=3cm, trapezium stretches]
at (1.5,1) {B};
- \node [my node=blue, minimum width=3cm, trapezium stretches body]
+ \node [my node=blue, minimum width=3cm, trapezium stretches body]
at (1.5,1.75) {C};
\end{tikzpicture}
\end{codeexample}
@@ -258,41 +258,41 @@ shapes define a standard set of anchors.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=trapezium, shape example, inner sep=1cm]
+ \node[name=s, shape=trapezium, shape example, inner sep=1cm]
{Trapezium\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {bottom left corner/below, top right corner/right,
+ {bottom left corner/below, top right corner/right,
top left corner/left, bottom right corner/below,
- bottom side/below, left side/left,
+ bottom side/below, left side/left,
right side/right, top side/above,
- center/above, text/below, mid/right, base/below,
- mid west/right, base west/below, mid east/left, base east/below,
+ center/above, text/below, mid/right, base/below,
+ mid west/right, base west/below, mid east/left, base east/below,
west/above, east/above, north/below, south/above,
- north west/above, north east/above,
- south west/below, south east/below, 160/above}
+ north west/above, north east/above,
+ south west/below, south east/below, 160/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{shape}
\begin{shape}{semicircle}
This shape is a semicircle, which tightly fits the node contents.
- This shape supports the rotation of the shape border, as described in
+ This shape supports the rotation of the shape border, as described in
Section~\ref{section-rotating-shape-borders}.
- The anchors for the |semicircle| shape are shown below.
+ The anchors for the |semicircle| shape are shown below.
Anchor |30| is an example of a border anchor.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm]
+ \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm]
{Semicircle\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{apex/above, arc start/below, arc end/below, chord center/below,
center/above, base/below, mid/right, text/left,
- base west/below, base east/below, mid west/left, mid east/right,
+ base west/below, base east/below, mid west/left, mid east/right,
north/below, south/above, east/above, west/above,
north west/above left, north east/above right,
south west/below, south east/below, 30/right}
@@ -307,27 +307,27 @@ shapes define a standard set of anchors.
\begin{shape}{regular polygon}
- This shape is a regular polygon, which, by default, is drawn so that
- a side (rather than a corner) is always at the bottom.
- This shape supports the rotation as described in
- Section~\ref{section-rotating-shape-borders}, but the border of the
+ This shape is a regular polygon, which, by default, is drawn so that
+ a side (rather than a corner) is always at the bottom.
+ This shape supports the rotation as described in
+ Section~\ref{section-rotating-shape-borders}, but the border of the
polygon is \emph{always} constructed using the incircle, whose
radius is calculated to tightly fit the node contents (including
any |inner sep|).
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \a in {3,...,7}{
\draw[red, dashed] (\a*2,0) circle(0.5cm);
\node[regular polygon, regular polygon sides=\a, draw,
inner sep=0.3535cm] at (\a*2,0) {};
- }
+ }
\end{tikzpicture}
\end{codeexample}
- If the node is enlarged to any specified minimum size,
- this is interpreted as the diameter of the the
- circumcircle, that is, the circle that passes through all the
+ If the node is enlarged to any specified minimum size,
+ this is interpreted as the diameter of the
+ circumcircle, that is, the circle that passes through all the
corners of the polygon border.
\begin{codeexample}[]
@@ -335,7 +335,7 @@ shapes define a standard set of anchors.
\foreach \a in {3,...,7}{
\draw[blue, dashed] (\a*2,0) circle(0.5cm);
\node[regular polygon, regular polygon sides=\a, minimum size=1cm, draw] at (\a*2,0) {};
- }
+ }
\end{tikzpicture}
\end{codeexample}
@@ -345,18 +345,18 @@ shapes define a standard set of anchors.
\begin{key}{/pgf/regular polygon sides=\meta{integer} (initially 5)}
\end{key}
-
- The anchors for a regular polygon shape are shown below.
+
+ The anchors for a regular polygon shape are shown below.
The anchor |75| is an example of a border anchor.
-
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=regular polygon, shape example, inner sep=.5cm]
+ \node[name=s, shape=regular polygon, shape example, inner sep=.5cm]
{Regular Polygon\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {corner 1/above, corner 2/above, corner 3/left, corner 4/right, corner 5/above,
- side 1/above, side 2/left, side 3/below, side 4/right, side 5/above,
+ {corner 1/above, corner 2/above, corner 3/left, corner 4/right, corner 5/above,
+ side 1/above, side 2/left, side 3/below, side 4/right, side 5/above,
center/above, text/left, mid/right, base/below, 75/above,
west/above, east/above, north/below, south/above,
north east/below, south east/above, north west/below, south west/above}
@@ -369,45 +369,45 @@ shapes define a standard set of anchors.
\begin{shape}{star}
This shape is a star, which by default (minus any transformations) is
- drawn with the first point pointing upwards.
- This shape supports the rotation as described in
- Section~\ref{section-rotating-shape-borders}, but the border of the
+ drawn with the first point pointing upwards.
+ This shape supports the rotation as described in
+ Section~\ref{section-rotating-shape-borders}, but the border of the
star is \emph{always} constructed using the incircle.
-
- A star should be thought of as having an set of ``inner points'' and
- and ``outer points''.
+
+ A star should be thought of as having an set of ``inner points''
+ and ``outer points''.
The inner points of the border are based on the radius of the circle
which tightly fits the node contents, and the outer points are based
on the circumcircle, the circle that passes through every outer
point.
- Any specified minimum size, width or height, is interpreted as the
+ Any specified minimum size, width or height, is interpreted as the
diameter of the circumcircle.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
\draw [blue, dashed] (1,1) circle(1cm);
\draw [red, dashed] (1,1) circle(.5cm);
- \node [star, star point height=.5cm, minimum size=2cm, draw]
+ \node [star, star point height=.5cm, minimum size=2cm, draw]
at (1,1) {S};
\end{tikzpicture}
-\end{codeexample}
-
+\end{codeexample}
+
The \pgfname{} keys to set the number of star points, and the height
of the star points, are shown below. To use these keys in \tikzname,
simply remove the \declare{|/pgf/|} path.
-
+
\begin{key}{/pgf/star points=\meta{integer} (initially 5)}
Sets the number of points for the star.
\end{key}
-
+
\begin{key}{/pgf/star point height=\meta{distance} (initially .5cm)}
Sets the height of the star points. This is the distance between the
inner point and outer point radii. If the star is enlarged to some
specified minimum size, the inner radius is increased to maintain
the point height.
\end{key}
-
+
\begin{key}{/pgf/star point ratio=\meta{number} (initially 1.5)}
Sets the ratio between the inner point and outer point radii.
If the star is enlarged to some specified minimum size, the
@@ -416,15 +416,15 @@ shapes define a standard set of anchors.
The inner and outer points form the principle anchors for the star,
as shown below (anchor |75| is an example of a border anchor).
-
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm]
+ \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm]
{Star\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {inner point 1/above, inner point 2/above, inner point 3/below, inner point 4/right,
- inner point 5/above, outer point 1/above, outer point 2/above, outer point 3/left,
+ {inner point 1/above, inner point 2/above, inner point 3/below, inner point 4/right,
+ inner point 5/above, outer point 1/above, outer point 2/above, outer point 3/left,
outer point 4/right, outer point 5/above,
center/above, text/left, mid/right, base/below, 75/above,
west/above, east/above, north/below, south/above,
@@ -440,12 +440,12 @@ shapes define a standard set of anchors.
\begin{shape}{isosceles triangle}
- This shape is an isosceles triangle, which supports the rotation of
- the shape border, as described in
+ This shape is an isosceles triangle, which supports the rotation of
+ the shape border, as described in
Section~\ref{section-rotating-shape-borders}. The angle of rotation
determines the direction in which the apex of the triangle points
(provided no other transformations are applied). However, regardless
- of the rotation of the shape border, the width and height are
+ of the rotation of the shape border, the width and height are
always considered as follows:
\begin{codeexample}[]
@@ -459,24 +459,24 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- There are \pgfname{} keys to customise this shape.
- To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
+ There are \pgfname{} keys to customize this shape.
+ To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
path.
-
+
\begin{key}{/pgf/isosceles triangle apex angle=\meta{angle} (initially 45)}
- Sets the angle of the apex of the isosceles triangle.
+ Sets the angle of the apex of the isosceles triangle.
\end{key}
\begin{key}{/pgf/isosceles triangle stretches=\meta{boolean} (default true)}
-
+
By default \meta{boolean} is |false|. This means, that when applying
- any minimum width or minimum height requirements, increasing the
+ any minimum width or minimum height requirements, increasing the
height will increase the width (and vice versa), in order to keep the
apex angle the same.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}]
- \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt,
+ \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt,
anchor=left corner, shape border rotate=90}}
\draw[help lines] grid(4,2);
\foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{
@@ -486,12 +486,12 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- However, by setting \meta{boolean} to |true|, minimum width and
+ However, by setting \meta{boolean} to |true|, minimum width and
height can be applied independently.
\begin{codeexample}[]
\begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}]
- \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt,
+ \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt,
anchor=south, shape border rotate=90, isosceles triangle stretches}}
\draw[help lines] grid(4,2);
\foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{
@@ -502,10 +502,10 @@ shapes define a standard set of anchors.
\end{codeexample}
\end{key}
- The anchors for the |isosceles triangle| are shown below
+ The anchors for the |isosceles triangle| are shown below
(anchor |150| is an example of a border anchor). Note that,
somewhat confusingly, the anchor names such as |left side| and
- |right corner| are named as if the triangle is rotated to
+ |right corner| are named as if the triangle is rotated to
90 degrees. Note also that the |center| anchor
does not necessarily correspond to any kind of geometric center.
@@ -516,17 +516,17 @@ shapes define a standard set of anchors.
{Isosceles Triangle\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{apex/above, left corner/right, right corner/right,
- left side/above, right side/below, lower side/right,
+ left side/above, right side/below, lower side/right,
center/above, text/right, 150/above,
mid/right, mid west/above, mid east/right,
base/below, base west/below, base east/below,
west/above, east/below, north/below, south/above,
- north west/below, north east/below,
- south west/above, south east/above}
+ north west/below, north east/below,
+ south west/above, south east/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{shape}
@@ -537,11 +537,11 @@ shapes define a standard set of anchors.
\par\leavevmode
\begin{shape}{kite}
- This shape is a kite, which supports the rotation of the shape border,
- as described in Section~\ref{section-rotating-shape-borders}.
+ This shape is a kite, which supports the rotation of the shape border,
+ as described in Section~\ref{section-rotating-shape-borders}.
There are \pgfname{} keys to specify the upper and lower vertex angles
- of the kite.
- To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
+ of the kite.
+ To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
path.
\begin{key}{/pgf/kite upper vertex angle=\meta{angle} (initially 120)}
@@ -557,10 +557,10 @@ shapes define a standard set of anchors.
(it stores no value itself).
\meta{angle specification} can be pair of angles in the form
\meta{upper angle} |and| \meta{lower angle}, or a single angle.
- In this latter case, both the upper and lower vertex angles will
+ In this latter case, both the upper and lower vertex angles will
be the same.
\end{key}%
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\tikzstyle{every node}=[kite, draw]
@@ -571,23 +571,23 @@ shapes define a standard set of anchors.
\end{codeexample}
- The anchors for the |kite| are shown below. Anchor |110| is an
+ The anchors for the |kite| are shown below. Anchor |110| is an
example of a border anchor.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=kite, shape example, inner sep=1.5cm]
+ \node[name=s, shape=kite, shape example, inner sep=1.5cm]
{Kite\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {upper vertex/above, left vertex/above, lower vertex/below,
+ {upper vertex/above, left vertex/above, lower vertex/below,
right vertex/above, upper left side/above, upper right side/above,
lower left side/below, lower right side/below,
- center/above, text/left, mid/right, base/below,
+ center/above, text/left, mid/right, base/below,
mid west/left, base west/below, mid east/right, base east/below,
west/above, east/above, north/below, south/above,
- north west/left, north east/right,
- south west/above, south east/above, 110/above}
+ north west/left, north east/right,
+ south west/above, south east/above, 110/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
@@ -599,20 +599,20 @@ shapes define a standard set of anchors.
This shape is a dart (which can also be known as an arrowhead or
- concave kite). This shape supports the rotation of the shape border,
- as described in Section~\ref{section-rotating-shape-borders}.
- The angle of the border rotation determines the direction in which
+ concave kite). This shape supports the rotation of the shape border,
+ as described in Section~\ref{section-rotating-shape-borders}.
+ The angle of the border rotation determines the direction in which
the dart points (unless other transformations have been applied).
- There are \pgfname{} keys to set the
+ There are \pgfname{} keys to set the
angle for the `tip' of the dart and the angle between the `tails'
- of the dart.
- To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
+ of the dart.
+ To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
path.
\begin{codeexample}[]
\begin{tikzpicture}
- \node[dart, draw, gray, shape border uses incircle, shape border rotate=45]
+ \node[dart, draw, gray, shape border uses incircle, shape border rotate=45]
(d) {dart};
\draw [<->] (d.tip)++(202.5:.5cm) arc(202.5:247.5:.5cm);
\node [left=.5cm] at (d.tip) {tip angle};
@@ -629,22 +629,22 @@ shapes define a standard set of anchors.
Set the angle between the tails of the dart.
\end{key}
- The anchors for the |dart| shape are shown below (note that the
- shape is rotated 90 degrees anti-clockwise). Anchor |110| is an
+ The anchors for the |dart| shape are shown below (note that the
+ shape is rotated 90 degrees anti-clockwise). Anchor |110| is an
example of a border anchor.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm]
+ \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm]
{Dart\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {tip/above, tail center/below, right tail/below,
+ {tip/above, tail center/below, right tail/below,
left tail/below, right tail/below, left side/left, right side/right,
- center/above, text/left, mid/right, base/below,
+ center/above, text/left, mid/right, base/below,
mid west/left, base west/below, mid east/right, base east/below,
west/above, east/above, north/below, south/above,
north west/left, north east/right, south west/above, south east/above,
- 110/above}
+ 110/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
@@ -658,10 +658,10 @@ shapes define a standard set of anchors.
This shape is a circular sector (which can also be known as a
wedge).
- This shape supports the rotation of the shape border,
- as described in Section~\ref{section-rotating-shape-borders}.
- The angle of the border rotation determines the direction in which
- the `apex' of the sector points (unless other transformations have
+ This shape supports the rotation of the shape border,
+ as described in Section~\ref{section-rotating-shape-borders}.
+ The angle of the border rotation determines the direction in which
+ the `apex' of the sector points (unless other transformations have
been applied).
\begin{codeexample}[]
@@ -672,13 +672,13 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- There is a \pgfname{} key to set the central angle of the sector,
- which is expected to be less than 180 degrees.
- To use this key in \tikzname, simply remove the \declare{|/pgf/|}
+ There is a \pgfname{} key to set the central angle of the sector,
+ which is expected to be less than 180 degrees.
+ To use this key in \tikzname, simply remove the \declare{|/pgf/|}
path.
\begin{key}{/pgf/circular sector angle=\meta{angle} (initially 60)}
- Set the central angle of the sector.
+ Set the central angle of the sector.
\end{key}
The anchors for the circular sector shape are shown below.
@@ -687,7 +687,7 @@ shapes define a standard set of anchors.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=circular sector, style=shape example, inner sep=1cm]
+ \node[name=s,shape=circular sector, style=shape example, inner sep=1cm]
{Circular Sector\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{sector center/above, arc start/below, arc end/below, arc center/below,
@@ -705,7 +705,7 @@ shapes define a standard set of anchors.
\begin{shape}{cylinder}
- This shape is a 2-dimensional representation of a cylinder, which
+ This shape is a 2-dimensional representation of a cylinder, which
supports the rotation of the shape border as described in
Section~\ref{section-rotating-shape-borders}.
@@ -717,34 +717,34 @@ shapes define a standard set of anchors.
Regardless the rotation of the shape border, the height is always the
distance between the curved ends, and the width is always the
- distance between the straight sides.
+ distance between the straight sides.
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
- \node [cylinder, gray!50, rotate=30, draw,
+ \node [cylinder, gray!50, rotate=30, draw,
minimum height=2cm, minimum width=1cm] (c) {Cylinder};
- \draw[red, <->] (c.top) -- (c.bottom)
+ \draw[red, <->] (c.top) -- (c.bottom)
node [at end, below, black] {height};
- \draw[red, <->] (c.north) -- (c.south)
+ \draw[red, <->] (c.north) -- (c.south)
node [at start, above, black] {width};
\end{tikzpicture}
\end{codeexample}
Enlarging the shape to some minimum height will stretch only the body
- of the cylinder. By contrast, enlarging the shape to some minimum
+ of the cylinder. By contrast, enlarging the shape to some minimum
width will stretch the curved ends.
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth, shape aspect=.5]
\tikzset{every node/.style={cylinder, shape border rotate=90, draw}}
- \node [minimum height=1.5cm] {A};
- \node [minimum width=1.5cm] at (1.5,0) {B};
+ \node [minimum height=1.5cm] {A};
+ \node [minimum width=1.5cm] at (1.5,0) {B};
\end{tikzpicture}
\end{codeexample}
There are various keys to customize this shape (to use \pgfname{}
keys in \tikzname{}, simply remove the \declare{|/pgf/|} path).
-
+
\begin{key}{/pgf/aspect=\meta{value} (initially 1.0)}
The aspect is a recommendation for the quotient of the radii of
the cylinder end. This may be ignored if the shape is enlarged
@@ -753,27 +753,27 @@ shapes define a standard set of anchors.
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\tikzset{every node/.style={cylinder, shape border rotate=90, draw}}
- \node [aspect=1.0] {A};
- \node [aspect=0.5] at (1,0) {B};
- \node [aspect=0.25] at (2,0) {C};
+ \node [aspect=1.0] {A};
+ \node [aspect=0.5] at (1,0) {B};
+ \node [aspect=0.25] at (2,0) {C};
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/pgf/cylinder uses custom fill=\meta{boolean} (default true)}
- This enables the use of a custom fill for the body and the end of
- the cylinder. The background path for the shape should not be
- filled (e.g., in \tikzname{}, the |fill| option for the node must
+ This enables the use of a custom fill for the body and the end of
+ the cylinder. The background path for the shape should not be
+ filled (e.g., in \tikzname{}, the |fill| option for the node must
be implicity or explicitly set to |none|).
- Internally, this key sets the \TeX-if
+ Internally, this key sets the \TeX-if
|\ifpgfcylinderusescustomfill| appropriately.
\end{key}
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth, aspect=0.5]
\node [cylinder, cylinder uses custom fill, cylinder end fill=red!50,
- cylinder body fill=red!25] {Cylinder};
+ cylinder body fill=red!25] {Cylinder};
\end{tikzpicture}
\end{codeexample}
@@ -786,14 +786,14 @@ shapes define a standard set of anchors.
The anchors this shape are shown below (anchor |160| is an
- example of a border anchor). Note the the cylinder shape does not
- distinguish between |outer xsep| and |outer ysep|. Only the larger
- of the two values is used for the shape. Note also the difference
+ example of a border anchor). Note the cylinder shape does not
+ distinguish between |outer xsep| and |outer ysep|. Only the larger
+ of the two values is used for the shape. Note also the difference
between the |center| and |shape center| anchors: |center| is the
- center of the cylinder body and also the center of rotation.
- The |shape center| is the center of the shape which includes the
+ center of the cylinder body and also the center of rotation.
+ The |shape center| is the center of the shape which includes the
2-dimensional representation of the cylinder top.
-
+
\begin{codeexample}[]
\Huge
@@ -803,16 +803,16 @@ shapes define a standard set of anchors.
\foreach \anchor/\placement in
{before top/above, top/above, after top/below,
before bottom/below, bottom/above, after bottom/above,
- mid/right, mid west/right, mid east/left,
+ mid/right, mid west/right, mid east/left,
base/below, base west/below, base east/below,
- center/above, text/above, shape center/right,
+ center/above, text/above, shape center/right,
west/right, east/left, north/above, south/below,
- north west/below, north east/above,
- south west/above, south east/below, 160/above}
+ north west/below, north east/above,
+ south west/above, south east/below, 160/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{shape}
@@ -836,38 +836,44 @@ shapes define a standard set of anchors.
lower left to the upper right added. The circle is part of the
background, the diagonal line part of the foreground path; thus, the
diagonal line is on top of the text.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node [forbidden sign,line width=1ex,draw=red,fill=white] {Smoking};
\end{tikzpicture}
\end{codeexample}
- The shape inherits all anchors from the |circle| shape, see also the
- following figure:
+ The shape inherits all anchors from the |circle| shape.
+\end{shape}
+
+
+\begin{shape}{magnifying glass}
+ This shape places the node inside a circle with a handle attached to
+ the node. The angle of the handle and its length can be adjusted
+ using two keys:
+
+ \begin{key}{/pgf/magnifying glass handle angle fill=\meta{degree} (default -45)}
+ The angle of the handle.
+ \end{key}
+
+ \begin{key}{/pgf/magnifying glass handle angle aspect=\meta{factor} (default 1.5)}
+ The length of the handle as a multiple of the circle radius.
+ \end{key}
+
\begin{codeexample}[]
-\Huge
\begin{tikzpicture}
- \node[name=s,shape=forbidden sign,shape example] {Forbidden\vrule width 1pt height 2cm};
- \foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
- text/left, 10/right, 130/above}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+ \node [magnifying glass,line width=1ex,draw] {huge};
\end{tikzpicture}
\end{codeexample}
+ The shape inherits all anchors from the |circle| shape.
\end{shape}
\begin{shape}{cloud}
- This shape is a cloud, drawn to tightly fit the node contents
+ This shape is a cloud, drawn to tightly fit the node contents
(strictly speaking, using an ellipse which tightly fits the node
- contents -- including any |inner sep|).
+ contents -- including any |inner sep|).
\begin{codeexample}[]
\begin{tikzpicture}
@@ -878,7 +884,7 @@ shapes define a standard set of anchors.
A cloud should be thought of as having a number of ``puffs'', which
are the individual arcs drawn around the border. There are \pgfname{}
- keys to specify how the cloud is drawn (to use these keys in
+ keys to specify how the cloud is drawn (to use these keys in
\tikzname{}, simply remove the \declare{|/pgf/|} path).
\begin{key}{/pgf/cloud puffs=\meta{integer} (initially 10)}
@@ -886,13 +892,13 @@ shapes define a standard set of anchors.
\end{key}
\begin{key}{/pgf/cloud puff arc=\meta{angle} (initially 135)}
- Set the length of the puff arc (in degrees). A shorter arc can
+ Set the length of the puff arc (in degrees). A shorter arc can
produce better looking joins between puffs for larger line widths.
\end{key}
- Like the diamond shape, the cloud shape also uses the
- \declare{|aspect|} key, to determine the ratio of the width and the
- height of the cloud. However there may be cirumstances where it may
+ Like the diamond shape, the cloud shape also uses the
+ \declare{|aspect|} key, to determine the ratio of the width and the
+ height of the cloud. However there may be circumstances where it may
be undesirable to continually specify the |aspect| for the cloud.
Therefore, the following key is implemented:
@@ -913,39 +919,39 @@ shapes define a standard set of anchors.
Any minimum size requirements are applied to the ``circum-ellipse'',
which is the ellipse which passes through all the midpoints of the
- puff arcs. These requirements are considered \emph{after} any
+ puff arcs. These requirements are considered \emph{after} any
aspect specification is applied.
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
\draw [blue, dashed] (1.5, 1) ellipse (1.5cm and 1cm);
- \node [cloud, cloud puffs=9, draw, minimum width=3cm, minimum height=2cm]
+ \node [cloud, cloud puffs=9, draw, minimum width=3cm, minimum height=2cm]
at (1.5, 1) {};
\end{tikzpicture}
\end{codeexample}
The anchors for the cloud shape are shown below for a cloud with
- eleven puffs. Anchor 70 is an example of a border anchor.
-
+ eleven puffs. Anchor 70 is an example of a border anchor.
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
\node[name=s, shape=cloud, style=shape example, cloud puffs=11, aspect=1.5,
cloud puff arc=120,inner ysep=1cm] {Cloud\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {puff 1/above, puff 2/above, puff 3/above, puff 4/below,
+ {puff 1/above, puff 2/above, puff 3/above, puff 4/below,
puff 5/left, puff 6/below, puff 7/below, puff 8/right,
puff 9/below, puff 10/above, puff 11/above, 70/right,
- center/above, base/below, mid/right, text/left,
+ center/above, base/below, mid/right, text/left,
north/below, south/below, east/above, west/above,
- north west/left, north east/right,
+ north west/left, north east/right,
south west/below, south east/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-\end{shape}
+\end{shape}
@@ -954,9 +960,9 @@ shapes define a standard set of anchors.
\begin{shape}{starburst}
- This shape is a randomly generated eliptical star,
- which supports the rotating of the shape border as described in
- Section~\ref{section-rotating-shape-borders}.
+ This shape is a randomly generated elliptical star,
+ which supports the rotating of the shape border as described in
+ Section~\ref{section-rotating-shape-borders}.
\begin{codeexample}[]
\begin{tikzpicture}
\node[starburst, fill=yellow, draw=red, line width=2pt] {\bf BANG!};
@@ -967,52 +973,52 @@ shapes define a standard set of anchors.
which tightly fits the node contents (including any |inner sep|).
Using a specified `starburst point height' value, the outer points
- are generated randomly between this value and one quarter of this
- value. For a given starburst shape the angle between each point is
+ are generated randomly between this value and one quarter of this
+ value. For a given starburst shape the angle between each point is
fixed, and is determined by the number of points specified for
the starburst.
- It is important to note that, whilst the maximum possible point
- height is used to calculate minimum width or height requirements,
- the outer points are randomly generated, so there is (unfortunately)
- no guarantee that any such requirements will be fully met.
+ It is important to note that, whilst the maximum possible point
+ height is used to calculate minimum width or height requirements,
+ the outer points are randomly generated, so there is (unfortunately)
+ no guarantee that any such requirements will be fully met.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] grid(3,2);
- \node[starburst, draw, minimum width=3cm, minimum height=2cm]
+ \node[starburst, draw, minimum width=3cm, minimum height=2cm]
at (1.5, 1) {\bf BOOM!};
\end{tikzpicture}
\end{codeexample}
There are \pgfname{} keys to control the drawing of the starburst
- shape. To use these keys in \tikzname, simply remove the
+ shape. To use these keys in \tikzname, simply remove the
\declare{|/pgf/|} path.
\begin{key}{/pgf/starburst points=\meta{integer} (initially 17)}
Set the number of points for the starburst.
\end{key}
\begin{key}{/pgf/starburst point height=\meta{length} (initially .5cm)}
- Set the \emph{maximum} distance between the inner point radius
+ Set the \emph{maximum} distance between the inner point radius
and the outer point radius.
\end{key}
\begin{key}{/pgf/random starburst=\meta{integer} (initially 100)}
Set the seed for the random number generator for creating the
starburst. The maximum value for \meta{integer} is |16383|.
- If \meta{integer}|=0|, the random number generator will not be
- used, and the maximum point height will be used for all outer
+ If \meta{integer}|=0|, the random number generator will not be
+ used, and the maximum point height will be used for all outer
points. If \meta{integer} is omitted, a seed will be randomly
chosen.
\end{key}
- The basic anchors for a nine point |starburst| shape are shown below.
+ The basic anchors for a nine point |starburst| shape are shown below.
Anchor |80| is an example of a border anchor.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm,
- style=shape example,inner sep=1cm]
+ \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm,
+ style=shape example,inner sep=1cm]
{Starburst\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{outer point 1/above, outer point 2/above, outer point 3/right,
@@ -1033,13 +1039,14 @@ shapes define a standard set of anchors.
\begin{shape}{signal}
This shape is a ``signal'' or sign shape, that is, a rectangle, with
- optionally pointed sides. A signal can point ``to'' somewhere, with
- outward points in that direction. It can also be ``from''
- somewhere, with inward points from that direction. The resulting
+ optionally pointed sides. A signal can point ``to'' somewhere, with
+ outward points in that direction. It can also be ``from''
+ somewhere, with inward points from that direction. The resulting
points extend the node contents (which include the |inner sep|).
\begin{codeexample}[]
-\begin{tikzpicture}[every node/.style={signal, draw, text=white}]
+\begin{tikzpicture}
+ [every node/.style={signal, draw, text=white, signal to=nowhere}]
\node[fill=green!65!black, signal to=east] at (0,1) {To East};
\node[fill=red!65!black, signal from=east] at (0,0) {From East};
\end{tikzpicture}
@@ -1048,34 +1055,34 @@ shapes define a standard set of anchors.
There are \pgfname{} keys for drawing the signal shape (to use these
keys in \tikzname{}, simply remove the \declare{|/pgf/|} path):
- \begin{key}{/pgf/signal pointer angle=\meta{angle} (initially 90)}
+ \begin{key}{/pgf/signal pointer angle=\meta{angle} (initially 90)}
Set the angle for the pointed sides of the shape. This angle is
maintained when enforcing any minimum size requirements, so
any adjustment to the width will affect the height, and vice versa.
\end{key}
- \begin{key}{/pgf/signal from=\meta{direction}\space\opt{and \meta{opposite direction}} (initially nowhere)}
+ \begin{key}{/pgf/signal from=\meta{direction}\space\opt{and \meta{opposite direction}} (initially nowhere)}
Set which sides take an inward pointer (i.e., that points towards the
- center of the shape). The possible values for \meta{direction} and
- \meta{opposide direction} are the compass point directions |north|,
+ center of the shape). The possible values for \meta{direction} and
+ \meta{opposite direction} are the compass point directions |north|,
|south|, |east| and |west| (or |above|, |below|, |right| and |left|).
- An additional keyword |nowhere| can be used to reset the sides so
- they have no pointers. When used with |signal from| key, this only
- resets inward pointers; used with the |signal to| key, it only
- resets outward pointers.
+ An additional keyword |nowhere| can be used to reset the sides so
+ they have no pointers. When used with |signal from| key, this only
+ resets inward pointers; used with the |signal to| key, it only
+ resets outward pointers.
\end{key}
- \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)}
- Set which sides take an outward pointer (i.e., that points away from
- the the shape).
+ \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)}
+ Set which sides take an outward pointer (i.e., that points away from
+ the the shape).
\end{key}
Note that \pgfname{} will ignore any instruction to use directions
that are not opposites (so using the value |east and north|, will
- result in only |north| being assigned a pointer). This is also
+ result in only |north| being assigned a pointer). This is also
the case if non-opposite values are used in the |signal to| and
- |signal from| keys at the same time. So, for example, it is not
+ |signal from| keys at the same time. So, for example, it is not
possible for a signal to have an outward point to the left, and also
have an inward point from below.
@@ -1085,15 +1092,15 @@ shapes define a standard set of anchors.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm]
+ \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm]
{Signal\vrule width1pt height2cm};
\foreach \anchor/\placement in
{text/left, center/above, 70/above,
base/below, base east/below, base west/below,
- mid/right, mid east/above left, mid west/above left,
- north/above, south/below,
- east/above, west/above,
- north west/above, north east/above,
+ mid/right, mid east/above left, mid west/above left,
+ north/above, south/below,
+ east/above, west/above,
+ north west/above, north east/above,
south west/below, south east/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -1108,7 +1115,7 @@ shapes define a standard set of anchors.
\begin{shape}{tape}
This shape is a rectangle with optional, ``bendy'' top and bottom
- sides, which tightly fits the node contents (including the
+ sides, which tightly fits the node contents (including the
|inner sep|).
\begin{codeexample}[]
@@ -1121,38 +1128,38 @@ shapes define a standard set of anchors.
There are \pgfname{} keys to specify which sides bend and how high
the bends are (to use these keys in \tikzname{}, simply remove the
\declare{|/pgf/|} path):
-
+
\begin{key}{/pgf/tape bend top=\meta{bend style} (initially in and out)}
Specify how the top side bends. The \meta{bend style} is either
- |in and out|, |out and in| or |none| (i.e., a straight line).
- The bending sides are drawn in a
- clockwise direction, and using the bend style |in and out| will mean
- the side will first bend inwards and then bend outwards.
- The opposite holds true for |out and in|.
+ |in and out|, |out and in| or |none| (i.e., a straight line).
+ The bending sides are drawn in a
+ clockwise direction, and using the bend style |in and out| will mean
+ the side will first bend inwards and then bend outwards.
+ The opposite holds true for |out and in|.
\begin{codeexample}[]
\begin{tikzpicture}[-stealth]
\node[tape, draw, gray, minimum width=2cm](t){Tape};
- \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east)
+ \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east)
node[midway, above, black]{in and out};
- \draw [blue]([yshift=-5pt]t.south east) -- ([yshift=-5pt]t.south west)
+ \draw [blue]([yshift=-5pt]t.south east) -- ([yshift=-5pt]t.south west)
node[sloped, allow upside down, midway, above, black]{in and out};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
- This might take a bit of getting used to, but just remember that
- when you want the bendy sides to be parallel, the sides take the
- same bend style. It is possible for the top and bottom sides to
- take opposite bend styles, but the author of this shape cannot
+ This might take a bit of getting used to, but just remember that
+ when you want the bendy sides to be parallel, the sides take the
+ same bend style. It is possible for the top and bottom sides to
+ take opposite bend styles, but the author of this shape cannot
think of a single use for such a combination.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\tikzstyle{every node}=[tape, draw]
\node [tape bend top=out and in, tape bend bottom=out and in] {Parallel};
\node at (2,0) [tape bend bottom=out and in] {Why?};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{key}
@@ -1168,28 +1175,28 @@ shapes define a standard set of anchors.
\draw [help lines] grid(3,2);
\node [tape, fill, minimum size=2cm, red!50, tape bend top=none,
tape bend height=1cm] at (1.5,1.5) (t) {};
- \draw [|<->|, blue] (1.5,0) -- (1.5,1)
+ \draw [|<->|, blue] (1.5,0) -- (1.5,1)
node [at end, above, black]{tape bend height};
\end{tikzpicture}
-\end{codeexample}
-
+\end{codeexample}
+
\end{key}
The anchors for the tape shape are shown below. Anchor |60| is an
example of a border anchor. Note that border anchors will snap to
- the center of convex curves (i.e. when bending in).
+ the center of convex curves (i.e. when bending in).
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm]
+ \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm]
{Tape\vrule width1pt height2cm};
\foreach \anchor/\placement in
- {text/left, center/above, 60/above,
+ {text/left, center/above, 60/above,
base/below, base east/below, base west/below,
- mid/right, mid east/left, mid west/right,
- north/above, south/below, east/above, west/above,
- north west/above, north east/above,
+ mid/right, mid east/left, mid west/right,
+ north/above, south/below, east/above, west/above,
+ north west/above, north east/above,
south west/below, south east/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -1210,10 +1217,10 @@ shapes define a standard set of anchors.
\end{pgflibrary}
\begin{shape}{single arrow}
- This shape is an arrow, which tightly fits the note contents
- (including any |inner sep|).
- This shape supports the rotation of the shape border, as
- described in Section~\ref{section-rotating-shape-borders}.
+ This shape is an arrow, which tightly fits the note contents
+ (including any |inner sep|).
+ This shape supports the rotation of the shape border, as
+ described in Section~\ref{section-rotating-shape-borders}.
The angle of rotation determines which direction the arrow
points (provided no other rotational transformations are applied).
@@ -1226,15 +1233,15 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- Regardless of the rotation of the arrow border, the width is
- measured between the back ends of the arrow head, and the
- height is measured from the arrow tip to the end of the arrow
+ Regardless of the rotation of the arrow border, the width is
+ measured between the back ends of the arrow head, and the
+ height is measured from the arrow tip to the end of the arrow
tail.
\begin{codeexample}[]
-\begin{tikzpicture}[>=stealth,
+\begin{tikzpicture}[>=stealth,
rotate border/.style={shape border uses incircle, shape border rotate=#1}]
- \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow,
+ \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow,
single arrow head extend=.5cm, single arrow head indent=.25cm] (arrow) {};
\draw[red, <->] (arrow.before tip) -- (arrow.after tip)
node [near end, left, black] {width};
@@ -1249,7 +1256,7 @@ shapes define a standard set of anchors.
\begin{key}{/pgf/single arrow tip angle=\meta{angle} (initially 90)}
Set the angle for the arrow tip. Enlarging the arrow to some
- minimum width may increase the the height of the shape to maintain
+ minimum width may increase the height of the shape to maintain
this angle.
\end{key}
@@ -1257,12 +1264,12 @@ shapes define a standard set of anchors.
This sets the distance between the tail of the arrow and the outer
end of the arrow head. This may change if the shape is enlarged to
some minimum width.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
- \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60]
+ \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60]
(a) {Arrow};
- \draw[red, |<->|] (a.before tip) -- (a.before head)
+ \draw[red, |<->|] (a.before tip) -- (a.before head)
node [midway, below, sloped, black] {head extend};
\end{tikzpicture}
\end{codeexample}
@@ -1271,7 +1278,7 @@ shapes define a standard set of anchors.
\begin{key}{/pgf/single arrow head indent=\meta{length} (initially 0cm)}
This moves the point where the arrow head joins the shaft of the
arrow \emph{towards} the arrow tip, by \meta{length}.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={single arrow, draw=none, rotate=60}]
\node [fill=red!50] {arrow 1};
@@ -1280,22 +1287,22 @@ shapes define a standard set of anchors.
\end{codeexample}
\end{key}
- The anchors for this shape are shown below (anchor |20| is an
+ The anchors for this shape are shown below (anchor |20| is an
example of a border anchor).
-
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm]
+ \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm]
{Single Arrow\vrule width1pt height2cm};
\foreach \anchor/\placement in
{text/above, center/above, 20/above,
mid west/left, mid/above, mid east/above left,
base west/below, base/below, base east/below,
- tip/above, before tip/above, after tip/below, before head/above,
- after head/below, after tail/above, before tail/below, tail/right,
+ tip/above, before tip/above, after tip/below, before head/above,
+ after head/below, after tail/above, before tail/below, tail/right,
north/above, south/below, east/below, west/above,
- north west/above, north east/below, south west/below, south east/above}
+ north west/above, north east/below, south west/below, south east/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
@@ -1308,10 +1315,10 @@ shapes define a standard set of anchors.
\begin{shape}{double arrow}
- This shape is a double arrow, which tightly fits the note contents
+ This shape is a double arrow, which tightly fits the note contents
(including any |inner sep|), and supports the rotation of the shape
- border, as described in Section~\ref{section-rotating-shape-borders}.
-
+ border, as described in Section~\ref{section-rotating-shape-borders}.
+
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={double arrow, draw}]
@@ -1322,12 +1329,12 @@ shapes define a standard set of anchors.
The double arrow behaves exactly like the single arrow, so you
need to remember that the width is \emph{always} the distance
between the back ends of the arrow heads, and the height
- is \emph{always} the the tip-to-tip distance.
-
+ is \emph{always} the tip-to-tip distance.
+
\begin{codeexample}[]
-\begin{tikzpicture}[>=stealth,
+\begin{tikzpicture}[>=stealth,
rotate border/.style={shape border uses incircle, shape border rotate=#1}]
- \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow,
+ \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow,
double arrow head extend=.5cm, double arrow head indent=.25cm] (arrow) {};
\draw[red, <->] (arrow.before tip 1) -- (arrow.after tip 1)
node [near start, right, black] {width};
@@ -1336,14 +1343,14 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- The \pgfname{} keys that can be used to customize the double arrow
+ The \pgfname{} keys that can be used to customize the double arrow
behave similarly to the keys for the single arrow (to
use these keys in \tikzname{}, simply remove the \declare{|/pgf/|}
path).
-
+
\begin{key}{/pgf/double arrow tip angle=\meta{angle} (initially 90)}
Set the angle for the arrow tip. Enlarging the arrow to some
- minimum width may increase the the height of the shape to maintain
+ minimum width may increase the height of the shape to maintain
this angle.
\end{key}
@@ -1365,14 +1372,14 @@ shapes define a standard set of anchors.
\end{key}
- The anchors for this shape are shown below (anchor |20| is an
+ The anchors for this shape are shown below (anchor |20| is an
example of a border anchor).
-
-
+
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm]
+ \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm]
{Double Arrow\vrule width1pt height2cm};
\foreach \anchor/\placement in
{text/above, center/above, 20/above,
@@ -1381,7 +1388,7 @@ shapes define a standard set of anchors.
before head 1/above, before tip 1/above, tip 1/above, after tip 1/below, after head 1/below,
before head 2/above, before tip 2/below, tip 2/above, after tip 2/above, after head 2/below,
north/above, south/below, east/below, west/below,
- north west/below, north east/below, south west/above, south east/above}
+ north west/below, north east/below, south west/above, south east/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
@@ -1398,14 +1405,14 @@ four sides.
\begin{codeexample}[]
\begin{tikzpicture}
\node[arrow box, draw] {A};
- \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}]
+ \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}]
at (2,0) {B};
\end{tikzpicture}
\end{codeexample}
Any minimum size requirements are applied to the main rectangle
\emph{only}. This does not pose too many problems if you wish to
-accommodate the length of the arrows, as it is possible to specify
+accommodate the length of the arrows, as it is possible to specify
the length of each arrow independently, from either the border of the
rectangle (the default) or the center of the rectangle.
@@ -1422,11 +1429,11 @@ There are various \pgfname{} keys for drawing this shape (to use these
keys in \tikzname, simply remove the \declare{/pgf/} path).
\begin{key}{/pgf/arrow box tip angle=\meta{angle} (initially 90)}
- Set the angle at the arrow tip for all four arrows.
+ Set the angle at the arrow tip for all four arrows.
\end{key}
\begin{key}{/pgf/arrow box head extend=\meta{length} (initially .125cm)}
- Set the the distance the arrow head extends away from the the shaft
+ Set the distance the arrow head extends away from the shaft
of the arrow. This applies to all arrows.
\end{key}
@@ -1460,30 +1467,30 @@ keys in \tikzname, simply remove the \declare{/pgf/} path).
\end{key}
\begin{key}{/pgf/arrow box arrows={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}}}
- Set the distance that all arrows extend from the node. The
+ Set the distance that all arrows extend from the node. The
specification in \meta{list} consists of the four compass points
|north|, |south|, |east| or |west|, separated by commas (so the list
- must be contained within braces).
- The distances can be specified after each side separated by a colon
- (e.g., |north:1cm|, or |west:5cm from center|).
- If an item specifies no distance, the most recently specifed
+ must be contained within braces).
+ The distances can be specified after each side separated by a colon
+ (e.g., |north:1cm|, or |west:5cm from center|).
+ If an item specifies no distance, the most recently specified
distance will be used (at the start of the list this is |0cm|,
- so the first item in the list should specify a distance).
+ so the first item in the list should specify a distance).
Any sides not specified will not be drawn with an arrow.
\end{key}
The anchors for this shape are shown below (unfortunately due to its
size, this example must be rotated). Anchor |75| is an example of a
border anchor.
-If a side is drawn without an arrow, the anchors for that arrow should
-be considered unavailable. They are (unavoidably) defined, but default
+If a side is drawn without an arrow, the anchors for that arrow should
+be considered unavailable. They are (unavoidably) defined, but default
to the center of the appropriate side.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
\node[shape=arrow box, shape example, inner xsep=1cm, inner ysep=1.5cm, arrow box shaft width=2cm,
- arrow box arrows={north:3.5cm from border, south, east:5cm from border, west},
+ arrow box arrows={north:3.5cm from border, south, east:5cm from border, west},
arrow box head extend=0.75cm, rotate=-90](s) {Arrow Box\vrule width1pt height2cm};
\foreach \anchor/\placement in
{center/above, text/above, mid/right, base/below, 75/above,
@@ -1491,13 +1498,13 @@ to the center of the appropriate side.
north/below, south/below, east/below, west/below,
north east/above, south east/above, south west/below, north west/below,
north arrow tip/above,south arrow tip/above, east arrow tip/above, west arrow tip/above,
- before north arrow/above, before north arrow head/below left, before north arrow tip/above left,
+ before north arrow/above, before north arrow head/below left, before north arrow tip/above left,
after north arrow tip/above right, after north arrow head/below right, after north arrow/below,
- before south arrow/below, before south arrow head/above right, before south arrow tip/below right,
+ before south arrow/below, before south arrow head/above right, before south arrow tip/below right,
after south arrow tip/below left, after south arrow head/above left, after south arrow/above,
- before east arrow/above, before east arrow head/above right, before east arrow tip/above,
- after east arrow tip/below, after east arrow head/below right, after east arrow/below,
- before west arrow/below, before west arrow head/below left, before west arrow tip/below,
+ before east arrow/above, before east arrow head/above right, before east arrow tip/above,
+ after east arrow tip/below, after east arrow head/below right, after east arrow/below,
+ before west arrow/below, before west arrow head/below left, before west arrow tip/below,
after west arrow tip/above, after west arrow head/above left, after west arrow/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement, rotate=-90] {\scriptsize\texttt{(s.\anchor)}};
@@ -1512,7 +1519,7 @@ to the center of the appropriate side.
\begin{pgflibrary}{shapes.multipart}
This library defines general-purpose shapes that are composed of
- multiple (text) parts.
+ multiple (text) parts.
\end{pgflibrary}
@@ -1520,7 +1527,7 @@ to the center of the appropriate side.
This shape is a multi-part shape consisting of a circle with a line
in the middle. The upper part is the main part (the |text| part),
the lower part is the |lower| part.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node [circle split,draw,double,fill=red!20]
@@ -1540,11 +1547,44 @@ to the center of the appropriate side.
\begin{tikzpicture}
\node[name=s,shape=circle split,shape example] {text\nodepart{lower}lower};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/below, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/below, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
+ text/left, lower/left, 130/above}
+ \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
+ node[\placement] {\scriptsize\texttt{(s.\anchor)}};
+\end{tikzpicture}
+\end{codeexample}
+\end{shape}
+
+
+\begin{shape}{circle solidus}
+ This shape (due to Manuel Lacruz) is similar to the split circle,
+ but the two text parts are arranged diagonally.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node [circle solidus,draw,double,fill=red!20]
+ {
+ $q_1$
+ \nodepart{lower}
+ $00$
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\Huge
+\begin{tikzpicture}
+ \node[name=s,shape=circle solidus,shape example,inner xsep=1cm] {text\nodepart{lower}lower};
+ \foreach \anchor/\placement in
+ {north west/above left, north/above, north east/above right,
+ west/left, center/below, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
text/left, lower/left, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -1554,9 +1594,9 @@ to the center of the appropriate side.
\begin{shape}{ellipse split}
- This shape is a multi-part shape consisting of an ellipse with a line
+ This shape is a multi-part shape consisting of an ellipse with a line
in the middle. The upper part is the main part (the |text| part),
- the lower part is the |lower| part.
+ the lower part is the |lower| part.
The anchors for this shape are shown below. Anchor |60| is a border anchor.
\begin{codeexample}[]
\Huge
@@ -1576,104 +1616,189 @@ to the center of the appropriate side.
\begin{shape}{rectangle split}
- This shape is a rectangle which can optionally be split into
- two, three or four node parts, or even used with a single node
- part.
+ This shape is a rectangle which can be either split horizontally
+ or vertically into several parts.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[my shape/.style={
+ rectangle split, rectangle split parts=#1, draw, anchor=center}]
+ \node [my shape=5] at (0,1)
+ {a\nodepart{two}b\nodepart{three}c\nodepart{four}d\nodepart{five}e};
+ \node [my shape=5, rectangle split horizontal] at (2,2)
+ {1\nodepart{two}2\nodepart{three}3\nodepart{four}4\nodepart{five}5};
+ \node [my shape=3] at (3,0.5)
+ {A\nodepart{two}B\nodepart{three}C};
+ \node [my shape=4, rectangle split horizontal] at (1.5,0.5)
+ {1\nodepart{two}2\nodepart{three}3\nodepart{four}4};
+\end{tikzpicture}
+\end{codeexample}
+
+
+The shape can be split into a maximum of twenty parts. However, to
+avoid allocating a lot of unnecessary boxes, \pgfname{} only allocates
+four boxes by default.
+To use the |rectangle| |split| shape with more than four boxes, the
+extra boxes must be allocated manually in advance (perhaps using |\newbox|
+or |\let|).
+The boxes take the form |\pgfnodepart|\meta{number}|box|, where \meta{number}
+is from the cardinal numbers |one|, |two|, |three|, \ldots{} and so on.
+|\pgfnodepartonebox| is special in that it is synonymous with
+|\pgfnodeparttextbox|. For compatibility with earlier versions of
+this shape, the boxes |\pgfnodeparttwobox|, |\pgfnodepartthreebox|
+and |\pgfnodepartfourbox|, can be referred to using the ordinal
+numbers: |\pgfnodepartsecondbox|, |\pgfnodepartthirdbox|
+and |\pgfnodepartfourthbox|. In order to facilitate the allocation of
+these extra boxes, the following key is provided:
+
+\begin{key}{/pgf/rectangle split allocate boxes=\meta{number}}
+ This key checks if \meta{number} boxes have been allocated, and if
+ not allocates the required boxes using |\newbox| (some ``magic'' is
+ performed to get around the fact that |\newbox| is declared |\outer|
+ in plain \TeX).
+\end{key}
+
+ When split vertically, the rectangle split will observe any
+ |minimum width| requirements but any |minimum height| will be ignored.
+ Conversely when split horizontally, |minimum height| requirements
+ will be observed, but any |minimum width| will be ignored.
+ In addition, |inner sep| is applied
+ to every part that is used, so it cannot be specified
+ independently for a particular part.
+
+ There are several \pgfname{} keys to specify how the shape is
+ drawn. To use these keys in \tikzname, simply remove the
+ \declare{|/pgf/|} path:
+
+\begin{key}{/pgf/rectangle split parts=\meta{number} (initially 4)}
+ Split the rectangle into \meta{number} parts,
+ which should be in the range |1| to |20|. If more than four parts
+ are need, the boxes should be allocated in advance as
+ described above.
\begin{codeexample}[]
-\begin{tikzpicture}[every text node part/.style={text centered}]
- \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm]
+\begin{tikzpicture}[every text node part/.style={align=center}]
+ \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm]
{Student
- \nodepart{second}
+ \nodepart{two}
age:int \\
name:String
- \nodepart{third}
+ \nodepart{three}
getAge():int \\
getName():String};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/rectangle split horizontal=\opt{\meta{boolean}} (default true)}
+ This key determines whether the rectangle is split horizontally or vertically
+ \end{key}
-
- The contents of node parts which are not used are ignored.
- Which node parts are used in each case is shown below:
+ \begin{key}{/pgf/rectangle split ignore empty parts=\opt{\meta{boolean}} (default true)}
+ When \meta{boolean} is true, \pgfname{} will ignore any part
+ that is empty \emph{except the text part}.
+ This effectively overrides the |rectangle split parts| key in that, if
+ 3 parts (for example) are specified, but one is empty, only
+ two will be shown.
\begin{codeexample}[]
-\begin{tikzpicture}
- \foreach \a/\x/\y in {1/0/0, 2/1.5/0, 3/0/-1.5, 4/1.5/-1.5}
- \node[rectangle split, rectangle split parts=\a, draw, anchor=north]
- at (\x,\y){
- text
- \nodepart{second}
- second
- \nodepart{third}
- third
- \nodepart{fourth}
- fourth};
+\begin{tikzpicture}[every node/.style={draw, anchor=text, rectangle split,
+ rectangle split parts=3}]
+ \node {text \nodepart{second} \nodepart{third}third};
+ \node [rectangle split ignore empty parts] at (2,0)
+ {text \nodepart{second} \nodepart{third}third};
\end{tikzpicture}
-\end{codeexample}
-
- There are several \pgfname{} keys to specify how the shape is
- drawn. To use these keys in \tikzname, simply remove the
- \declare{|/pgf/|} path:
-
- \begin{key}{/pgf/rectangle split parts=\meta{number} (initially 4)}
- Split the rectangle into \meta{number} parts,
- which should be in the range |1| to |4|.
+\end{codeexample}
\end{key}
-
+%
+ \begin{key}{/pgf/rectangle split empty part width=\meta{length} (initially 1ex)}
+ Set the default width for a node part box if it is empty and
+ empty parts are not ignored.
+ \end{key}
+
\begin{key}{/pgf/rectangle split empty part height=\meta{length} (initially 1ex)}
- Set the default height for a node part box if it is empty.
+ Set the default height for a node part box if it is empty and
+ empty parts are not ignored.
\end{key}
-
+
+ \begin{key}{/pgf/rectangle split empty part depth=\meta{length} (initially 0ex)}
+ Set the default depth for a node part box if it is empty and
+ empty parts are not ignored.
+ \end{key}
+
\begin{key}{/pgf/rectangle split part align={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially center)}
Set the alignment of the boxes inside the node parts.
- There should be a maximum of four entries in \meta{list},
- separated by commas (so if there is more than one entry in
+ Each item in \meta{list} should be
+ separated by commas (so if there is more than one item in
\meta{list} it must be surrounded by braces).
- Each entry is one of |left|,
- |right|, or |center|. If \meta{list} has less entries than
- node parts then the remaining node parts are aligned according to
- the last entry in the list.
- Note that this only aligns the boxes in each part and \emph{does not}
+
+ When the rectangle is split vertically, the entries in \meta{list}
+ must be one of |left|, |right|, or |center|. If \meta{list} has less
+ entries than node parts then the remaining boxes are aligned
+ according to the last entry in the list.
+ Note that this only aligns the boxes in each part and \emph{does not}
affect the alignment of the contents of the boxes.
-
+
\begin{codeexample}[]
-\def\v#1{\vrule width#1ex height2ex}
-\def\x{\v2 \nodepart{second} \v5 \nodepart{third} \v2 \nodepart{fourth} \v2}
-\begin{tikzpicture}[every node/.style={rectangle split, draw, text=blue!40}]
+\def\x{one \nodepart{two} 2 \nodepart{three} three \nodepart{four} 4}
+\begin{tikzpicture}[
+ every node/.style={rectangle split, rectangle split parts=4,
+ draw}
+ ]
\node[rectangle split part align={center, left, right}] at (0,0) {\x};
\node[rectangle split part align={center, left}] at (1.25,0) {\x};
\node[rectangle split part align={center}] at (2.5,0) {\x};
\end{tikzpicture}
\end{codeexample}
+
+ When the rectangle is split horizontally, the entries in \meta{list}
+ must be one of |top|, |bottom|, |center| or |base|. Note that using
+ the value |base| will only makes sense if all the node part boxes are
+ being aligned in this way. This is because the |base| value aligns
+ the boxes in relation to each other, whereas the other values align
+ the boxes in relation to the part of the shape they occupy.
+
+
+\begin{codeexample}[]
+\def\x{\Large w\nodepart{two}x\nodepart{three}\Huge y\nodepart{four}\tiny z}
+\begin{tikzpicture}[
+ every node/.style={rectangle split, rectangle split parts=4,
+ draw, rectangle split horizontal}
+ ]
+ \node[rectangle split part align={center, top, bottom}] at (0,0) {\x};
+ \node[rectangle split part align={center, top}] at (0,-1.25) {\x};
+ \node[rectangle split part align={center}] at (0,-2.5) {\x};
+ \node[rectangle split part align=base] at (0,-3.75) {\x};
+\end{tikzpicture}
+\end{codeexample}
+
\end{key}
-
- \begin{key}{/pgf/rectangle split draw splits=\meta{boolean} (initially true)}
+
+ \begin{key}{/pgf/rectangle split draw splits=\opt{\meta{boolean}} (default true)}
Set whether the line or lines between node parts will be drawn.
- Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits|
+ Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits|
appropriately.
\end{key}
-
- \begin{key}{/pgf/rectangle split use custom fill=\meta{boolean} (initially false)}
+
+ \begin{key}{/pgf/rectangle split use custom fill=\opt{\meta{boolean}} (default true)}
This enables the use of a custom fill for each of the node
- parts (including the area covered by the |inner sep|). The
+ parts (including the area covered by the |inner sep|). The
background path for the shape should not be filled (e.g., in
\tikzname{}, the |fill|
option for the node must be implicity or explicitly set to |none|).
- Internally, this key sets the \TeX-if
+ Internally, this key sets the \TeX-if
|\ifpgfrectanglesplitusecustomfill| appropriately.
\end{key}
-
+
\begin{key}{/pgf/rectangle split part fill={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially white)}
- Set the custom fill color for each node part shape.
- There should be a maximum of four entries in \meta{list} (one
- for each node part), separated by commas (so if there is more than
- one entry in \meta{list} it must be surrounded by braces).
+ Set the custom fill color for each node part shape.
+ Each item in \meta{list} should be separated by commas (so if
+ there is more than one item in \meta{list} it must be surrounded
+ by braces).
If \meta{list} has less entries than node
parts then the remaining node parts use the color from
the last entry in the list. This key will automatically set
|/pgf/rectangle split use custom fill|.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\tikzset{every node/.style={rectangle split, draw, minimum width=.5cm}}
@@ -1684,58 +1809,60 @@ to the center of the appropriate side.
\end{tikzpicture}
\end{codeexample}
- \end{key}
+\end{key}
- The anchors for the |rectangle split| shape, are
- shown below (anchor |70| is an example of a border angle). When a
- node part is missing (i.e., when the number of parts is less than
- |4|), the anchors prefixed with name of that node part should be
- considered unavailable. They are (unavoidably) defined, but default
- to other anchor positions.
-
+ The anchors for the |rectangle split| shape split vertically into four,
+ are shown below (anchor |70| is an example of a border angle). When a
+ node part is missing, the anchors prefixed with name of that node part
+ should be considered unavailable. They are (unavoidably) defined, but
+ default to other anchor positions.
+
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=rectangle split, rectangle split parts=4, shape example]
- {\nodepart{text}Text\nodepart{second}Second
- \nodepart{third}Third\nodepart{fourth}fourth};
+ \node[name=s,shape=rectangle split, rectangle split parts=4, shape example,
+ inner ysep=0.75cm]
+ {\nodepart{text}text\nodepart{two}two
+ \nodepart{three}three\nodepart{four}four};
\foreach \anchor/\placement in
- {text/left, text east/above, text west/above,
- second/left, second east/above, second west/above,
- third/left, third east/below, third west/below,
- fourth/left, fourth east/below, fourth west/below,
- text split/left, text split east/above, text split west/above,
- second split/left, second split east/above, second split west/above,
- third split/left, third split east/below, third split west/below,
- north/above, south/below, east/below, west/below,
- center/above, 70/above, mid/above, base/below,
- north west/above, north east/above, south west/below, south east/below}
+ {text/left, text east/above, text west/above,
+ two/left, two east/above, two west/above,
+ three/left, three east/below, three west/below,
+ four/left, four east/below, four west/below,
+ text split/left, text split east/above, text split west/above,
+ two split/left, two split east/above, two split west/above,
+ three split/left, three split east/below, three split west/below,
+ north/above, south/below, east/below, west/below,
+ north west/above, north east/above, south west/below, south east/below,
+ center/above, 70/above, mid/above, base/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+
\end{shape}
+
\subsection{Callout Shapes}
-\begin{pgflibrary}{shapes.callout}
- Producing basic callouts can be done quite easily in \pgfname{} and
+\begin{pgflibrary}{shapes.callouts}
+ Producing basic callouts can be done quite easily in \pgfname{} and
\tikzname{} by creating a node and then subsequently drawing a path
from the border of the node to the required point. This library
provides more fancy, `balloon'-style callouts.
-
+
\end{pgflibrary}
-Callouts consist of a
+Callouts consist of a
main shape, and a pointer (which is part of the shape) which points
to something in (or outside) the picture. The position on the border
of the main shape to which the pointer is connected is determined
-automatically. However, the pointer is ignored when calculating the
+automatically. However, the pointer is ignored when calculating the
minimum size of the shape, and also when positioning anchors.
\begin{codeexample}[]
@@ -1744,16 +1871,16 @@ minimum size of the shape, and also when positioning anchors.
\end{tikzpicture}
\end{codeexample}
-There are two kinds of pointer: the ``relative'' pointer and the
+There are two kinds of pointer: the ``relative'' pointer and the
``absolute'' pointer. The relative pointer calculates the angle of a
-specified coordinate relative to the center of the main shape, locates
-the point on the border to which this angle corresponds, and then adds
-the coordinate to this point. This seemingly over-complex approach
-means than you do not have to guess the size of the main shape: the
-relative pointer will always be outside.
-The absolute pointer, on the
+specified coordinate relative to the center of the main shape, locates
+the point on the border to which this angle corresponds, and then adds
+the coordinate to this point. This seemingly over-complex approach
+means than you do not have to guess the size of the main shape: the
+relative pointer will always be outside.
+The absolute pointer, on the
other hand, is much simpler: it points to the specified coordinate
-absolutely (and can even point to named coordinates in different
+absolutely (and can even point to named coordinates in different
pictures).
@@ -1762,7 +1889,7 @@ pictures).
\draw [help lines] grid(3,2);
\node [note=red!50, callout relative pointer={(0,1)}] at (3,1) {Relative};
\node [note=blue!50, callout absolute pointer={(0,1)}] at (1,0) {Absolute};
- \node [note=green!50, opacity=.5, overlay,
+ \node [note=green!50, opacity=.5, overlay,
callout absolute pointer={(hallo.south)}] at (1,2) {Outside};
\end{tikzpicture}
\end{codeexample}
@@ -1770,21 +1897,21 @@ pictures).
The following keys are common to all callouts. Please remember
that the |callout| |relative| |pointer|, and |callout| |absolute|
-|pointer| keys take a different format for their value depending
+|pointer| keys take a different format for their value depending
on whether they are being used in \pgfname{} or \tikzname{}.
-
-
+
+
\begin{key}{/pgf/callout relative pointer=\meta{coordinate} (initially {\ttfamily\char`\\pgfpointpolar\char`\{315\char`\}\char`\{.5cm\char`\}})}
-
- Set the vector of the callout pointer `relative' to the callout
- shape.
-
+
+ Set the vector of the callout pointer `relative' to the callout
+ shape.
+
\end{key}
\begin{key}{/pgf/callout absolute pointer=\meta{coordinate}}
-
+
Set the vector of the callout pointer absolutely within the picture.
-
+
\end{key}
@@ -1801,12 +1928,12 @@ on whether they are being used in \pgfname{} or \tikzname{}.
coordinates.
\end{key}
- It is also possible to shorten the pointer by some distance, using
+ It is also possible to shorten the pointer by some distance, using
the following key:
\begin{key}{/pgf/callout pointer shorten=\meta{distance} (initially 0cm)}
- Move the callout pointer towards the center of the callouts main
- shape by \meta{distance}.
+ Move the callout pointer towards the center of the callouts main
+ shape by \meta{distance}.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1814,44 +1941,44 @@ on whether they are being used in \pgfname{} or \tikzname{}.
callout absolute pointer={#1}}}
\draw (0,0) grid (3,2);
\node[callout={(3,1.5)}, fill=red!50] at (0,1.5) {A};
- \node[callout={(3,.5)}, fill=green!50, callout pointer shorten=1cm]
+ \node[callout={(3,.5)}, fill=green!50, callout pointer shorten=1cm]
at (0,.5) {B};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{key}
-
+
\begin{shape}{rectangle callout}%
- This shape is a callout whose main shape is a rectangle, which
+ This shape is a callout whose main shape is a rectangle, which
tightly fits the node contents (including any |inner sep|).
- It supports the keys described above and also the following
+ It supports the keys described above and also the following
key:
-
-
-\begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)}
+
+
+\begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)}
Set the width of the pointer at the border of the rectangle.
\end{key}
The anchors for this shape are shown below (anchor |60| is an
- example of a border anchor). The pointer direction is ignored when
- placing anchors.
- Additionally, when using an absolute pointer, the |pointer|
- anchor should not be used to used to position the shape as it is
+ example of a border anchor). The pointer direction is ignored when
+ placing anchors.
+ Additionally, when using an absolute pointer, the |pointer|
+ anchor should not be used to used to position the shape as it is
calculated whilst the shape is being drawn.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=rectangle callout, callout relative pointer={(1.25cm,-1cm)},
- callout pointer width=2cm, shape example, inner xsep=2cm, inner ysep=1cm]
+ \node[name=s,shape=rectangle callout, callout relative pointer={(1.25cm,-1cm)},
+ callout pointer width=2cm, shape example, inner xsep=2cm, inner ysep=1cm]
{Rectangle Callout\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{center/above, text/below, 60/above,
- mid/right, mid west/left, mid east/right,
- base/below, base west/below, base east/below,
+ mid/right, mid west/left, mid east/right,
+ base/below, base west/below, base east/below,
north/above, south/below, east/above, west/above,
- north west/above, north east/above,
+ north west/above, north east/above,
south west/below, south east/below,
pointer/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
@@ -1864,37 +1991,37 @@ on whether they are being used in \pgfname{} or \tikzname{}.
\begin{shape}{ellipse callout}%
- This shape is a callout whose main shape is a ellipse, which
+ This shape is a callout whose main shape is a ellipse, which
tightly fits the node contents (including any |inner sep|).
- It uses the |absolute callout pointer|,
+ It uses the |absolute callout pointer|,
|relative callout pointer| and |callout pointer shorten| keys, and
also the following key:
-
-
-\begin{key}{/pgf/callout pointer arc=\meta{angle} (initially 15)}
+
+
+\begin{key}{/pgf/callout pointer arc=\meta{angle} (initially 15)}
Set the width of pointer at the border of the ellipse according
to an arc of length \meta{angle}.
\end{key}
The anchors for this shape are shown below (anchor |60| is an
- example of a border anchor). The pointer direction is ignored
+ example of a border anchor). The pointer direction is ignored
when placing anchors and the |pointer| anchor can only be
- used to position the shape when the relative anchor is
+ used to position the shape when the relative anchor is
specified.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=ellipse callout, callout relative pointer={(1.25cm,-1cm)},
- callout pointer width=2cm, shape example, inner xsep=1cm, inner ysep=.5cm]
+ \node[name=s,shape=ellipse callout, callout relative pointer={(1.25cm,-1cm)},
+ callout pointer width=2cm, shape example, inner xsep=1cm, inner ysep=.5cm]
{Ellipse Callout\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{center/above, text/below, 60/above,
- mid/above, mid west/right, mid east/left,
- base/below, base west/below, base east/below,
+ mid/above, mid west/right, mid east/left,
+ base/below, base west/below, base east/below,
north/above, south/below, east/above, west/above,
- north west/above left, north east/above right,
+ north west/above left, north east/above right,
south west/below left, south east/below right,
pointer/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
@@ -1906,23 +2033,23 @@ on whether they are being used in \pgfname{} or \tikzname{}.
\begin{shape}{cloud callout}
-This shape is a callout whose main shape is a cloud which fits the
-node contents. The pointer is segmented, consisting of a series of
-shrinking ellipses. This callout requires the symbol shape library
-(for the cloud shape). If this library is not loaded an error will
+This shape is a callout whose main shape is a cloud which fits the
+node contents. The pointer is segmented, consisting of a series of
+shrinking ellipses. This callout requires the symbol shape library
+(for the cloud shape). If this library is not loaded an error will
result.
\begin{codeexample}[]
\begin{tikzpicture}
- \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120,
+ \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120,
shading=ball,text=white] {\bf Imagine...};
\end{tikzpicture}
\end{codeexample}
The |cloud callout| supports the |absolute callout pointer|,
-|relative callout pointer| and |callout pointer shorten| keys, as
+|relative callout pointer| and |callout pointer shorten| keys, as
described above.
-The main shape can be modified using the same keys as the |cloud|
+The main shape can be modified using the same keys as the |cloud|
shape. The following keys are also supported:
\begin{key}{/pgf/callout pointer start size=\meta{value} (initially .2 of callout)}
@@ -1931,14 +2058,14 @@ shape. The following keys are also supported:
\meta{value}:
\begin{itemize}
\item
- A single dimension (e.g., |5pt|), in which case the first ellipse
+ A single dimension (e.g., |5pt|), in which case the first ellipse
will have equal diameters of 5pt.
\item
- Two dimensions (e.g., |10pt and 2.5pt|), which sets the $x$ and
+ Two dimensions (e.g., |10pt and 2.5pt|), which sets the $x$ and
$y$ diameters of the first ellipse.
\item
A decimal fraction (e.g., |.2 of callout|), in which case
- the $x$ and $y$ diameters of the first ellipse will be set as
+ the $x$ and $y$ diameters of the first ellipse will be set as
fractions of the width and height of the main shape. The keyword
|of callout| cannot be omitted.
\end{itemize}
@@ -1949,12 +2076,12 @@ shape. The following keys are also supported:
\end{key}
\begin{key}{/pgf/callout pointer segments=\meta{number} (initially 2)}
- Set the number of segments in the pointer. Note that \pgfname{} will
- happily overlap segments if too many are specified.
+ Set the number of segments in the pointer. Note that \pgfname{} will
+ happily overlap segments if too many are specified.
\end{key}
-The anchors for this shape are shown below (anchor |70| is an example
-of a border anchor). The pointer direction is ignored when placing
+The anchors for this shape are shown below (anchor |70| is an example
+of a border anchor). The pointer direction is ignored when placing
anchors and the pointer anchor can only be used to position the
shape when the relative anchor is specified. Note that the center
of the last segment is drawn at the |pointer| anchor.
@@ -1983,747 +2110,6 @@ of the last segment is drawn at the |pointer| anchor.
-\subsection{Logic Gate Shapes}
-
-\subsubsection{Overview}
- \pgfname{} provides two libraries of logic gates, one providing
- ``American'' style gates and the other, providing ``rectangular''
- logic gates.
- Each library suffixes the gate names with an identifer:
- |US| for the American style gates, and |IEC| for the rectangular
- gates (additionally, two shapes in the |US| library use the
- suffix |CDH|). Keys which are specific
- to a particular library also contain this identifier (e.g.,
- |/pgf/and gate IEC symbol|).
- However, as described below, a \tikzname{} key is provided which
- sets up several styles allowing the identifier to be omitted,
- for example, |and gate| can become a synonym for |shape=and gate US|.
-
- Multiple inputs can be specified for a logic gate (provided they
- support multiple inputs: a not gate --- also known as an inverter ---
- does not). However, there is an upper limit for the number of inputs
- which has been set at 1024, which should be \emph{way}
- more than would ever be needed.
-
- There are some \pgfname{} keys which are common to both
- libraries, which have no library identifier contained in them:
-
-
- \begin{key}{/pgf/logic gate inputs=\meta{input list} (initially \char`\{normal,normal\char`\})}
- Specify the inputs for for the logic gate. The keyword |inverted|
- indicates an inverted input which will mean \pgfname{} will draw a
- circle attached to the main shape of the logic gate. Any keyword
- that is not |inverted| will be treated as a ``normal'' or
- ``non-inverted'' input (however, for readability, you may wish to
- use |normal| or |non-inverted|), and \pgfname{} will not draw the
- circle.
- In both cases the anchors for the inputs will be set
- up appropriately, numbered from top to bottom |input 1|, |input 2|,
- \ldots and so on. If the gate only supports one input the anchor
- is simply called |input| with no numerical index.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum height=0.75cm]
- \node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}]
- (A) {};
- \foreach \a in {1,...,3}
- \draw (A.input \a -| -1,0) -- (A.input \a);
- \draw (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
- For multiple inputs it may be somewhat unweildy to specify a long
- list, thus, the following ``shorthand'' is permitted (this is an
- extension of ideas due to Juergen Werber and Christoph Bartoschek):
- Using |i| for inverted and |n| for normal inputs, \meta{input list}
- can be specfied \emph{without the commas}. So, for example,
- |ini| is equivalent to |inverted, normal, inverted|.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum height=0.75cm]
- \node[or gate US, draw,logic gate inputs=inini] (A) {};
- \foreach \a in {1,...,5}
- \draw (A.input \a -| -1,0) -- (A.input \a);
- \draw (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{key}
-
-
-The height of the gate may be increased to accommodate the number
-of inputs. In fact, it depends on three variables:
-$n$, the number of inputs, $r$, the radius of the circle used
-to indicate an inverted input and $s$, the distance between
-the centers of the inputs.
-The default height is then calculated according to the expression
-$(n+1)\times\max(2r,s)$. This then may
-be increased to accommodate the node contents or any
-minimum size specifications.
-
-The radius of the inverted input circle and the distance between the
-centers of the inputs can be customised using the following keys:
-
-\begin{key}{/pgf/logic gate inverted radius=\meta{length} (initially 2pt)}
- Set the radius of the circle that is used to indicate inverted
- inputs. This is also the radius of the circle used for the inverted
- output of the |nand|, |nor|, |xnor| and |not| gates.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum height=0.75cm]
- \tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}}
- \node[logic gate inverted radius=2pt] {A};
- \node[logic gate inverted radius=4pt] at (0,-1) {B};
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-
-\begin{key}{/pgf/logic gate input sep=\meta{length} (initially .125cm)}
- Set the distance between the \emph{centers} of the inputs to the
- logic gate.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum size=0.75cm]
- \draw [help lines] grid (3,2);
- \tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}}
- \node[logic gate input sep=0.33333cm] at (1,1)(A) {A};
- \node[logic gate input sep=0.5cm] at (3,1) (B) {B};
- \foreach \a in {1,...,3}
- \draw (A.input \a -| 0,0) -- (A.input \a)
- (B.input \a -| 2,0) -- (B.input \a);
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-
-
-\subsubsection{US Logic Gates}
-
-\begin{pgflibrary}{shapes.gates.logic.US}
- This library provides ``American'' logic gate shapes whose names are
- suffixed with the identifier |US|. Additionally,
- alternative |and| and |nand| gates are provided which are based on the
- logic symbols used in A. Croft, R. Davidson, and M. Hargreaves (1992),
- \emph{Engineering Mathematics}, Addison-Wesley, 82--95. These two
- shapes are suffixed with |CDH|.
-\end{pgflibrary}
-
- To use the shapes in \tikzname{} without their suffixes, the
- following keys are provided:
-
-\begin{key}{/tikz/use US style logic gates}
- This allows the the shapes suffixed with |US| to be used without
- the suffix. So, for example, |and gate| becomes a synonym for
- |shape=and gate US|.
-\begin{codeexample}[]
-\tikz\node[draw, and gate US, red]{and};
-\space
-\tikz[use US style logic gates,blue]\node[draw, and gate]{and};
-\end{codeexample}
-\end{key}
-
-\begin{key}{/tikz/use CDH style logic gates}
- This key again allows the the shapes suffixed with |US| to be used
- without the |US| suffix. However, |and gate| becomes a synonym for
- |shape=and gate CDH| and |nand gate| becomes a synonym for
- |shape=nand gate CDH|, providing alternative symbols for these
- gates.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum height=1cm]
- \node[draw, and gate US, red] at (0,1.5) {and};
- \node[draw, nand gate US, red] at (2,1.5) {nand};
- \tikzset{use CDH style logic gates}
- \node[draw, and gate, blue] at (0,0) {and};
- \node[draw, nand gate, blue] at (2,0) {nand};
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-
-
-
-As described above, \pgfname{} will increase the size of the
-logic gate to accommodate the number of inputs, and the size
-of the inverted radius and the separation between the inputs.
-However with all shapes in this library, any increase in size
-(including any minimum size requirements) will be applied so that
-the default aspect ratio is unaltered. This means that changing
-the height will change the width and vice versa.
-
-The ``compass point'' anchors apply to the main part of the shape
-and do not include any inverted inputs or outputs. This library
-provides an additonal feature to facilitate the relative positioning
-of logic gates:
-
-\begin{key}{/pgf/logic gate anchors use bounding box=\meta{boolean} (initially false)}
-When set to |true| this key will ensure that the
-compass point anchors use the bounding rectangle of the
-main shape, which, ignore any inverted inputs or outputs, but
-includes any |outer sep|.
-This \emph{only} affects the compass point anchors
-and is not set on a shape by shape basis: whether the bounding
-box is used is determined by value of this key when the anchor
-is accessed.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum height=1.5cm]
- \node[xnor gate US, draw, gray!50,line width=2pt] (A) {};
- \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt}
- \foreach \a in {north, south, east, west, north east,
- south east, north west, south west}
- \draw[logic gate anchors use bounding box=\x, color=\y]
- (A.\a) circle(\z);
-\end{tikzpicture}
-\end{codeexample}
-
-
-
-\end{key}
-
-
-
-
-\begin{shape}{and gate US}
- This shape is an and gate which supports two or more inputs. If
- less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=and gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {And Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/right, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-\begin{shape}{nand gate US}
- This shape is a nand gate, which supports two or more inputs. If
- less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=nand gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{or gate US}
-
- This shape is an or gate, which supports two or more inputs. If
- less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=or gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {Or Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/left, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-\begin{shape}{nor gate US}
- This shape is a nor gate, which supports two or more inputs. If
- less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=nor gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {Nor Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/left, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{xor gate US}
- This shape is an xor gate, which supports only two inputs. If
- less than two inputs are specified an error will result. If more
- than two inputs are specified, the extra inputs are ignored.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=xor gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {Xor Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{xnor gate US}
-
- This shape is an xnor gate, which supports only two inputs. If
- less than two inputs are specified an error will result. If more
- than two inputs are specified, the extra inputs are ignored.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=xnor gate US,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {Xnor Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/above, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-
-\end{shape}
-
-\begin{shape}{not gate US}
- This shape is a not gate, which supports only one input. If
- no inputs are specified an error will result. If more
- than one input is specified, the extra inputs are ignored.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=not gate US,shape example, inner sep=1.5cm,
- logic gate inverted radius=.5cm]
- {Not Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/below,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/above}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{buffer gate US}
- This shape is a not gate, which supports only one input. If
- no inputs are specified an error will result. If more
- than one input is specified, the extra inputs are ignored.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=buffer gate US,shape example, inner sep=1.5cm,
- logic gate inverted radius=.5cm]
- {Buffer Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/below,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-
-
-
-
-\begin{shape}{and gate CDH}
- This shape is the alternative and gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=and gate CDH,shape example, inner sep=0cm,
- logic gate inverted radius=.5cm] {And Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-\begin{shape}{nand gate CDH}
- This shape is the alternative nand gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs (using the normal compass point anchors) are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=nand gate CDH,shape example, inner xsep=0cm,
- logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-
-
-
-
-\subsubsection{IEC Logic Gates}
-
-\begin{pgflibrary}{shapes.gates.logic.IEC}
- This library provides rectangular logic gate shapes. These shapes
- are suffixed with |IEC| as they are based on gates recommended by
- the International Electrotechincal Commission.
-\end{pgflibrary}
-
- In order to use these shapes in \tikzname{} without the |IEC|
- suffix, the following key is provided:
-
-\begin{key}{/tikz/use IEC style logic gates}
- This allows the the shapes suffixed with |IEC| to be used without
- the suffix. So, for example, |and gate| becomes a synonym for
- |shape=and gate IEC|. In addtion the |IEC| specific keys can be
- used without |IEC|, so |and gate symbol| can be
- used for |and gate IEC symbol|.
-\end{key}
-
- By default each gate is drawn with a symbol, $\char`\&$ for |and| and
- |nand| gates, $\geq1$ for |or| and |nor| gates, $1$ for |not| and
- |buffer| gates, and $=1$ for |xor| and |xnor| gates. These symbols
- are drawn automatically (internally they are drawn using the
- ``foreground'' path), and are not strictly speaking part of the node
- contents. However, the gate is enlarged to make sure the symbols are
- within the border of the node.
- It is possible to change
- the symbols and their position within the node using the following
- keys:
-
-\begin{key}{/pgf/and gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)}
- Set the symbol for the |and gate|. Note that if the node is filled,
- this color will be used for the symbol, making it invisible, so
- it will be necessary set \meta{text} to something like
- |\color{black}\char`\&|. Alternatively, the
- |logic gate IEC symbol color| key can be used to set the color
- of all symbols simultaneously.
-
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |and gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/nand gate IEC symbol=\meta{text} (initially \char`\\char\char`\`\char`\\\char`\&)}
- Set the symbol for the |nand gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |nand gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/or gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)}
- Set the symbol for the |or gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |or gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/nor gate IEC symbol=\meta{text} (initially \char`\$\char`\\geq1\char`\$)}
- Set the symbol for the |nor gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |nor gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/xor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})}
- Set the symbol for the |xor gate|. Note the necessity for braces,
- as the symbol contains |=|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |or gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/xnor gate IEC symbol=\meta{text} (initially \char`\{\char`\$=1\char`\$\char`\})}
- Set the symbol for the |xnor gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |xnor gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/not gate IEC symbol=\meta{text} (initially 1)}
- Set the symbol for the |not gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |not gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/buffer gate IEC symbol=\meta{text} (initially 1)}
- Set the symbol for the |buffer gate|.
- In \tikzname, when the |use IEC style logic gates| key has been
- used, this key can be replaced by |buffer gate symbol|.
-\end{key}
-
-\begin{key}{/pgf/logic gate IEC symbol align=\meta{align} (initially top)}
- Set the alignment of the logic gate symbol (in \tikzname, when the
- |use IEC style logic gates| key has been used, |IEC| can be omitted.
- The specification in \meta{align} is a comma separated list from
- |top|, |bottom|, |left| or |right|. The distance between the border
- of the node and the outer edge of the symbol is determined by the values
- of the |inner xsep| and |inner ysep|.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates]
- \tikzset{every node/.style={nor gate, draw}}
- \node (A) at (0,1.5) {};
- \node [logic gate symbol align={bottom, right}] (B) at (0,0) {};
- \foreach \g in {A, B}{
- \foreach \i in {1,2}
- \draw ([xshift=-0.5cm]\g.input \i) -- (\g.input \i);
- \draw (\g.output) -- ([xshift=0.5cm]\g.output);
- }
-\end{tikzpicture}
-\end{codeexample}
-
-\end{key}
-
-
-\begin{key}{/pgf/logic gate IEC symbol color=\meta{color}}
- This key sets the color for all symbols simultaneously. This color
- can be overridden on a case by case basis by specifying a color
- when seting the symbol text.
-\end{key}
-
-
-\begin{shape}{and gate IEC}
- This shape is an and gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=and gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm,
- minimum height=6cm, and gate IEC symbol=\color{black!30}\char`\&]
- {And Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-
-\begin{shape}{nand gate IEC}
- This shape is a nand gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- The anchors for this gate with two
- non-inverted inputs are
- shown below. Anchor |30| is an example of a border anchor.
-
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm,
- minimum height=6cm, nand gate IEC symbol=\color{black!30}\char`\&,
- logic gate inverted radius=0.65cm]
- {Nand Gate\vrule width1pt height2cm};
- \foreach \anchor/\placement in
- {center/above, text/above, 30/above right,
- mid/right, mid east/left, mid west/above,
- base/below, base east/below, base west/left,
- north/above, south/below, east/above, west/above,
- north east/above, south east/below, south west/below, north west/above,
- output/right, input 1/above, input 2/below}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-\begin{shape}{or gate IEC}
- This shape is an or gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- See the |and gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[or gate IEC, draw, logic gate inputs=in] (A) {};
- \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2)
- (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-
-\begin{shape}{nor gate IEC}
- This shape is an nor gate. It supports two or more inputs.
- If less than two inputs are specified an error will result.
- See the |nand gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[nor gate IEC, draw, logic gate inputs=in] (A) {};
- \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2)
- (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{xor gate IEC}
- This shape is an xor gate. It supports only two inputs.
- If less than two inputs are specified an error will result.
- Any extra inputs are ignored.
- See the |and gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[xor gate IEC, draw, logic gate inputs=in] (A) {};
- \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2)
- (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-
-\begin{shape}{xnor gate IEC}
- This shape is an xnor gate. It supports only two inputs.
- If less than two inputs are specified an error will result.
- Any extra inputs are ignored.
- See the |nand gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[xnor gate IEC, draw, logic gate inputs=in] (A) {};
- \draw (A.input 1 -| -1,0) -- (A.input 1) (A.input 2 -| -1,0) -- (A.input 2)
- (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-\begin{shape}{buffer gate IEC}
- This shape is a buffer gate. It supports only one input.
- If less than one input is specified an error will result.
- Any extra inputs are ignored.
- See the |and gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[buffer gate IEC, draw] (A) {};
- \draw (A.input -| -1,0) -- (A.input) (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-\end{shape}
-
-
-\begin{shape}{not gate IEC}
- This shape is a not gate. It supports only one input.
- If less than one input is specified an error will result.
- Any extra inputs are ignored.
- See the |nand gate IEC| shape for the anchors.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[minimum width=.875cm, minimum height=1cm]
- \node[not gate IEC, draw] (A) {};
- \draw (A.input -| -1,0) -- (A.input) (A.output) -- ([xshift=0.5cm]A.output);
-\end{tikzpicture}
-\end{codeexample}
-
-
-\end{shape}
-
-
-
@@ -2737,54 +2123,18 @@ is accessed.
\begin{shape}{cross out}
This shape ``crosses out'' the node. Its foreground path are simply
two diagonal lines that between the corners of the node's bounding
- box. Here is an example:
-\begin{codeexample}[]
-\begin{tikzpicture}
- \draw [help lines] (0,0) grid (3,2);
- \node [cross out,draw=red] at (1.5,1) {cross out};
-\end{tikzpicture}
-\end{codeexample}
-
- A useful application is inside text as in the following example:
-\begin{codeexample}[]
-Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
-\end{codeexample}
-
- This shape inherits all anchors from the |rectangle| shape, see also
- the following figure:
-\begin{codeexample}[]
-\Huge
-\begin{tikzpicture}
- \node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm};
- \foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
- text/left, 10/right, 130/above}
- \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
- node[\placement] {\scriptsize\texttt{(s.\anchor)}};
-\end{tikzpicture}
-\end{codeexample}
-\end{shape}
-
-
-\begin{shape}{cross out}
- This shape ``crosses out'' the node. Its foreground path are simply
- two diagonal lines that between the corners of the node's bounding
box. Here is an example:
\begin{codeexample}[]
\begin{tikzpicture}
- \draw[help lines] (0,0) grid (3,2);
+ \draw [help lines] (0,0) grid (3,2);
\node [cross out,draw=red] at (1.5,1) {cross out};
\end{tikzpicture}
\end{codeexample}
A useful application is inside text as in the following example:
\begin{codeexample}[]
-Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
+Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
\end{codeexample}
This shape inherits all anchors from the |rectangle| shape, see also
@@ -2794,11 +2144,11 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
\begin{tikzpicture}
\node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
- {north west/above left, north/above, north east/above right,
- west/left, center/above, east/right,
- mid west/right, mid/above, mid east/left,
- base west/left, base/below, base east/right,
- south west/below left, south/below, south east/below right,
+ {north west/above left, north/above, north east/above right,
+ west/left, center/above, east/right,
+ mid west/right, mid/above, mid east/left,
+ base west/left, base/below, base east/right,
+ south west/below left, south/below, south east/below right,
text/left, 10/right, 130/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -2807,12 +2157,12 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
\end{shape}
\begin{shape}{strike out}
- This shape is idential to the |cross out| shape, only its foreground
+ This shape is identical to the |cross out| shape, only its foreground
path consists of a single line from the lower left to the upper
right.
-
+
\begin{codeexample}[]
-Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
+Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{codeexample}
See the |cross out| shape for the anchors.
@@ -2836,8 +2186,8 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\begin{key}{/pgf/rounded rectangle arc length=\meta{angle} (initially 180)}
- Set the length of the arcs for the rounded ends. Recommended values
- for \meta{angle} are between |90| and |180|.
+ Set the length of the arcs for the rounded ends. Recommended values
+ for \meta{angle} are between |90| and |180|.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -2845,7 +2195,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[rounded rectangle arc length=180] {180}; \\
\node[rounded rectangle arc length=120] {120}; \\
\node[rounded rectangle arc length=90] {90}; \\};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -2860,7 +2210,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[rounded rectangle west arc=concave] {Concave}; \\
\node[rounded rectangle west arc=convex] {Convex}; \\
\node[rounded rectangle left arc=none] {None}; \\};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -2877,20 +2227,20 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{stylekey}
The anchors for this shape are shown below (anchor |10| is an example
- of a border angle). Note that if only one side is rounded, the
+ of a border angle). Note that if only one side is rounded, the
|center| anchor will not be the precise center of the shape.
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
- \node[name=s,shape=rounded rectangle, shape example, inner xsep=1.5cm, inner ysep=1cm]
+ \node[name=s,shape=rounded rectangle, shape example, inner xsep=1.5cm, inner ysep=1cm]
{Rounded Rectangle\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{center/above, text/below, 10/above,
- mid/above, mid west/right, mid east/left,
- base/below, base west/below, base east/below,
- north/above, south/below, east/above, west/above,
- north west/above left, north east/above right,
+ mid/above, mid west/right, mid east/left,
+ base/below, base west/below, base east/below,
+ north/above, south/below, east/above, west/above,
+ north west/above left, north east/above right,
south west/below left, south east/below right}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
@@ -2927,10 +2277,10 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{key}
\begin{key}{/pgf/chamfered rectangle xsep=\meta{length} (initially .666ex)}
- Set the distance that the chamfer extends horizontally beyond the node
- contents (which includes the |inner sep|).
+ Set the distance that the chamfer extends horizontally beyond the node
+ contents (which includes the |inner sep|).
If \meta{length} is large, such
- that the top and bottom chamfered edges would cross, then
+ that the top and bottom chamfered edges would cross, then
\meta{length} is ignored and the chamfered edges are drawn so that
they meet in the middle.
@@ -2945,10 +2295,10 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{key}
\begin{key}{/pgf/chamfered rectangle ysep=\meta{length} (initially .666ex)}
- Set the distance that the chamfer extends vertically beyond the node
- contents.
- If \meta{length} is large, such that the left and right chamfered
- edges would cross, then \meta{length} is ignored and the chamfered
+ Set the distance that the chamfer extends vertically beyond the node
+ contents.
+ If \meta{length} is large, such that the left and right chamfered
+ edges would cross, then \meta{length} is ignored and the chamfered
edges are drawn so that they meet in the middle.
\end{key}
@@ -2957,11 +2307,11 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{key}
\begin{key}{/pgf/chamfered rectangle corners=\meta{list} (initially chamfer all)}
- Specify which corners are chamfered. The corners are identified by
+ Specify which corners are chamfered. The corners are identified by
their ``compass point'' directions (i.e. |north east|, |north west|,
|south west|, and |south east|), and must be separated by commas (so
if there is more than one corner in the list, it must be surrounded
- by braces). Any corners not mentioned in
+ by braces). Any corners not mentioned in
\meta{list} are automatically not chamfered. Two additional values
|chamfer all| and |chamfer none|, are also permitted.
@@ -2982,17 +2332,17 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\Huge
\begin{tikzpicture}
\node[name=s,shape=chamfered rectangle, chamfered rectangle sep=1cm,
- shape example, inner ysep=1cm, inner xsep=.75cm]
+ shape example, inner ysep=1cm, inner xsep=.75cm]
{Chamfered Rectangle\vrule width1pt height2cm};
\foreach \anchor/\placement in
- {text/right, center/above, 70/above,
+ {text/right, center/above, 70/above,
base/below, base east/left, base west/right,
- mid/right, mid east/above, mid west/above,
+ mid/right, mid east/above, mid west/above,
north/above, south/below, east/above, west/above,
before north east/above, north east/above, after north east/above,
before north west/above, north west/above, after north west/above,
before south west/below, south west/below, after south west/below,
- before south east/below, south east/below, after south east/below}
+ before south east/below, south east/below, after south east/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
@@ -3002,7 +2352,7 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex
new file mode 100644
index 00000000000..dc6f163929f
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex
@@ -0,0 +1,451 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Spy Library: Magnifying Parts of Pictures}
+\label{section-library-spy}
+
+\begin{tikzlibrary}{spy}
+ The package defines options for creating pictures in which some part
+ of the picture is repeated in another area in a magnified way (as if
+ you were looking through a spyglass, hence the name).
+\end{tikzlibrary}
+
+
+\subsection{Magnifying a Part of a Picture}
+
+The idea behind the |spy| library is to make is easy to create high-density
+pictures in which some important parts are repeated somewhere, but
+magnified as if you were looking through a spyglass:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using outlines={circle, magnification=4, size=2cm, connect spies}]
+
+ \draw [help lines] (0,0) grid (3,2);
+
+ \draw [decoration=Koch curve type 1]
+ decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
+
+ \spy [red] on (1.6,0.3)
+ in node [left] at (3.5,-1.25);
+
+ \spy [blue, size=1cm] on (1,1)
+ in node [right] at (0,-1.25);
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[spy using overlays={size=12mm}]
+ \draw [decoration=Koch snowflake]
+ decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
+
+ \spy [green,magnification=3] on (0.6,0.1) in node at (-0.3,-1);
+ \spy [blue,magnification=5] on (1,0.5) in node at (1,-1);
+ \spy [red,magnification=10] on (1.6,0.1) in node at (2.3,-1);
+\end{tikzpicture}
+\end{codeexample}
+
+
+Note that this magnification uses what is called a \emph{canvas
+ transformation} in this manual: Everything is magnified, including
+line width and text.
+
+In order for ``spying'' to work, the picture obviously has to be drawn
+several times: Once at its normal size and then again for each
+``magnifying glass.'' Several keys and commands work in concert to
+make this possible:
+\begin{itemize}
+\item You need to make \tikzname\ aware of the fact that a picture (or
+ just a scope) is to be magnified. This is done by adding the special
+ key |spy scope| to a |{scope}| or |{tikzpicture}| (which is also
+ just a scope). Some special keys like |spy using outlines|
+ implicitly set the |spy scope|.
+
+\item Inside this scope you may then use the command |\spy|, which is
+ only available inside such scopes (so there is no danger of your
+ inadvertently using this command outside such a scope). This command
+ has a special syntax and will (at some point) create two nodes: One
+ node that shows the magnified picture (called the \emph{spy-in
+ node}) and another node showing which part of the original picture
+ is magnified (called the \emph{spy-on} node). The spy-in node is,
+ indeed, a normal node, so it can have any shape or border that you
+ like and you can apply all of \tikzname's advanced features to
+ it. The only difference compared to a normal node is that instead of
+ some ``text'' it contains a magnified version of the picture,
+ clipped to the size of the node.
+
+ The |\spy| command does not create the nodes immediately. Rather,
+ the creation of these nodes is postponed till the end of the
+ |spy scope| in which the |\spy| command is used. This is necessary
+ since in order to repeat the whole scope inside the node containing
+ the magnified version, the whole picture needs to be available when
+ this node is created.
+\end{itemize}
+
+A basic question any library for ``magnifying things'' has to address
+is how you specify which part of the picture is to be
+magnified (the spy-on node) and where this magnified part is to be
+shown (the spy-in node). There are two possible ways:
+\begin{enumerate}
+\item You specify the size and position of the spy-on node. Then the
+ size of the spy-in node is determined by the size of the spy-on node
+ and the magnification factor -- you can still decide where the
+ spy-in node should be placed, but not its size.
+\item Alternatively, you specify the size and position of the spy-in
+ node. Then, similarly to the first case, the size of the spy-on node
+ is determined implicitly and you can only decide where the
+ spy-on node should be placed, but not its size.
+\end{enumerate}
+
+The |spy| library uses the second method: You specify the size and
+position of the spy-in nodes, the sizes of the spy-on nodes are then
+computed automatically.
+
+
+
+\subsection{Spy Scopes}
+
+\begin{key}{/tikz/spy scope=\meta{options} (default \normalfont empty)}
+ This option may be used with a |{scope}| or any environment that
+ creates such a scope internally (like |{tikzpicture}|). It has the
+ following effects:
+ \begin{itemize}
+ \item It resets a number of graphic state parameters, including the
+ color, line style, and other. This is necessary for technical
+ reasons.
+ \item It tells \tikzname\ that the content of the scope should be saved
+ internally in a special box.
+ \item It defines the command |\spy| so that it can be used inside
+ the scope.
+ \item At the end of the scope, the nodes belonging to the |\spy|
+ commands used inside the scope are created.
+ \item The \meta{options} are saved in an internal style. Each time
+ |\spy| is used, these \meta{options} will be used.
+ \item Three keys are defined that provide useful shortcuts:
+ \begin{key}{/tikz/size=\meta{dimension}}
+ Inside a |spy scope|, |size| this is a shortcut for |minimum size|.
+ \end{key}
+ \begin{key}{/tikz/height=\meta{dimension}}
+ Inside a |spy scope|, |height| this is a shortcut for |minimum height|.
+ \end{key}
+ \begin{key}{/tikz/width=\meta{dimension}}
+ Inside a |spy scope|, |width| this is a shortcut for |minimum width|.
+ \end{key}
+ \end{itemize}
+ It is permissible to nest |spy scopes|. In this case, all |\spy|
+ commands inside the inner |spy scope| only have an effect on
+ material inside the scope, whereas |\spy| commands outside the inner
+ |spy scope| but inside the outer |spy scope| allow you to ``spy on
+ the spy.''
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using outlines={rectangle, red, magnification=5,
+ size=1.5cm, connect spies}]
+
+ \begin{scope}
+ [spy using outlines={circle, blue,
+ magnification=3, size=1.5cm, connect spies}]
+ \draw [help lines] (0,0) grid (3,2);
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy on (1.6,0.3) in node (zoom) [left] at (3.5,-1.25);
+ \end{scope}
+
+ \spy on (zoom.north west) in node [right] at (0,-1.25);
+\end{tikzpicture}
+\end{codeexample}
+
+\end{key}
+
+
+
+\subsection{The Spy Command}
+
+\begin{command}{\spy \opt{\oarg{options}} |on| \meta{coordinate}
+ |in node| \meta{node options}|;|}
+ This command can only be used inside a |spy scope|. Let us start with the syntax:
+ \begin{itemize}
+ \item The |\spy| command is not a special case of |\path|. Rather,
+ it has a small parser of its own.
+ \item Following the optional \meta{options}, you must write |on|,
+ followed by a coordinate. This coordinate will be the center of
+ the area that is to be magnified.
+ \item Following the \meta{coordinate}, you must write |in node|
+ followed by some \meta{node options}. The syntax for these options is the same
+ as for a normal |node| path command, such as |[left]| or
+ |(foo) [red] at (bar)|. \emph{However}, \meta{node options} are
+ \emph{not} followed by a curly brace. Rather, the \meta{node
+ options} must directly be followed by a semicolon.
+ \end{itemize}
+ The effect of this command is the following: The \meta{options},
+ \meta{coordinate}, and \meta{node options} are stored internally
+ till the end of the current
+ |spy scope|. This means that, in particular, you can reference any node
+ inside the |spy scope|, even if it is not yet defined when the
+ |\spy| command is given. At the end of the current |spy scope|, two
+ nodes are created, called the \emph{spy-in node} and the
+ \emph{spy-on node}.
+ \begin{itemize}
+ \item The \emph{spy-in node} is the node that contains a magnified
+ part of the picture (the node \emph{in} which we see on what we
+ spy). This node is, indeed, a normal \tikzname\
+ node, so you can use all standard options to style this node. In
+ particular, you can specify a shape or a border color or a drop
+ shadow or whatever. The only thing that is special about this node
+ is that instead of containing some normal text, its ``text'' is
+ the magnified picture.
+
+ To be precise, the picture of the |spy scope| is scaled by a
+ certain factor, specified by the |lens| or |magnification| options
+ discussed below, and the shifted in such a way that the
+ \meta{coordinate} lies at the center of the spy-on node.
+ \item The \emph{spy-on node} is a node that is centered on the
+ \meta{coordinate} and whose size reflects exactly the area shown
+ inside the spy-in node (the node containing \emph{on} what we
+ spy).
+ \end{itemize}
+
+ Let us now go over what happens in detail when the two nodes are
+ created:
+ \begin{enumerate}
+ \item A scope is started. Two sets of options are used with this
+ scope: First, the options passed to the enclosing |spy scope| and
+ then the \meta{options} (which will, thus, overrule the options of
+ the |spy scope|).
+ \item Then, the spy-on node is created. However, we will first
+ discuss the spy-in node.
+ \item The spy-in node is created after the spy-on node (and, hence,
+ will cover the spy-on node in case they overlap). When this node is
+ created, the \meta{node options} are used in addition to the
+ effect caused by the \meta{options} and the options of the
+ |{spy scope}|. Additionally, the following style is used:
+ \begin{stylekey}{/tikz/every spy in node}
+ This style is used with every spy in node.
+ \end{stylekey}
+ The position of the node (the |at| option) is set to the
+ \meta{coordinate} by default, so that it will cover the
+ to-be-magnified area. You can change this by providing the |at|
+ option yourself:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using outlines={circle, magnification=3, size=1cm}]
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [red] on (1.6,0.3) in node;
+ \spy [blue] on (1,1) in node at (1,-1);
+\end{tikzpicture}
+\end{codeexample}
+ No ``text'' can be specified for the node. Rather, the ``text''
+ shown inside this node is the picture of the current |spy scope|,
+ but canvas-transformed according to the following key:
+ \begin{key}{/tikz/lens=\meta{options}}
+ The \meta{options} should contain transformation commands like
+ |scale| or |rotate|. These transformations are applied to the
+ picture when it is shown inside the spy-on node.
+ \end{key}
+ Since the most common transformation is undoubtedly a simple
+ scaling, there is a special style for this:
+ \begin{key}{/tikz/magnification=\meta{number}}
+ This has the same effect as saying
+ |lens={scale=|\meta{number}|}|.
+ \end{key}
+ Now, usually the size of a node is determined in such a way that
+ it ``fits'' around the text of the node. For a spy-on node this is
+ not a good approach since the ``text'' of this node would contain
+ ``the whole picture.'' Because of this, \tikzname\ acts
+ as if the ``text'' of the node has zero size. You must then use
+ keys like |minimum size| to cause the node to have a certain
+ size. Note that the key |size| is an abbreviation for
+ |minimum size| inside a spy scope.
+
+ You can name the spy on node in the usual ways. Additionally, the
+ node is (also) always named |tikzspyinnode|. Following the spy
+ scope, you can use this node like any other node:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{scope}
+ [spy using outlines={circle, magnification=3, size=2cm, connect spies}]
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [red] on (1.6,0.3) in node (a) [left] at (3.5,-1.25);
+
+ \spy [blue, size=1cm] on (1,1) in node (b) [right] at (0,-1.25);
+ \end{scope}
+ \draw [ultra thick, green!50!black] (b) -- (a.north west);
+\end{tikzpicture}
+\end{codeexample}
+
+ \item Once both nodes have been created, the current value of the
+ following key is used to connect them:
+ \begin{key}{/tikz/spy connection path=\meta{code} (initially
+ \normalfont empty)}
+ The \meta{code} is executed after the spy-on and spy-in nodes
+ have just been created. Inside this \meta{code}, the two nodes
+ can be accessed as |tikzspyinnode| and |tikzspyonnode|.
+ For example, the key |connect spies| sets this command to
+\begin{codeexample}[code only]
+\draw[thin] (tikzspyonnode) -- (tikzspyinnode);
+\end{codeexample}
+ \end{key}
+ \end{enumerate}
+ Returning to the creation of the spy-in node: This node is centered on
+ \meta{coordinate} (more precisely, its anchor is set to |center| and
+ the |at| option is set to \meta{coordinate}). Its size and shape are
+ initially determined in the same way as the size and shape of the
+ spy-on node (unless, of course, you explicitly provide a different
+ shape for, say, the spy-on node locally, which is not really a good
+ idea). Then, additionally, the \emph{inverted} transformation done
+ by the |lens| option is applied, resulting in a node whose size and
+ shape exactly corresponds to the area in the picture that is shown
+ in the spy-on node.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using outlines={lens={scale=3,rotate=20}, size=2cm, connect spies}]
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [red] on (1.6,0.3) in node at (2.5,-1.25);
+\end{tikzpicture}
+\end{codeexample}
+
+ Like for the spy-in node, a style can be used to format the spy-on
+ node:
+ \begin{stylekey}{/tikz/every spy on node}
+ This style is used with every spy on node.
+ \end{stylekey}
+ The spy-on node is named |tikzspyonnode| (but, as always, this node
+ is only available after the spy scope). If you have multiple
+ spy-on nodes and you would like to access all of them, you need to
+ use the |name| key inside the |every spy on node| style.
+
+ The |inner sep| and |outer sep| of both spy-in and spy-on nodes are
+ set to |0pt|.
+\end{command}
+
+
+
+\subsection{Predefined Spy Styles}
+
+There are some predefined styles that make using the |spy| library
+easier. The following two styles can be used instead of |spy scope|,
+they pass their \meta{options} directly to |spy scope|. They
+additionally setup the graphic styles to be used for the spy-in nodes
+and the spy-on nodes in some special way.
+
+\begin{key}{/tikz/spy using outlines=\meta{options} (default
+ \normalfont empty)}
+ This key creates a |spy scope| in which the spy-in node is drawn,
+ but not filled, using a thick line; and the spy-on node is drawn,
+ but not filled, using a very thin line.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using outlines={circle, magnification=3, size=1cm, connect spies}]
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [red] on (1.6,0.3) in node at (3,1);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/spy using overlays=\meta{options} (default
+ \normalfont empty)}
+ This key creates a |spy scope| in which both the spy-in and spy-on
+ nodes are filled, but with the fill opacity set to 20\%.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using overlays={circle, magnification=3, size=1cm, connect spies}]
+
+ \draw [decoration=Koch curve type 1]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [green] on (1.6,0.3) in node at (3,1);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+The following style is useful for connecting the spy-in and the spy-on
+nodes:
+
+\begin{key}{/tikz/connect spies}
+ Causes the spy-in and the spy-on nodes to be connected by a thin
+ line.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy using overlays={circle, magnification=3, size=1cm}]
+
+ \draw [decoration=Koch curve type 2]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [green] on (1.6,0.1) in node at (3,1);
+ \spy [red,connect spies] on (0.5,0.4) in node at (1,1.5);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+
+\subsection{Examples}
+
+Usually, the spy-in node and the spy-on node should have the same
+shape. However, you might also wish to use the |circle| shape for the
+spy-on node and the |magnifying glass| shape for the spy-in node:
+
+\begin{codeexample}[]
+\tikzset{spy using mag glass/.style={
+ spy scope={
+ every spy on node/.style={
+ circle,
+ fill, fill opacity=0.2, text opacity=1},
+ every spy in node/.style={
+ magnifying glass, circular drop shadow,
+ fill=white, draw, ultra thick, cap=round},
+ #1
+ }}}
+\begin{tikzpicture}[spy using mag glass={magnification=3, size=1cm}]
+ \draw [decoration=Koch curve type 2]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy [green!50!black] on (1.6,0.1) in node at (2.5,-0.5);
+\end{tikzpicture}
+\end{codeexample}
+
+With the magnifying glass, you can also put it ``on top'' of the
+picture itself:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [spy scope={magnification=4, size=1cm},
+ every spy in node/.style={
+ magnifying glass, circular drop shadow,
+ fill=white, draw, ultra thick, cap=round}]
+
+ \draw [decoration=Koch curve type 2]
+ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
+
+ \spy on (1.6,0.1) in node;
+\end{tikzpicture}
+\end{codeexample}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual-pdftex-version"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex
new file mode 100644
index 00000000000..cafe102caad
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex
@@ -0,0 +1,58 @@
+% Copyright 2009 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{SVG-Path Library}
+\label{section-library-svg-path}
+
+\begin{pgflibrary}{svg.path}
+ This library defines a command that allows you to specify a path
+ using the svg-syntax.
+\end{pgflibrary}
+
+\begin{command}{\pgfpathsvg\marg{path}}
+ This command extends the current path by a \meta{path} given in the
+ \textsc{svg}-path-data syntax. This syntax is described in detail in
+ Section~8.3 of the \textsc{svg}-specification, Version 1.1.
+
+ In principle, the complete syntax is supported and the library just
+ provides a parser and a mapping to basic layer commands. For
+ instance, |M 0 10| is mapped to
+ |\pgfpathmoveto{\pgfpoint{0pt}{10pt}}|. There, however, a few things
+ to be aware of:
+ \begin{itemize}
+ \item The computation underlying the arc commands |A| and |a|
+ are not numerically stable, which may result in quite imprecise
+ arcs. B\'ezier curves, both quadratic and cubic, are not affected,
+ and also not arcs spanning degrees that are multiples of
+ $90^\circ$.
+ \item The dimensionless units of \textsc{svg} are always interpreted
+ at points (|pt|). This is a problem with paths like |M 20000 0|,
+ which will raise an error message since \TeX\ cannot handle
+ dimensions larger than about 16000 points.
+ \item
+ All coordinate and canvas transformations apply to the path in the
+ usual fashion.
+ \item
+ The |\pgfpathsvg| command can be freely intermixed with other path
+ commands.
+ \end{itemize}
+\begin{codeexample}[]
+\begin{pgfpicture}
+ \pgfpathsvg{M 0 0 l 20 0 0 20 -20 0 q 10 0 10 10
+ t 10 10 10 10 h -50 z}
+ \pgfusepath{stroke}
+\end{pgfpicture}
+\end{codeexample}
+\end{command}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual-pdftex-version"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
index 1ed99fe963c..d95dd5e2106 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
@@ -14,12 +14,12 @@
\begin{tikzlibrary}{trees}
- This packages defines styles to be used when drawing trees.
+ This packages defines styles to be used when drawing trees.
\end{tikzlibrary}
\subsection{Growth Functions}
-The package |pgflibrarytikztrees| defines two new growth
+The package |trees| defines two new growth
functions. They are installed using the following options:
\begin{key}{/tikz/grow via three points=|one child at (|\meta{x}%
@@ -49,10 +49,10 @@ functions. They are installed using the following options:
\node at (0,-3) {three} child child child;
\node at (0,-4.5) {four} child child child child;
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
The next arrangement places children above, but ``grows only to the
- right.''
+ right.''
\begin{codeexample}[]
\begin{tikzpicture}[grow via three points={%
one child at (0,1) and two children at (0,1) and (1,1)}]
@@ -61,7 +61,7 @@ functions. They are installed using the following options:
\node at (0,-3) {three} child child child;
\node at (0,-4.5) {four} child child child child;
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
In the final arrangement, the children are placed along a line going
down and right.
@@ -106,13 +106,13 @@ functions. They are installed using the following options:
\end{key}
\begin{key}{/tikz/clockwise from=\meta{angle}}
- This option also cuases children to be arranged on a
+ This option also causes children to be arranged on a
circle. However, the rule for placing children is simpler than with
the |grow cyclic| style: The first child is placed at
\meta{angle} at a distance of |\tikzleveldistance|. The second child
is placed at the same distance from the parent, but at angle
\meta{angle}${}-{}$|\tikzsiblingangle|. The third child is displaced
- by another |\tikzsiblingangle| in a clockwise fashion, and so on.
+ by another |\tikzsiblingangle| in a clockwise fashion, and so on.
Note that this function will not rotate the coordinate system.
\begin{codeexample}[]
@@ -140,7 +140,7 @@ are drawn:
\begin{stylekey}{/tikz/edge from parent fork down}
This style will draw a line from the parent downwards (for half the
level distance) and then on to the child using only horizontal and
- vertical lines.
+ vertical lines.
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -171,15 +171,15 @@ are drawn:
\end{stylekey}
\begin{stylekey}{/tikz/edge from parent fork left}
- Behaves similary to the previous styles.
+ Behaves similarly to the previous styles.
\end{stylekey}
\begin{stylekey}{/tikz/edge from parent fork up}
- Behaves similary to the previous styles.
+ Behaves similarly to the previous styles.
\end{stylekey}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
new file mode 100644
index 00000000000..ffb35b231d4
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
@@ -0,0 +1,118 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\section{Turtle Graphics Library}
+\label{section-library-tutrle}
+
+
+\begin{pgflibrary}{turtle}
+ This little library defines some keys to create simple turtle
+ graphics in the tradition of the Logo programming language. These
+ commands are mostly for fun, but they can also be used for more
+ ``serious'' business.
+\begin{codeexample}[]
+\tikz[turtle/distance=2mm]
+ \draw [turtle={home,forward,right,forward,left,forward,left,forward}];
+\end{codeexample}
+\end{pgflibrary}
+
+Even though the |turtle| keys looks like an option, it uses the
+|insert path| option internally to produce a path.
+
+The basic drawing model behind the turtle graphics is very simple:
+There is a (virtual) \emph{turtle} that crawls around the page,
+thereby extending the path. The turtle always heads in a certain
+direction. When you move the turtle forward you extend the path in
+that direction; turning the turtle just changes the direction, it does
+not cause anything to be drawn.
+
+The turtle always moves relative to the last current point of the
+path and you can mix normal path commands with turtle
+commands. However, the direction of the turtle is managed
+independently of other path commands.
+
+\begin{key}{/tikz/turtle=\meta{keys}}
+ This key executes the \meta{keys} with the current key path set to
+ |/tikz/turtle|.
+\begin{codeexample}[]
+\tikz[turtle/distance=2mm]
+ \draw [turtle={home,fd,rt,fd,lt,fd,lt,fd}];
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/turtle/home}
+ Places the turtle at the origin and lets it head upward.
+\end{key}
+
+\begin{key}{/tikz/turtle/forward=\meta{distance} (default \normalfont see text)}
+ Makes the turtle move forward by the given \meta{distance}. If no
+ \meta{distance} is specified, the current value of the following key
+ is used:
+ \begin{key}{/tikz/turtle/distance=\meta{distance} (initially 1cm)}
+ The default distance by which the turtle advances.
+ \end{key}
+ ``Moving forward the turtle'' actually means that, relative to the
+ current last point on the path, a point at the given \meta{distance}
+ in the direction the turtle is currently heading is computed. Then,
+ the operation |to[turtle/how]| is used to extend the path to this
+ point.
+ \begin{stylekey}{/tikz/turtle/how (initially \normalfont empty)}
+ This style can setup the |to path| used by turtles. By setting
+ this style you can change the to-path:
+\begin{codeexample}[]
+\tikz \draw [turtle={how/.style={bend left},home,forward,right,forward}];
+\end{codeexample}
+ \end{stylekey}
+\end{key}
+
+\begin{key}{/tikz/turtle/fd}
+ An abbreviation for the |forward| key.
+\end{key}
+
+\begin{key}{/tikz/turtle/back=\meta{distance} (default \normalfont see text)}
+ This has the same effect as a |turtle/forward| for the negated
+ \meta{distance} value.
+\end{key}
+
+\begin{key}{/tikz/turtle/bk}
+ An abbreviation for the |back| key.
+\end{key}
+
+\begin{key}{/tikz/turtle/left=\meta{angle} (default 90)}
+ Turns the turtle left by the given angle.
+\end{key}
+
+\begin{key}{/tikz/turtle/lt}
+ An abbreviation for the |left| key.
+\end{key}
+
+\begin{key}{/tikz/turtle/right=\meta{angle} (default 90)}
+ Turns the turtle right by the given angle.
+\end{key}
+
+\begin{key}{/tikz/turtle/rt}
+ An abbreviation for the |right| key.
+\end{key}
+
+Turtle graphics are especially nice in conjunction with the |\foreach|
+statement:
+
+\begin{codeexample}[]
+\tikz \filldraw [thick,blue,fill=blue!20]
+ [turtle=home]
+ \foreach \i in {1,...,5}
+ {
+ [turtle={forward,right=144}]
+ };
+\end{codeexample}
+
+\endinput
+
+
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex
index 61c2ea6e288..14a3179e8e5 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex
@@ -40,16 +40,16 @@ All files in other directories are part of the ``code of the
package.'' A detailed listing can be found in the file
|doc/generic/pgf/licenses/manifest-code.txt|.
-In the resest of this section, the licenses are presented. The
+In the rest of this section, the licenses are presented. The
following text is copyrighted, see the plain text versions of these
-licenses in the directory |doc/generic/pgf/licenses| for details.
+licenses in the directory |doc/generic/pgf/licenses| for details.
The example picture used in this manual, the Brave \textsc{gnu} World
logo, is taken from the Brave \textsc{gnu} World homepage, where it is
copyrighted as follows: ``Copyright (C) 1999, 2000, 2001, 2002, 2003,
2004 Georg C.~F.\ Greve. Permission is granted to make and distribute
verbatim copies of this transcript as long as the copyright and this
-permission notice appear.''
+permission notice appear.''
\subsection{The GNU Public License, Version 2}
@@ -109,7 +109,7 @@ modification follow.
\addtocounter{enumi}{-1}
-\item
+\item
This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the
terms of this General Public License. The ``Program'', below, refers to
@@ -145,7 +145,7 @@ above, provided that you also meet all of these conditions:
\begin{enumerate}
-\item
+\item
You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
@@ -371,7 +371,7 @@ possibility of such damages.
% The file lppl.tex, some minor typographic changes:
%
-% $Id: pgfmanual-en-license.tex,v 1.4 2006/10/11 15:00:28 tantau Exp $
+% $Id: pgfmanual-en-license.tex,v 1.5 2010/10/12 14:32:38 ludewich Exp $
%
% Copyright 1999 2002-2006 LaTeX3 Project
% Everyone is allowed to distribute verbatim copies of this
@@ -399,7 +399,7 @@ possibility of such damages.
% \providecommand{\LPPLsubsubsection}{\subsection*}
% \providecommand{\LPPLparagraph}{\subsubsection*}
%
-%
+%
% To allow cross-referencing the headings \label's have been attached
% to them, all starting with ``LPPL:''. As by default headings without
% numbers are produced, this will only allow page references.
@@ -451,20 +451,20 @@ possibility of such damages.
\LPPLsubsection{Preamble}
\label{LPPL:Preamble}
-
+
The \LaTeX\ Project Public License (\LPPL) is the primary license
- under which the the \LaTeX\ kernel and the base \LaTeX\ packages are
+ under which the \LaTeX\ kernel and the base \LaTeX\ packages are
distributed.
You may use this license for any work of which you hold the
copyright and which you wish to distribute. This license may be
particularly suitable if your work is \TeX-related (such as a
- \LaTeX\ package), but it is written in such a way that you can use
+ \LaTeX\ package), but it is written in such a way that you can use
it even if your work is unrelated to \TeX.
- The section `\textsc{wheter and how to distribute works under this
+ The section `\textsc{whether and how to distribute works under this
license}', below, gives instructions, examples, and
- recommendations
+ recommendations
for authors who are considering distributing their works under this
license.
@@ -500,7 +500,7 @@ possibility of such damages.
\item[Modify] To apply any procedure that produces a Derived Work
under any applicable law.
-
+
\item[Distribution] Making copies of the Work available from one
person to another, in whole or in part. Distribution includes
(but is not limited to) making any electronic components of the
@@ -522,7 +522,7 @@ possibility of such damages.
\item[Base Interpreter] A program or process that is normally needed
for running or interpreting a part or the whole of the Work.
-
+
A Base Interpreter may depend on external components but these are
not considered part of the Base Interpreter provided that each
external component clearly identifies itself whenever it is used
@@ -583,13 +583,13 @@ possibility of such damages.
Derived Work clearly and unambiguously identifies itself as a
modified version of this component to the user when used
interactively with that Base Interpreter.
-
+
\item Every component of the Derived Work contains prominent
notices detailing the nature of the changes to that component,
or a prominent reference to another file that is distributed as
part of the Derived Work and that contains a complete and
accurate log of the changes.
-
+
\item No information in the Derived Work implies that any persons,
including (but not limited to) the authors of the original
version of the Work, provide any support, including (but not
@@ -629,7 +629,7 @@ possibility of such damages.
is then produced by applying some process to that format, does not
relax or nullify any sections of this license as they pertain to
the results of applying that process.
-
+
\item \null
\begin{enumerate}
\item A Derived Work may be distributed under a different license
@@ -637,7 +637,7 @@ possibility of such damages.
Clause~\ref{LPPL:item:conditions} above, in regard to the Work, though it
does not have to honor the rest of the conditions in this
license.
-
+
\item If a Derived Work is distributed under a different license,
that Derived Work must provide sufficient documentation as part
of itself to allow each recipient of that Derived Work to honor
@@ -711,7 +711,7 @@ possibility of such damages.
\begin{enumerate}
\item If it is being maintained, then ask the Current Maintainer
to update their communication data within one month.
-
+
\item\label{LPPL:item:intention} If the search is unsuccessful or
no action to resume active maintenance is taken by the Current
Maintainer, then announce within the pertinent community your
@@ -724,7 +724,7 @@ possibility of such damages.
\item If the Current Maintainer is reachable and agrees to pass
maintenance of the Work to you, then this takes effect
immediately upon announcement.
-
+
\item\label{LPPL:item:announce} If the Current Maintainer is not
reachable and the Copyright Holder agrees that maintenance of
the Work be passed to you, then this takes effect immediately
@@ -736,7 +736,7 @@ possibility of such damages.
Current Maintainer nor by the Copyright Holder nor by other
people, then you may arrange for the Work to be changed so as to
name you as the (new) Current Maintainer.
-
+
\item If the previously unreachable Current Maintainer becomes
reachable once more within three months of a change completed
under the terms of~\ref{LPPL:item:announce}
@@ -822,13 +822,13 @@ possibility of such damages.
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
- %
+ %
% The Current Maintainer of this work is M. Y. Name.
%
% This work consists of the files pig.dtx and pig.ins
% and the derived file pig.sty.
\end{verbatim}
-
+
Given such a notice and statement in a file, the conditions given in
this license document would apply, with the `Work' referring to the
three files `\LPPLfile{pig.dtx}', `\LPPLfile{pig.ins}', and
@@ -969,7 +969,7 @@ An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called \textbf{``Opaque''}.
Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
+ASCII without markup, Texinfo input format, LaTeX input format, SGML % Texinfo --> TeXinfo?
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
@@ -990,7 +990,7 @@ A section \textbf{``Entitled XYZ''} means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as \textbf{``Acknowledgements''},
-\textbf{``Dedications''}, \textbf{``Endorsements''}, or \textbf{``History''}.)
+\textbf{``Dedications''}, \textbf{``Endorsements''}, or \textbf{``History''}.)
To \textbf{``Preserve the Title''}
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
@@ -1064,43 +1064,43 @@ and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
\begin{itemize}
-\item[A.]
+\item[A.]
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
-
+
\item[B.]
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
-
+
\item[C.]
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
-
+
\item[D.]
Preserve all the copyright notices of the Document.
-
+
\item[E.]
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
-
+
\item[F.]
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
-
+
\item[G.]
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
-
+
\item[H.]
Include an unaltered copy of this License.
-
+
\item[I.]
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
@@ -1109,7 +1109,7 @@ of it. In addition, you must do these things in the Modified Version:
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
-
+
\item[J.]
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
@@ -1118,26 +1118,26 @@ of it. In addition, you must do these things in the Modified Version:
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
-
+
\item[K.]
For any section Entitled ``Acknowledgements'' or ``Dedications'',
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
-
+
\item[L.]
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
-
+
\item[M.]
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
-
+
\item[N.]
Do not retitle any existing section to be Entitled ``Endorsements''
or to conflict in title with any Invariant Section.
-
+
\item[O.]
Preserve any Warranty Disclaimers.
\end{itemize}
@@ -1296,7 +1296,7 @@ license notices just after the title page:
Free Documentation License''.
\end{quote}
\bigskip
-
+
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with \dots\ Texts.'' line with this:
@@ -1304,10 +1304,10 @@ replace the ``with \dots\ Texts.'' line with this:
\begin{quote}
with the Invariant Sections being \textsc{list their titles}, with the
Front-Cover Texts being \textsc{list}, and with the Back-Cover
- Texts being \textsc{list}.
+ Texts being \textsc{list}.
\end{quote}
\bigskip
-
+
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
@@ -1319,7 +1319,7 @@ to permit their use in free software.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "beameruserguide"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex
index 0384b1a2d32..9b4ba330dd4 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex
@@ -9,52 +9,92 @@
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% generic/pgf/utilities/pgfrcs.code.tex
\def\xcolorversion{2.00}
\usepackage[version=latest]{pgf}
-\usepackage{xkeyval,calc,listings,tikz}
+\usepackage{xkeyval,calc,listings,tikz,fp}
+
+\usepackage{hyperref}
+\hypersetup{%
+ colorlinks=true, % use true to enable colors below:
+ linkcolor=blue,%red,
+ filecolor=blue,%magenta,
+ pagecolor=blue,%red,
+ urlcolor=blue,%cyan,
+ citecolor=blue,
+ pdfborder=0 0 0,
+}
% We need lots of libraries...
-\usetikzlibrary{%
- arrows,%
- calc,%
- fit,%
- patterns,%
- plotmarks,%
- shapes.geometric,%
- shapes.misc,%
- shapes.symbols,%
- shapes.arrows,%
- shapes.callouts,%
- shapes.multipart,%
- shapes.gates.logic.US,%
- shapes.gates.logic.IEC,%
- er,%
- automata,%
- backgrounds,%
- chains,%
- topaths,%
- trees,%
- petri,%
- mindmap,%
- matrix,%
- calendar,%
- folding,%
- fadings,%
- through,%
- positioning,%
- scopes,%
- decorations.fractals,%
- decorations.shapes,%
- decorations.text,%
- decorations.pathmorphing,%
- decorations.pathreplacing,%
- decorations.footprints,%
- decorations.markings,%
- shadows}
+\usetikzlibrary{
+ arrows,
+ calc,
+ fit,
+ patterns,
+ plotmarks,
+ shapes.geometric,
+ shapes.misc,
+ shapes.symbols,
+ shapes.arrows,
+ shapes.callouts,
+ shapes.multipart,
+ shapes.gates.logic.US,
+ shapes.gates.logic.IEC,
+ circuits.logic.US,
+ circuits.logic.IEC,
+ circuits.logic.CDH,
+ circuits.ee.IEC,
+ datavisualization,
+ datavisualization.formats.functions,
+ er,
+ automata,
+ backgrounds,
+ chains,
+ topaths,
+ trees,
+ petri,
+ mindmap,
+ matrix,
+ calendar,
+ folding,
+ fadings,
+ shadings,
+ spy,
+ through,
+ turtle,
+ positioning,
+ scopes,
+ decorations.fractals,
+ decorations.shapes,
+ decorations.text,
+ decorations.pathmorphing,
+ decorations.pathreplacing,
+ decorations.footprints,
+ decorations.markings,
+ shadows,
+ lindenmayersystems,
+ intersections,
+ fixedpointarithmetic,
+ fpu,
+ svg.path,
+ external,
+}
+
+\iffalse
+%\iftrue
+ \tikzexternalize[
+ mode=list only,export=true,% simply skips EVERY picture -> good for debugging the text.
+ ]
+ {pgfmanual}
+
+ \tikzifexternalizing{%
+ \pgfkeys{/pdflinks/codeexample links=false}%
+ }{}%
+\fi
+
\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
\usepackage{amsmath,amssymb}
@@ -64,7 +104,8 @@
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
-\input{../../macros/pgfmanual-en-macros}
+\graphicspath{{../../images/}} % TODOsp: under windows this would go up 2 directories, but the file is only one directory up
+\input{../../macros/pgfmanual-en-macros} % TODOsp: same here
\makeindex
@@ -73,7 +114,7 @@
\renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.2em}}
\makeatother
-%\includeonly{}
+%\includeonly{pgfmanual-en-library-profiler}
% Global styles:
\tikzset{
@@ -94,21 +135,29 @@
\index{File|see{Packages and files}}
\index{Layout|see{Page layout}}
\index{Node|see{Predefined node}}
+\index{Data formats|see{Formats}}
\begin{document}
-%\include{pgfmanual-en-base-decorations}
-%\end{document}
+%\include{pgfmanual-en-dv-introduction}
+%\include{pgfmanual-en-dv-main}
+%\include{pgfmanual-en-dv-axes}
+%\include{pgfmanual-en-dv-visualizers}
+%\include{pgfmanual-en-dv-examples}
+%\include{pgfmanual-en-dv-formats}
+%\include{pgfmanual-en-dv-backend}
+%\end{document}
% The titlepage
+\newbox\mybox
{
\parindent0pt
\null
\colorlet{mintgreen}{green!50!black!50}
-
+
\thispagestyle{empty}
\vskip3cm
\vfill
@@ -120,7 +169,7 @@
\coordinate (sky) at (0,.57\paperheight);
\coordinate (left) at (-.51\paperwidth,0);
\coordinate (right) at (.51\paperwidth,0);
-
+
\shade [bottom color=blue!30!black!10,top color=blue!30!black!50]
([yshift=-5mm]horizon -| left) rectangle (sky -| right);
\shade [bottom color=black!70!green!25,top color=black!70!green!10]
@@ -131,20 +180,28 @@
([yshift=-5mm-1pt]front -| left) rectangle ([yshift=1pt]front -| right);
\fill [black!25] (bottom -| left) rectangle ([yshift=-5mm]front -| right);
- \def\nodeshadowed[#1]#2;{\node[scale=2,above,#1]{#2};\node[scale=2,above,#1,yscale=-1,scope fading=south,opacity=0.4]{#2};}
+ \def\nodeshadowed[#1]#2;{\node[scale=2,above,#1]{\global\setbox\mybox=\hbox{#2}\copy\mybox};
+ \node[scale=2,above,#1,yscale=-1,scope fading=south,opacity=0.4]{\box\mybox};}
\nodeshadowed [at={(-5,5 )},yslant=0.05] {\Huge Ti\textcolor{orange}{\emph{k}}Z};
\nodeshadowed [at={( 0,5.3)}] {\huge \textcolor{mintgreen}{\&}};
\nodeshadowed [at={( 5,5 )},yslant=-0.05] {\Huge \textsc{PGF}};
\nodeshadowed [at={( 0,2 )}] {Manual for Version \pgftypesetversion};
+ \foreach \where in {-9cm,9cm}
+ {\nodeshadowed [at={(\where,5cm)}] {
+ \tikz \draw [green!20!black, rotate=90]
+ [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4,
+ step=2pt, randomize step percent=50, angle=30, randomize angle percent=5}]
+ lindenmayer system;};}
+
\foreach \i in {0.5,0.6,...,2}
\fill [white,decoration=Koch snowflake,opacity=.9]
[shift=(horizon),shift={(rand*11,rnd*7)},scale=\i]
[double copy shadow={opacity=0.2,shadow xshift=0pt,shadow
yshift=3*\i pt,fill=white,draw=none}]
- decorate {
- decorate {
+ decorate {
+ decorate {
decorate {
(0,0) -- ++(60:1) -- ++(-60:1) -- cycle
}
@@ -169,19 +226,19 @@
\coordinate (sky) at (0,.57\paperheight);
\coordinate (left) at (-.51\paperwidth,0);
\coordinate (right) at (.51\paperwidth,0);
-
+
\shade [bottom color=white,
top color=blue!30!black!50]
([yshift=-5mm]horizon -| left)
rectangle (sky -| right);
-
+
\shade [bottom color=black!70!green!25,
top color=black!70!green!10]
(front -| left) -- (horizon -| left)
decorate [decoration=random steps] {
-- (horizon -| right) }
-- (front -| right) -- cycle;
-
+
\shade [top color=black!70!green!25,
bottom color=black!25]
([yshift=-5mm-1pt]front -| left)
@@ -190,11 +247,13 @@
\fill [black!25]
(bottom -| left)
rectangle ([yshift=-5mm]front -| right);
-
+
\def\nodeshadowed[#1]#2;{
- \node[scale=2,above,#1]{#2};
+ \node[scale=2,above,#1]{
+ \global\setbox\mybox=\hbox{#2}
+ \copy\mybox};
\node[scale=2,above,#1,yscale=-1,
- scope fading=south,opacity=0.4]{#2};
+ scope fading=south,opacity=0.4]{\box\mybox};
}
\end{lstlisting}
};
@@ -219,6 +278,14 @@
\nodeshadowed [at={( 0,5 )}]
{Manual for Version \pgftypesetversion};
+ \foreach \where in {-9cm,9cm} {
+ \nodeshadowed [at={(\where,5cm)}] { \tikz
+ \draw [green!20!black, rotate=90,
+ l-system={rule set={F -> FF-[-F+F]+[+F-F]},
+ axiom=F, order=4,step=2pt,
+ randomize step percent=50, angle=30,
+ randomize angle percent=5}] l-system; }}
+
\foreach \i in {0.5,0.6,...,2}
\fill
[white,opacity=\i/2,
@@ -226,38 +293,27 @@
shift=(horizon),shift={(rand*11,rnd*7)},
scale=\i,double copy shadow={
opacity=0.2,shadow xshift=0pt,
- shadow yshift=3*\i pt,
- fill=white,draw=none}]
+ shadow yshift=3*\i pt,fill=white,draw=none}]
decorate {
- decorate {
- decorate {
+ decorate {
+ decorate {
(0,0)- ++(60:1) -- ++(-60:1) -- cycle
} } };
\node (left text) ...
\node (right text) ...
- \fill [decorate,
- decoration={footprints,foot of=gnome},
- opacity=.5,brown] (left text.south)
- to [out=-45,in=135] (right text.north);
- \fill [decorate,
- decoration={footprints,foot of=felis silvestris,
- foot length=5pt,stride length=15pt,foot angle=0},
- opacity=.5,green!50!black] (left text.south)
- to [out=20,in=180] (right text.north west);
+ \fill [decorate,decoration={footprints,foot of=gnome},
+ opacity=.5,brown] (rand*8,-rnd*10)
+ to [out=rand*180,in=rand*180] (rand*8,-rnd*10);
\end{tikzpicture}
\end{lstlisting}
};
\fill [decorate,decoration=footprints,
decoration={footprints,foot of=gnome},
- opacity=.5,brown] (left text.south)
- to [out=-45,in=135] (right text.north);
- \fill [decorate,decoration={footprints,foot length=5pt,foot of=felis
- silvestris,stride length=15pt,foot angle=0},
- opacity=.5,green!50!black] (left text.south)
- to [out=20,in=180] (right text.north west);
+ opacity=.5,brown] (rand*8,-rnd*10)
+ to [out=rand*180,in=rand*180] (rand*8,-rnd*10);
\end{tikzpicture}
\vfill
\vbox{}
@@ -276,7 +332,7 @@
\parindent=0pt
Copyright 2007 by Till Tantau
- \medskip
+ \medskip
Permission is granted to copy, distribute and/or modify \emph{the documentation}
under the terms of the \textsc{gnu} Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
@@ -284,19 +340,19 @@
A copy of the license is included in the section entitled \textsc{gnu}
Free Documentation License.
- \medskip
+ \medskip
Permission is granted to copy, distribute and/or modify \emph{the
code of the package} under the terms of the \textsc{gnu} Public License, Version 2
or any later version published by the Free Software Foundation.
A copy of the license is included in the section entitled \textsc{gnu}
Public License.
- \medskip
+ \medskip
Permission is also granted to distribute and/or modify \emph{both
the documentation and the code} under the conditions of the LaTeX
Project Public License, either version 1.3 of this license or (at
your option) any later version. A copy of the license is included in
- the section entitled \LaTeX\ Project Public License.
+ the section entitled \LaTeX\ Project Public License.
\vbox{}
\clearpage
@@ -333,7 +389,7 @@ and configuration section, this manual starts with tutorials. They
explain all the basic and some of the more advanced features of the
system, without going into all the details. This part also contains
some guidelines on how you should proceed when creating graphics using
-\tikzname.
+\tikzname.
\vskip3cm
@@ -346,6 +402,7 @@ some guidelines on how you should proceed when creating graphics using
\include{pgfmanual-en-tutorial-nodes}
\include{pgfmanual-en-tutorial-Euclid}
\include{pgfmanual-en-tutorial-chains}
+\include{pgfmanual-en-tutorial-map}
\include{pgfmanual-en-guidelines}
@@ -360,7 +417,7 @@ some guidelines on how you should proceed when creating graphics using
This part explains how the system is installed. Typically, someone has
already done so for your system, so this part can be skipped; but if
this is not the case and you are the poor fellow who has to do the
-installation, read the present part.
+installation, read the present part.
\vskip1cm
@@ -377,10 +434,10 @@ installation, read the present part.
\path (A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
- (B) edge [loop above] node {1,1,L} (B)
+ (B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
- edge [bend left] node {1,0,R} (E)
+ edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
@@ -430,7 +487,7 @@ installation, read the present part.
\draw (60:-1cm) node[fill=white] {$E$} -- (60:3cm) node[fill=white] {$F$};
\draw[red] (-2,0) node[left] {$A$} -- (3,0) node[right]{$B$};
\draw[blue,shift={(60:2cm)}] (-3,0) node[left] {$C$} -- (2,0) node[right]{$D$};
-
+
\draw[shift={(60:1cm)},xshift=4cm]
node [right,text width=6cm,rounded corners,fill=red!20,inner sep=1ex]
{
@@ -471,13 +528,13 @@ In this part the library packages are documented. They
provide additional predefined graphic objects like new arrow heads or
new plot marks, but also sometimes extensions of the basic \pgfname\
or \tikzname\ system. The libraries are not loaded by default since
-many users will not need them.
+many users will not need them.
\medskip
\noindent
\begin{codeexample}[graphic=white]
\tikzset{
- ld/.style={level distance=#1},lw/.style={line width=#1},
+ ld/.style={level distance=#1},lw/.style={line width=#1},
level 1/.style={ld=4.5mm, trunk, lw=1ex ,sibling angle=60},
level 2/.style={ld=3.5mm, trunk!80!leaf a,lw=.8ex,sibling angle=56},
level 3/.style={ld=2.75mm,trunk!60!leaf a,lw=.6ex,sibling angle=52},
@@ -490,7 +547,7 @@ many users will not need them.
{
\pgfpathmoveto{\pgfpoint{-2pt}{0pt}}
\pgfpatharc{150}{30}{1.8pt}
- \pgfpatharc{-30}{-150}{1.8pt}
+ \pgfpatharc{-30}{-150}{1.8pt}
\pgfusepathqfill
}
@@ -519,7 +576,7 @@ many users will not need them.
} edge from parent [shorten >=-1pt,serif cm-,line cap=butt]
};
- \node [text centered,text width=2cm,below] at (0pt,-.5ex)
+ \node [align=center,below] at (0pt,-.5ex)
{ \textcolor{border}{T}heoretical \\ \textcolor{border}{C}omputer \\
\textcolor{border}{S}cience };
\end{tikzpicture}
@@ -535,12 +592,18 @@ many users will not need them.
\include{pgfmanual-en-library-arrows}
\include{pgfmanual-en-library-automata}
\include{pgfmanual-en-library-backgrounds}
+\include{pgfmanual-en-library-calc}
\include{pgfmanual-en-library-calendar}
\include{pgfmanual-en-library-chains}
+\include{pgfmanual-en-library-circuits}
\include{pgfmanual-en-library-decorations}
\include{pgfmanual-en-library-er}
+\include{pgfmanual-en-library-external}
\include{pgfmanual-en-library-fadings}
\include{pgfmanual-en-library-fit}
+\include{pgfmanual-en-library-fixedpoint}
+\include{pgfmanual-en-library-fpu}
+\include{pgfmanual-en-library-lsystems}
\include{pgfmanual-en-library-matrices}
\include{pgfmanual-en-library-mindmaps}
\include{pgfmanual-en-library-folding}
@@ -548,15 +611,40 @@ many users will not need them.
\include{pgfmanual-en-library-petri}
\include{pgfmanual-en-library-plot-handlers}
\include{pgfmanual-en-library-plot-marks}
+\include{pgfmanual-en-library-profiler}
+\include{pgfmanual-en-library-shadings}
\include{pgfmanual-en-library-shadows}
\include{pgfmanual-en-library-shapes}
-%\include{pgfmanual-en-library-3d}
+\include{pgfmanual-en-library-spy}
+\include{pgfmanual-en-library-svg-path}
\include{pgfmanual-en-library-edges}
\include{pgfmanual-en-library-through}
\include{pgfmanual-en-library-trees}
+\include{pgfmanual-en-library-turtle}
+\iffalse
+\part{Data Visualization}
+\label{part-dv}
+
+{\Large \emph{by Till Tantau}}
+
+\bigskip
+\noindent
+The documentation of the data visualization is still missing. This
+stuff is still ``heavily under construction.''
+
+\include{pgfmanual-en-dv-introduction}
+\include{pgfmanual-en-dv-main}
+\include{pgfmanual-en-dv-axes}
+\include{pgfmanual-en-dv-visualizers}
+\include{pgfmanual-en-dv-examples}
+\include{pgfmanual-en-dv-formats}
+\include{pgfmanual-en-dv-backend}
+
+\fi
+
\part{Utilities}
\label{part-utilities}
@@ -578,7 +666,7 @@ depend on \pgfname\ or they are designed to work well together with
\begin{tikzpicture}[scale=2]
\shade[top color=blue,bottom color=gray!50] (0,0) parabola (1.5,2.25) |- (0,0);
\draw (1.05cm,2pt) node[above] {$\displaystyle\int_0^{3/2} \!\!x^2\mathrm{d}x$};
-
+
\draw[help lines] (0,0) grid (3.9,3.9)
[step=0.25cm] (1,2) grid +(1,1);
@@ -590,7 +678,7 @@ depend on \pgfname\ or they are designed to work well together with
\foreach \y/\ytext in {1/1, 2/2, 2.25/2\frac{1}{4}, 3/3}
\draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$};
-
+
\draw (-.5,.25) parabola bend (0,0) (2,4) node[below right] {$x^2$};
\end{tikzpicture}
\end{codeexample}
@@ -600,25 +688,34 @@ depend on \pgfname\ or they are designed to work well together with
\include{pgfmanual-en-pgfcalendar}
\include{pgfmanual-en-pages}
\include{pgfmanual-en-xxcolor}
+\include{pgfmanual-en-module-parser}
-\part{Mathematical Engine}
+\part{Mathematical and Object-Oriented Engines}
{\Large \emph{by Mark Wibrow and Till Tantau}}
\bigskip
\noindent
-\pgfname\ comes with its own mathematical engine. The job of this
+\pgfname\ comes with two useful engines: One for doing mathematics,
+one for doing object-oriented programming. Both engines can be used
+independently of the main \pgfname.
+
+The job of the mathematical
engine is to support mathematical operations like addition,
-subtraction, multiplication and division, using both integers and
+subtraction, multiplication and division, using both integers and
non-integers, but also functions such as square-roots, sine, cosine,
and generate pseudo-random numbers.
-
Mostly, you will use the mathematical facilities of \pgfname\
indirectly, namely when you write a coordinate like |(5cm*3,6cm/4)|,
but the mathematical engine can also be used independently of
-\pgfname\ and \tikzname.
+\pgfname\ and \tikzname.
+
+The job of the object-oriented engine is to support simple
+object-oriented programming in \TeX. It allows the definition of
+\emph{classes} (without inheritance), \emph{methods},
+\emph{attributes} and \emph{objects}.
\vskip1cm
\begin{codeexample}[graphic=white]
@@ -629,7 +726,7 @@ but the mathematical engine can also be used independently of
\coordinate (current point) at (0,0);
\coordinate (old velocity) at (0,0);
\coordinate (new velocity) at (rand,rand);
-
+
\foreach \i in {0,1,...,100}
{
\draw[\col!\i] (current point)
@@ -647,6 +744,8 @@ but the mathematical engine can also be used independently of
\include{pgfmanual-en-math-parsing}
\include{pgfmanual-en-math-commands}
\include{pgfmanual-en-math-algorithms}
+\include{pgfmanual-en-math-numberprinting}
+\include{pgfmanual-en-oo}
\part{The Basic Layer}
@@ -662,7 +761,7 @@ but the mathematical engine can also be used independently of
\draw[gray,very thin] (-1.9,-1.9) grid (2.9,3.9)
[step=0.25cm] (-1,-1) grid (1,1);
\draw[blue] (1,-2.1) -- (1,4.1); % asymptote
-
+
\draw[->] (-2,0) -- (3,0) node[right] {$x(t)$};
\draw[->] (0,-2) -- (0,4) node[above] {$y(t)$};
@@ -696,12 +795,13 @@ but the mathematical engine can also be used independently of
\include{pgfmanual-en-base-matrices}
\include{pgfmanual-en-base-transformations}
\include{pgfmanual-en-base-patterns}
-%\include{pgfmanual-en-base-images}
+\include{pgfmanual-en-base-images}
\include{pgfmanual-en-base-external}
\include{pgfmanual-en-base-plots}
\include{pgfmanual-en-base-layers}
\include{pgfmanual-en-base-shadings}
\include{pgfmanual-en-base-transparency}
+\include{pgfmanual-en-base-internalregisters}
\include{pgfmanual-en-base-quick}
@@ -717,7 +817,7 @@ but the mathematical engine can also be used independently of
\noindent
This part describes the low-level interface of \pgfname, called the
\emph{system layer}. This interface provides a complete abstraction of
-the internals of the underlying drivers.
+the internals of the underlying drivers.
Unless you intend to port \pgfname\ to another driver or unless you intend
to write your own optimized frontend, you need not read this part.
@@ -731,18 +831,18 @@ workings of the |graphics| package and that you know what
\begin{tikzpicture}
[shorten >=1pt,->,
vertex/.style={circle,fill=black!25,minimum size=17pt,inner sep=0pt}]
-
+
\foreach \name/\x in {s/1, 2/2, 3/3, 4/4, 15/11, 16/12, 17/13, 18/14, 19/15, t/16}
\node[vertex] (G-\name) at (\x,0) {$\name$};
\foreach \name/\angle/\text in {P-1/234/5, P-2/162/6, P-3/90/7, P-4/18/8, P-5/-54/9}
\node[vertex,xshift=6cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$};
-
+
\foreach \name/\angle/\text in {Q-1/234/10, Q-2/162/11, Q-3/90/12, Q-4/18/13, Q-5/-54/14}
\node[vertex,xshift=9cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$};
\foreach \from/\to in {s/2,2/3,3/4,3/4,15/16,16/17,17/18,18/19,19/t}
- \draw (G-\from) -- (G-\to);
+ \draw (G-\from) -- (G-\to);
\foreach \from/\to in {1/2,2/3,3/4,4/5,5/1,1/3,2/4,3/5,4/1,5/2}
{ \draw (P-\from) -- (P-\to); \draw (Q-\from) -- (Q-\to); }
@@ -785,11 +885,12 @@ workings of the |graphics| package and that you know what
\printindex
+%\typeout{Examples: \the\codeexamplecount}%
\end{document}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "~/texmf/tex/generic/pgf/doc/pgf/version-for-pdftex/en/pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
index c4cf989f55e..8f6f1639b0c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
@@ -8,74 +8,198 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section[Reimplementing the Computations of the Mathematical Engine]
- {Reimplementing the Computations of the\\ Mathematical Engine}
+\section{Customizing the Mathematical Engine}
\label{pgfmath-reimplement}
-Perhaps you are not satisfied with the Maclaurin series for
-$e^x$. Perhaps you have a fantastically more accurate
-and efficient way of calculating the sine or cosine of angles. Perhaps
- you would like the library to interface with a package such as |fp|
- for fixed-point arithmetic (but you may find that exclusively
- using |fp| can cause a significant increase in compile time for
- documents involving many hundreds of calculations).
-In these cases you will want to replace the current implementations of
-the computations done by the mathematical engine by your own code.
-
-The mathematical engine was designed with such a replacement in
-mind. For this reason, the operations and functions like |\pgfmathadd|
-are implemented in the following manner:
-
-\begin{itemize}
-\item |\pgfmath|\meta{function name}
-
- This macro is the ``public'' interface for the function
- \meta{function name}. All arguments passed to this macro are
- evaluated using |\pgfmathparse| and then passed on to the following
- function:
-
-\item |\pgfmath|\meta{function name}|@|
-
- This macro is the ``non-public'' implementation of the functions
- algorithm (but note that, for speed, the parser calls this macro
- rather than the ``public'' one). Arguments passed to this macro
- are expected to be numbers \emph{without units}. This is the macro
- which should be rewritten with your prize-winning new algorithm.
-
- Note, furthermore, that if the function takes more than one
- argument, the second argument should not involve the dimensions
- |\pgfmath@x| nor |\pgfmath@xa| nor |\pgf@x| nor |\pgf@xa| since
- these may be set to the value of the first argument when the
- second argument is parsed.
-\end{itemize}
-
-The effect of |\pgfmath|\meta{function name}|@| should be to set the
-macro |\pgfmathresult| to the correct value (namely to the result of
-the computation without units). Furthermore, the function should have
-no other side effects, that is, it should not change any global
-values. One way to achieve this is to use the following code:
-
-\begin{codeexample}[code only]
-\def\pgfmath...@#1#2...{%
- \begingroup%
- ... code for algorithm ...
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
+
+Perhaps you have a desire for some function that \pgfname\ does not
+provide. Perhaps you are not happy with the accuracy or efficiency of
+some of the algorithms that are implemented in \pgfname. In these
+cases you will want to add a function to the parser or replace the
+current implementations of the algorithms with your own code.
+
+The mathematical engine was designed with such customization in mind.
+It is possible to add new functions, or modify the code for
+existing functions. Note, however, that whilst adding new operators
+is possible, it can be a rather tricky business and is only
+recommended for adventurous users.
+
+To add a new function to the math engine the following command can be
+used:
+
+\begin{command}{\pgfmathdeclarefunction\marg{function name}\marg{number of arguments}\marg{code}}
+
+ This will set up the parser to recognize a function called
+ \meta{name}. The name of the function can consist of, uppercase or
+ lower case letters, numbers or the underscore |_|. In line with
+ many programming languages, a function name cannot begin with a
+ number or contain any spaces.
+
+ The \meta{number of arguments} can be any positive integer, zero,
+ or the value |...|, which indicates a variable number of
+ arguments. \pgfname{} treats constants, such as |pi| and |e|, as
+ functions with zero arguments. Functions with more than nine
+ arguments or with variable arguments are a ``bit special'' and
+ are discussed below.
+
+ The effect of \meta{code} should be to set the macro
+ |\pgfmathresult| to the correct value (namely to the result of the
+ computation without units). Furthermore, the function should have
+ no other side effects, that is, it should not change any global
+ values. As an example, consider the creation of a new function
+ |double|, which takes one argument, and returns the value of that
+ argument times two.
+
+\begin{codeexample}[]
+\makeatletter
+\pgfmathdeclarefunction{double}{1}{
+ \begingroup
+ \pgf@x=#1pt\relax
+ \multiply\pgf@x by2\relax
+ \pgfmathreturn\pgf@x
+ \endgroup
}
+\makeatother
+\pgfmathparse{double(44.3)}\pgfmathresult
\end{codeexample}
+ The macro |\pgfmathreturn|\meta{tokens} must be
+ directly followed by an |\endgroup| and will save the result of the
+ computation, by defining |\pgfmathresult| as the expansion of
+ \meta{tokens} (without units) outside the group, so \meta{tokens}
+ must be something that can be assigned to a dimension register.
+
+ Alternatively, the |\pgfmathsmuggle|\meta{macro} can be used. This
+ must also be directly followed by an |\endgroup| and will simply
+ ``smuggle'' the definition of \meta{macro} outside the \TeX-group.
+
+ By performing computations within a \TeX-group, \pgfname{}
+ registers such as |\pgf@x|, |\pgf@y| and |\c@pgf@counta|,
+ |\c@pgfcountb|, and so forth, can be used at will.
+
+ Beyond setting up the parser, this command also defines two macros
+ which provide access to the function independently of the parser:
+
+ \begin{itemize}
+ \item
+ |\pgfmath|\meta{function name}
+
+ This macro will provide ``public'' interface for the function
+ \meta{function name} allowing the function to be called
+ independently of the parser. All arguments passed to this macro are
+ evaluated using |\pgfmathparse| and then passed on to the following
+ macro:
+
+ \item
+ |\pgfmath|\meta{function name}|@|
+
+ This macro is the ``private'' implementation of the functions
+ algorithm (but note that, for speed, the parser calls this macro
+ rather than the ``public'' one). Arguments passed to this macro
+ are expected to be numbers without units. It is defined using
+ \meta{code}, but need not be self contained.
+
+ \end{itemize}
+
+ For functions that are declared with less than ten arguments,
+ the public macro is defined in the same way as normal \TeX{}
+ macros using, for example, |\def\pgfmathNoArgs{|\meta{code}|}|
+ for a function with no arguments, or
+ |\def\pgfmathThreeArgs#1#2#3{|\meta{code}|}| for a function with
+ three arguments.
+ The private macro is defined in the same way, and each argument
+ can therefore be accessed in \meta{code}
+ using |#1|, |#2| and so on.
-The macro |\pgfmath@returnone|\meta{code} must be directly followed by an
-|\endgroup| and will save result of the algorithm, by defining
-|\pgfmathresult| as the expansion of \meta{code} \emph{without units}
-outside the group. The \meta{code} should expand to a dimension
-register or to a dimension. By performing the algorithm within a
-\TeX{} group, \pgfname{} registers such as |\pgf@x|, |\pgf@y| and
-|\c@pgf@counta|, |\c@pgfcountb|, and so forth, can be used at will.
+ For functions with more than nine arguments, or functions with
+ a variable number of arguments, these macros are only
+ defined as taking \emph{one} argument. The public macro
+ expects its arguments to be comma separated, for example,
+ |\pgfmathVariableArgs{1.1,3.5,-1.5,2.6}|. Each
+ argument is parsed and
+ passed on to the private macro as follows:
+ |\pgfmathVariableArgs@{{1.1}{3.5}{-1.5}{2.6}}|.
+ This means that some ``extra work'' will be required to access
+ each argument (although it is a fairly simple task).
+
+ Note, that there are, two exceptions to this arrangement:
+ the public versions of the |min| and |max| functions still
+ take two arguments for compatibility with older versions, but
+ each of these arguments can take several comma separated values.
+
+
+
+
+\end{command}
+
+ To redefine a function use the following command:
+
+\begin{command}{\pgfmathredeclarefunction\marg{function name}\marg{algorithm code}}
+
+ This command redefines the |\pgfmath|\meta{function name}|@| macro
+ with the new \meta{algorithm code}. See the description of the
+ |\pgfmathdeclarefunction| for details. You cannot change the number
+ of arguments for an existing function.
+
+\end{command}
+
+ \pgfname{} uses the last known definition of a function within the
+ prevailing scope, so it is possible for a function to be redefined
+ locally. You should also remember that any |.sty| or |.tex| file
+ containing any re-implementations should be loaded after pgf-Math.
+
+ In addition to the above commands, the following key is provided to
+ quickly create simple ad hoc functions which can greatly improve
+ the readability of code, and is particularly useful in \tikzname{}:
+
+\begin{key}{/pgf/declare function=\meta{function definitions}}
+ This key allows simple functions to be created locally. Its use
+ is perhaps best illustrated by an example:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [help lines] (0,0) grid (3,2);
+ \draw [blue, thick, x=0.0085cm, y=1cm,
+ declare function={
+ sines(\t,\a,\b)=1 + 0.5*(sin(\t)+sin(\t*\a)+sin(\t*\b));
+ }]
+ plot [domain=0:360, samples=144, smooth] (\x,{sines(\x,3,5)});
+\end{tikzpicture}
+\end{codeexample}
+
+ Each definition in \meta{function definitions} takes the form
+ \meta{name}|(|\meta{arguments}|)=|\meta{definition}|;| (note the
+ semicolon at the end, this is very important). If multiple
+ functions are being defined the semicolon is used to separate
+ them (\emph{not} a comma).
+ The function \meta{name} can be any name that is not already a
+ function name in the current scope. The list of \meta{arguments}
+ are commands such as |\x|, or |\y| (it is not possible to declare
+ functions that take variable numbers of arguments using this key).
+ If the function takes no arguments then the parentheses need not
+ be used.
+ The \meta{definition} should be an expression that can be
+ parsed by the mathematical engine and should use the commands
+ specified in \meta{arguments}.
+
+ When specifying multiple functions, functions that appear later
+ on in \meta{function definitions} can refer to earlier functions:
+
+\begin{codeexample}[]
+\begin{tikzpicture}[
+ declare function={
+ excitation(\t,\w) = sin(\t*\w);
+ noise = rnd - 0.5;
+ source(\t) = excitation(\t,20) + noise;
+ filter(\t) = 1 - abs(sin(mod(\t, 90)));
+ speech(\t) = 1 + source(\t)*filter(\t);
+ }
+]
+ \draw [help lines] (0,0) grid (3,2);
+ \draw [blue, thick, x=0.0085cm, y=1cm] (0,1) --
+ plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)});
+\end{tikzpicture}
+\end{codeexample}
-\pgfname{} uses the last known definition of a function within the
-prevailing scope, so it is possible for a function to be redefined
-or |\let| to an alternative definition locally.
-You should also remember that any |.sty| or |.tex| file contatining any
-re-implementions should be loaded \emph{after} \pgfname-Math. \ No newline at end of file
+\end{key}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
index 8a75eaa89ae..b1be68267d7 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
@@ -7,187 +7,47 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Evaluating Mathematical Operations}
+\section{Additional Mathematical Commands}
\label{pgfmath-commands}
Instead of parsing and evaluating complex expressions, you can also
use the mathematical engine to evaluate a single mathematical
-operation. The macros used for these computations are described in the
-following.
+operation. The macros used for many of these computations are listed
+above in Section~\ref{pgfmath-functions}. \pgfname{} also provides
+some additional commands which are shown below:
+\subsection{Basic arithmetic functions}
-\subsection{Basic Operations and Functions}
+\label{pgfmath-commands-basic}
-\label{pgfmath-operations}
-
-\begin{command}{\pgfmathadd\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\meta{x}+\meta{y}$.
-\end{command}
-
-\begin{command}{\pgfmathsubtract\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\meta{x}-\meta{y}$.
-\end{command}
-
-\begin{command}{\pgfmathmultiply\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\meta{x}\times\meta{y}$.
-\end{command}
-
-\begin{command}{\pgfmathdivide\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\meta{x}\div\meta{y}$. An error will
- result if \meta{y} is |0|, or if the result of the division is
- too big for the mathematical engine.
- Please remember when using this command that accurate (and reasonably
- quick) division of non-integers is particularly tricky in \TeX{}.
- There are three different forms of division used in this command:
- \begin{itemize}
- \item
- If \meta{y} is an integer then the native |\divide| operation of
- \TeX{} is used.
- \item
- If \vrule\meta{y}\vrule$<1$, then |\pgfmathreciprocal| is employed.
- \item
- For all other values of \meta{y} an optimised long division
- algorithm is used. In theory this should be accurate
- to any finite precision, but in practice it is constrained by the
- limits of \TeX{}'s native mathematics.
- \end{itemize}
-
-\end{command}
+In addition to the commands described in
+Section~\ref{pgfmath-functions-basic}, the following command is
+provided:
\begin{command}{\pgfmathreciprocal\marg{x}}
- Defines |\pgfmathresult| as $1\div\meta{x}$.
-\end{command}
-
-\begin{command}{\pgfmathgreaterthan\marg{x}\marg{y}}
- Defines |\pgfmathresult| as 1.0 if \meta{x} $>$ \meta{y}, but 0.0 otherwise.
-\end{command}
-
-\begin{command}{\pgfmathlessthan\marg{x}\marg{y}}
- Defines |\pgfmathresult| as 1.0 if \meta{x} $<$ \meta{y}, but 0.0 otherwise.
-\end{command}
-
-\begin{command}{\pgfmathequalto\marg{x}\marg{y}}
- Defines |\pgfmathresult| 1.0 if \meta{x} $=$ \meta{y}, but 0.0 otherwise.
-\end{command}
-
-\begin{command}{\pgfmathround\marg{x}}
- Defines |\pgfmathresult| as $\left\lfloor\textrm{\meta{x}}\right\rceil$.
- This uses asymmetric half-up rounding.
-\end{command}
-
-\begin{command}{\pgfmathfloor\marg{x}}
- Defines |\pgfmathresult| as $\left\lfloor\textrm{\meta{x}}\right\rfloor$.
-\end{command}
-
-\begin{command}{\pgfmathceil\marg{x}}
- Defines |\pgfmathresult| as $\left\lceil\textrm{\meta{x}}\right\rceil$.
-\end{command}
-
-\begin{command}{\pgfmathpow\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\meta{x}^{\meta{y}}$. For greatest
- accuracy \mvar{y} should be an integer. If \mvar{y} is not an integer
- the actual calculation will be an approximation of $e^{y\ln(x)}$.
-\end{command}
-
-\begin{command}{\pgfmathmod\marg{x}\marg{y}}
- Defines |\pgfmathresult| as \meta{x} modulo \meta{y}.
-\end{command}
-
-\begin{command}{\pgfmathmax\marg{x}\marg{y}}
- Defines |\pgfmathresult| as the maximum of \meta{x} or \meta{y}.
-\end{command}
-
-\begin{command}{\pgfmathmin\marg{x}\marg{y}}
- Defines |\pgfmathresult| as the minimum \meta{x} or \meta{y}.
-\end{command}
-
-\begin{command}{\pgfmathabs\marg{x}}
- Defines |\pgfmathresult| as absolute value of \meta{x}.
-\end{command}
-
-\begin{command}{\pgfmathexp\marg{x}}
- Defines |\pgfmathresult| as $e^{\meta{x}}$. Here, \meta{x} can be a
- non-integer. The algorithm uses a Maclaurin series.
-\end{command}
-
-\begin{command}{\pgfmathln\marg{x}}
- Defines |\pgfmathresult| as $\ln{\meta{x}}$. This uses an algorithm
- due to Rouben Rostamian, and coefficients suggested by
- Alain Matthes.
-\end{command}
-
-\begin{command}{\pgfmathsqrt\marg{x}}
- Defines |\pgfmathresult| as $\sqrt{\meta{x}}$.
-\end{command}
-
-\begin{command}{\pgfmathveclen\marg{x}\marg{y}}
- Defines |\pgfmathresult| as $\sqrt{\meta{x}^2+\meta{y}^2}$. This uses
- a polynomial approximation, based on ideas due to Rouben Rostamian.
-\end{command}
-
-\subsection{Trignometric Functions}
-
-\label{pgfmath-trigonmetry}
-
-\begin{command}{\pgfmathpi}
- Defines |\pgfmathresult| as $3.14159$.
-\end{command}
-
-\begin{command}{\pgfmathdeg{\marg{x}}}
- Defines |\pgfmathresult| as \meta{x} (given in radians) converted to
- degrees.
-\end{command}
-
-\begin{command}{\pgfmathrad{\marg{x}}}
- Defines |\pgfmathresult| as \meta{x} (given in degrees) converted to
- radians.
-\end{command}
-
-\begin{command}{\pgfmathsin{\marg{x}}}
- Defines |\pgfmathresult| as the sine of \meta{x}.
-\end{command}
-
-\begin{command}{\pgfmathcos{\marg{x}}}
- Defines |\pgfmathresult| as the cosine of \meta{x}.
-\end{command}
-
-\begin{command}{\pgfmathtan{\marg{x}}}
- Defines |\pgfmathresult| as the tangant of \meta{x}.
+ Defines |\pgfmathresult| as $1\div\meta{x}$. This is provides
+ greatest accuracy when \mvar{x} is small.
\end{command}
-\begin{command}{\pgfmathsec{\marg{x}}}
- Defines |\pgfmathresult| as the secant of \meta{x}.
-\end{command}
+\subsection{Comparison and logical functions}
-\begin{command}{\pgfmathcosec{\marg{x}}}
- Defines |\pgfmathresult| as the cosecant of \meta{x}.
-\end{command}
+In addition to the commands described in
+Section~\ref{pgfmath-functions-comparison},
+the following command was provided by Christian Feuers\"anger:
-\begin{command}{\pgfmathcot{\marg{x}}}
- Defines |\pgfmathresult| as the cotangant of \meta{x}.
+\begin{command}{\pgfmathapproxequalto\marg{x}\marg{y}}
+ Defines |\pgfmathresult| 1.0 if $ \rvert \meta{x} - \meta{y} \lvert < 0.0001$, but 0.0 otherwise.
+ As a side-effect, the global boolean |\ifpgfmathcomparison| will be set accordingly.
\end{command}
-\begin{command}{\pgfmathasin{\marg{x}}}
- Defines |\pgfmathresult| as the arcsine of \meta{x}.
- The result will be in the range $\pm90^\circ$.
-\end{command}
-
-\begin{command}{\pgfmathacos{\marg{x}}}
- Defines |\pgfmathresult| as the arccosine of \meta{x}.
- The result will be in the range $\pm90^\circ$.
-\end{command}
-
-\begin{command}{\pgfmathatan{\marg{x}}}
- Defines |\pgfmathresult| as the arctangent of \meta{x}.
-\end{command}
-
-
-
\subsection{Pseudo-Random Numbers}
\label{pgfmath-random}
+In addition to the commands described in
+Section~\ref{pgfmath-functions-random},
+the following commands are provided:
\begin{command}{\pgfmathgeneratepseudorandomnumber}
Defines |\pgfmathresult| as a pseudo-random integer between 1 and
@@ -195,14 +55,6 @@ following.
due to Erich Janka.
\end{command}
-\begin{command}{\pgfmathrnd}
- Defines |\pgfmathresult| as a pseudo-random number between |0| and |1|.
-\end{command}
-
-\begin{command}{\pgfmathrand}
- Defines |\pgfmathresult| as a pseudo-random number between |-1| and |1|.
-\end{command}
-
\begin{command}{\pgfmathrandominteger\marg{macro}\marg{maximum}\marg{minimum}}
This defines \meta{macro} as a pseudo-randomly generated integer from
the range \meta{maximum} to \meta{minimum} (inclusive).
@@ -253,7 +105,7 @@ following.
-\subsection{Conversion Between Bases}
+\subsection{Base Conversion}
\label{pgfmath-bases}
@@ -263,6 +115,10 @@ positive integers in the range $0$ to $2^{31}-1$, and the bases in the
range $2$ to $36$. All digits representing numbers greater than 9 (in
base ten), are alphabetic, but may be upper or lower case.
+In addition to the commands described in
+Section~\ref{pgfmath-functions-base},
+the following commands are provided:
+
\begin{command}{\pgfmathbasetodec\marg{macro}\marg{number}\marg{base}}
Defines \meta{macro} as the result of converting \meta{number} from
base \meta{base} to base 10. Alphabetic digits can be upper or lower
@@ -340,4 +196,5 @@ base ten), are alphabetic, but may be upper or lower case.
\pgfmathdectobase\mynumber{15}{2} \mynumber
\end{codeexample}
-\end{command} \ No newline at end of file
+\end{command}
+
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
index e29fb81d9b7..e12380bd8ae 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
@@ -46,8 +46,8 @@ The mathematical engine of \pgfname\ is loaded automatically by
not need \pgfname\ itself, you can load the following package:
\begin{package}{pgfmath}
- This command will load the mathematical engine of \pgfname, but not
- \pgfname\ itself. It defines commands like |\pgfmathparse|.
+ This command will load the mathematical engine of \pgfname, but not
+ \pgfname itself. It defines commands like |\pgfmathparse|.
\end{package}
@@ -57,7 +57,8 @@ Like \pgfname\ itself, the mathematical engine is also structured into
different layers:
\begin{enumerate}
-\item The top layer, which you will typically use directly, provides
+\item
+ The top layer, which you will typically use directly, provides
the command |\pgfmathparse|. This command parses a mathematical
expression and evaluates it.
@@ -65,11 +66,15 @@ different layers:
similar to the macros of the |calc| package for setting dimensions
and counters. These macros are just wrappers around the
|\pgfmathparse| macro.
-\item The calculation layer provides macros for performing one
+
+\item
+ The calculation layer provides macros for performing one
specific computation like computing a reciprocal or a
multiplication. The parser uses these macros for the actual
computation.
-\item The implementation layer provides the actual implementations of
+
+\item
+ The implementation layer provides the actual implementations of
the computations. These can be changed (and possibly be made more
efficient) without affecting the higher layers.
\end{enumerate}
@@ -80,7 +85,7 @@ different layers:
Currently, the mathematical algorithms are all implemented in \TeX.
This poses some intriguing programming challenges as \TeX{} is a
-language for typesetting, rather than general mathematics,
+language for typesetting, rather than for general mathematics,
and as with any programming language, there is a trade-off between
accuracy and efficiency.
If you find the level of accuracy insufficient for you
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex
new file mode 100644
index 00000000000..9deedd2e504
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex
@@ -0,0 +1,528 @@
+\section{Number Printing}
+
+\label{pgfmath-numberprinting}%
+
+{\emph{An extension by Christian Feuers\"anger}}
+
+\medskip
+\noindent
+\pgfname\ supports number printing in different styles and rounds to arbitrary precision.
+
+\begin{command}{\pgfmathprintnumber\marg{x}}
+Generates pretty-printed output for the (real) number \marg{x}. The input number \marg{x} is parsed using |\pgfmathfloatparsenumber| which allows arbitrary precision.
+
+Numbers are typeset in math mode using the current set of number printing options, see below. Optional arguments can also be provided using |\pgfmathprintnumber[|\meta{options}|]|\marg{x}.
+\end{command}
+
+\begin{command}{\pgfmathprintnumberto\marg{x}\marg{\textbackslash macro}}
+ Returns the resulting number into \marg{\textbackslash macro} instead of typesetting it directly.
+\end{command}
+
+\begin{key}{/pgf/number format/fixed}
+Configures |\pgfmathprintnumber| to round the number to a fixed number of digits after the period, discarding any trailing zeros.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+
+See section~\ref{sec:number:styles} for how to change the appearance.
+\end{key}
+
+\begin{key}{/pgf/number format/fixed zerofill=\marg{boolean} (default true)}
+Enables or disables zero filling for any number drawn in fixed point format.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+This key affects numbers drawn with |fixed| or |std| styles (the latter only if no scientific format is chosen).
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,std,fixed zerofill,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-05}\hspace{1em}
+\pgfmathprintnumber{1}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+
+See section~\ref{sec:number:styles} for how to change the appearance.
+\end{key}
+
+\begin{key}{/pgf/number format/sci}
+Configures |\pgfmathprintnumber| to display numbers in scientific format, that means sign, mantissa and exponent (basis~$10$). The mantissa is rounded to the desired |precision| (or |sci precision|, see below).
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+
+See section~\ref{sec:number:styles} for how to change the exponential display style.
+\end{key}
+
+\begin{key}{/pgf/number format/sci zerofill=\marg{boolean} (default true)}
+Enables or disables zero filling for any number drawn in scientific format.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci zerofill,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+As with |fixed zerofill|, this option does only affect numbers drawn in |sci| format (or |std| if the scientific format is chosen).
+
+See section~\ref{sec:number:styles} for how to change the exponential display style.
+\end{key}
+
+\begin{stylekey}{/pgf/number format/zerofill=\marg{boolean} (default true)}
+ Sets both, |fixed zerofill| and |sci zerofill| at once.
+\end{stylekey}
+
+\begin{keylist}{/pgf/number format/std,%
+ /pgf/number format/std=\meta{lower e},
+ /pgf/number format/std=\meta{lower e}:\meta{upper e}}
+Configures |\pgfmathprintnumber| to a standard algorithm. It chooses either |fixed| or |sci|, depending on the order of magnitude. Let $n=s \cdot m \cdot 10^e$ be the input number and $p$ the current precision. If $-p/2 \le e \le 4$, the number is displayed using |fixed| format. Otherwise, it is displayed using |sci| format.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,std,precision=2}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+The parameters can be customized using the optional integer argument(s): if $\text{\meta{lower e}} \le e \le \text{\meta{upper e}}$, the number is displayed in |fixed| format, otherwise in |sci| format. Note that \meta{lower e} should be negative for useful results. The precision used for scientific format can be adjusted with |sci precision| if necessary.
+
+\end{keylist}
+
+\begin{key}{/pgf/number format/int detect}
+Configures |\pgfmathprintnumber| to detect integers automatically. If the input number is an integer, no period is displayed at all. If not, the scientific format is chosen.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,int detect,precision=2}
+\pgfmathprintnumber{15}\hspace{1em}
+\pgfmathprintnumber{20}\hspace{1em}
+\pgfmathprintnumber{20.4}\hspace{1em}
+\pgfmathprintnumber{0.01}\hspace{1em}
+\pgfmathprintnumber{0}
+\end{codeexample}
+\end{key}
+
+\begin{command}{\pgfmathifisint\marg{number constant}\marg{true code}\marg{false code}}
+ A command which does the same check as |int detect|, but it invokes \meta{true code} if the \meta{number constant} actually is an integer and the \meta{false code} if not.
+
+ As a side--effect, |\pgfretval| will contain the parsed number, either in integer format or as parsed floating point number.
+
+
+ The argument \meta{number constant} will be parsed with |\pgfmathfloatparsenumber|.
+\begin{codeexample}[]
+15 \pgfmathifisint{15}{is an int: \pgfretval.}{is no int}\hspace{1em}
+15.5 \pgfmathifisint{15.5}{is an int: \pgfretval.}{is no int}
+\end{codeexample}
+\end{command}
+
+\begin{key}{/pgf/number format/int trunc}
+Truncates every number to integers (discards any digit after the period).
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,int trunc}
+\pgfmathprintnumber{4.568}\hspace{1em}
+\pgfmathprintnumber{5e-04}\hspace{1em}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{24415.98123}\hspace{1em}
+\pgfmathprintnumber{123456.12345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/frac}
+Displays numbers as fractionals.
+
+\begin{codeexample}[width=3cm]
+\pgfkeys{/pgf/number format/frac}
+\pgfmathprintnumber{0.333333333333333}\hspace{1em}
+\pgfmathprintnumber{0.5}\hspace{1em}
+\pgfmathprintnumber{2.133333333333325e-01}\hspace{1em}
+\pgfmathprintnumber{0.12}\hspace{1em}
+\pgfmathprintnumber{2.666666666666646e-02}\hspace{1em}
+\pgfmathprintnumber{-1.333333333333334e-02}\hspace{1em}
+\pgfmathprintnumber{7.200000000000000e-01}\hspace{1em}
+\pgfmathprintnumber{6.666666666666667e-02}\hspace{1em}
+\pgfmathprintnumber{1.333333333333333e-01}\hspace{1em}
+\pgfmathprintnumber{-1.333333333333333e-02}\hspace{1em}
+\pgfmathprintnumber{3.3333333}\hspace{1em}
+\pgfmathprintnumber{1.2345}\hspace{1em}
+\pgfmathprintnumber{1}\hspace{1em}
+\pgfmathprintnumber{-6}
+\end{codeexample}
+
+\begin{key}{/pgf/number format/frac TeX=\marg{\textbackslash macro} (initially \texttt{\textbackslash frac})}
+ Allows to use a different implementation for |\frac| inside of the |frac| display type.
+\end{key}
+\begin{key}{/pgf/number format/frac denom=\meta{int} (initially empty)}
+ Allows to provide a custom denominator for |frac|.
+\begin{codeexample}[width=3cm]
+\pgfkeys{/pgf/number format/.cd,frac, frac denom=10}
+\pgfmathprintnumber{0.1}\hspace{1em}
+\pgfmathprintnumber{0.5}\hspace{1em}
+\pgfmathprintnumber{1.2}\hspace{1em}
+\pgfmathprintnumber{-0.6}\hspace{1em}
+\pgfmathprintnumber{-1.4}\hspace{1em}
+\end{codeexample}
+\end{key}
+\begin{key}{/pgf/number format/frac whole=\mchoice{true,false} (initially true)}
+ Configures whether complete integer parts shall be placed in front of the fractional part. In this case, the fractional part will be less then $1$. Use |frac whole=false| to avoid whole number parts.
+\begin{codeexample}[width=3cm]
+\pgfkeys{/pgf/number format/.cd,frac, frac whole=false}
+\pgfmathprintnumber{20.1}\hspace{1em}
+\pgfmathprintnumber{5.5}\hspace{1em}
+\pgfmathprintnumber{1.2}\hspace{1em}
+\pgfmathprintnumber{-5.6}\hspace{1em}
+\pgfmathprintnumber{-1.4}\hspace{1em}
+\end{codeexample}
+\end{key}
+\begin{key}{/pgf/number format/frac shift=\marg{integer} (initially 4)}
+ In case you experience problems because of stability problems, try experimenting with a different |frac shift|.
+ Higher shift values $k$ yield higher sensitivity to inaccurate data or inaccurate arithmetics.
+
+ Technically, the following happens. If $r < 1$ is the fractional part of the mantissa, then a scale $i = 1/r \cdot 10^k$ is computed where $k$ is the shift; fractional parts of $i$ are neglected. The value $1/r$ is computed internally, its error is amplified.
+
+ If you still experience stability problems, use |\usepackage{fp}| in your preamble. The |frac| style will then automatically employ the higher absolute precision of |fp| for the computation of $1/r$.
+\end{key}
+\end{key}
+
+\begin{key}{/pgf/number format/precision=\marg{number}}
+Sets the desired rounding precision for any display operation. For scientific format, this affects the mantissa.
+\end{key}
+
+\begin{key}{/pgf/number format/sci precision=\meta{number or empty} (initially empty)}
+ Sets the desired rounding precision only for |sci| styles.
+
+ Use |sci precision={}| to restore the initial configuration (which uses the argument provided to |precision| for all number styles).
+\end{key}
+
+\subsection{Changing display styles}%
+\label{sec:number:styles}%
+You can change the way how numbers are displayed. For example, if you use the `\texttt{fixed}' style, the input number is rounded to the desired precision and the current fixed point display style is used to typeset the number. The same is applied to any other format: first, rounding routines are used to get the correct digits, afterwards a display style generates proper \TeX-code.
+
+\begin{key}{/pgf/number format/set decimal separator=\marg{text}}
+Assigns \marg{text} as decimal separator for any fixed point numbers (including the mantissa in sci format).
+
+Use |\pgfkeysgetvalue{/pgf/number format/set decimal separator}\value| to get the current separator into |\value|.
+\end{key}
+
+\begin{stylekey}{/pgf/number format/dec sep=\marg{text}}
+ Just another name for |set decimal separator|.
+\end{stylekey}
+
+\begin{key}{/pgf/number format/set thousands separator=\marg{text}}
+Assigns \marg{text} as thousands separator for any fixed point numbers (including the mantissa in sci format).
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={}}
+\pgfmathprintnumber{1234.56}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={}}
+\pgfmathprintnumber{1234567890}
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={.}}
+\pgfmathprintnumber{1234567890}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={,}}
+\pgfmathprintnumber{1234567890}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={{{,}}}}
+\pgfmathprintnumber{1234567890}
+\end{codeexample}
+The last example employs commas and disables the default comma-spacing.
+
+Use |\pgfkeysgetvalue{/pgf/number format/set thousands separator}\value| to get the current separator into |\value|.
+\end{key}
+
+\begin{stylekey}{/pgf/number format/1000 sep=\marg{text}}
+ Just another name for |set thousands separator|.
+\end{stylekey}
+
+\begin{key}{/pgf/number format/min exponent for 1000 sep=\marg{number} (initially 0)}
+ Defines the smallest exponent in scientific notation which is required to draw thousand separators. The exponent is the number of digits minus one, so $\meta{number}=4$ will use thousand separators starting with $1e4 = 10000$.
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ int detect,
+ 1000 sep={\,},
+ min exponent for 1000 sep=0}
+\pgfmathprintnumber{5000}; \pgfmathprintnumber{1000000}
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ int detect,
+ 1000 sep={\,},
+ min exponent for 1000 sep=4}
+\pgfmathprintnumber{1000}; \pgfmathprintnumber{5000}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ int detect,
+ 1000 sep={\,},
+ min exponent for 1000 sep=4}
+\pgfmathprintnumber{10000}; \pgfmathprintnumber{1000000}
+\end{codeexample}
+\noindent A value of |0| disables this feature (negative values are ignored).
+\end{key}
+
+\begin{key}{/pgf/number format/use period}
+A predefined style which installs periods `\texttt{.}' as decimal separators and commas `\texttt{,}' as thousands separators. This style is the default.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period}
+\pgfmathprintnumber{12.3456}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period}
+\pgfmathprintnumber{1234.56}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/use comma}
+A predefined style which installs commas `\texttt{,}' as decimal separators and periods `\texttt{.}' as thousands separators.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma}
+\pgfmathprintnumber{12.3456}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma}
+\pgfmathprintnumber{1234.56}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/skip 0.=\marg{boolean} (initially false)}
+ Configures whether numbers like $0.1$ shall be typeset as $.1$ or not.
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,precision=2,
+ skip 0.}
+\pgfmathprintnumber{0.56}
+\end{codeexample}
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,
+ fixed,
+ fixed zerofill,precision=2,
+ skip 0.=false}
+\pgfmathprintnumber{0.56}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/showpos=\marg{boolean} (initially false)}
+ Enables or disables display of plus signs for non-negative numbers.
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/showpos}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/showpos=false}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,showpos,sci}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{stylekey}{/pgf/number format/print sign=\marg{boolean}}
+ A style which is simply an alias for |showpos=|\marg{boolean}.
+\end{stylekey}
+
+\begin{key}{/pgf/number format/sci 10e}
+Uses $m \cdot 10^e$ for any number displayed in scientific format.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci 10e}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/sci 10\textasciicircum e}
+The same as `|sci 10e|'.
+\end{key}
+
+\begin{key}{/pgf/number format/sci e}
+Uses the `$1e{+}0$' format which is generated by common scientific tools for any number displayed in scientific format.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci e}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/sci E}
+The same with an uppercase `\texttt{E}'.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci E}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/sci subscript}
+Typesets the exponent as subscript for any number displayed in scientific format. This style requires very few space.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci subscript}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/sci superscript}
+Typesets the exponent as superscript for any number displayed in scientific format. This style requires very few space.
+
+\begin{codeexample}[]
+\pgfkeys{/pgf/number format/.cd,sci,sci superscript}
+\pgfmathprintnumber{12.345}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/number format/sci generic=\marg{keys}}
+Allows to define an own number style for the scientific format. Here, \meta{keys} can be one of the following choices (omit the long key prefix):
+
+\begin{key}{/pgf/number format/sci generic/mantissa sep=\marg{text} (initially empty)}
+ Provides the separator between a mantissa and the exponent. It might be |\cdot|, for example,
+\end{key}
+\begin{key}{/pgf/number format/sci generic/exponent=\marg{text} (initially empty)}
+ Provides text to format the exponent. The actual exponent is available as argument |#1| (see below).
+\end{key}
+
+\begin{codeexample}[]
+\pgfkeys{
+ /pgf/number format/.cd,
+ sci,
+ sci generic={mantissa sep=\times,exponent={10^{#1}}}}
+\pgfmathprintnumber{12.345};
+\pgfmathprintnumber{0.00012345}
+\end{codeexample}
+ The \meta{keys} can depend on three parameters, namely on |#1| which is the exponent, |#2| containing the flags entity of the floating point number and |#3| is the (unprocessed and unformatted) mantissa.
+
+ Note that |sci generic| is \emph{not} suitable to modify the appearance of fixed point numbers, nor can it be used to format the mantissa (which is typeset like fixed point numbers). Use |dec sep|, |1000 sep| and |print sign| to customize the mantissa.
+\end{key}
+
+
+\begin{key}{/pgf/number format/@dec sep mark=\marg{text}}
+ Will be placed right before the place where a decimal separator belongs to. However, \marg{text} will be inserted even if there is no decimal separator. It is intended as place-holder for auxiliary routines to find alignment positions.
+
+ This key should never be used to change the decimal separator! Use |dec sep| instead.
+\end{key}
+
+\begin{key}{/pgf/number format/@sci exponent mark=\marg{text}}
+ Will be placed right before exponents in scientific notation. It is intended as place-holder for auxiliary routines to find alignment positions.
+
+ This key should never be used to change the exponent!
+\end{key}
+
+\begin{key}{/pgf/number format/assume math mode=\marg{boolean} (default true)}
+ Set this to |true| if you don't want any checks for math mode. The initial setting checks whether math mode is active using |\pgfutilensuremath| for each final number.
+
+ Use |assume math mode=true| if you know that math mode is active. In that case, the final number is typeset as-is, no further checking is performed.
+\end{key}
+
+
+\begin{stylekey}{/pgf/number format/verbatim}
+ A style which configures the number printer to produce verbatim text output, i.e.\ it doesn't contain \TeX\ macros.
+\begin{codeexample}[]
+\pgfkeys{
+ /pgf/fpu,
+ /pgf/number format/.cd,
+ sci,
+ verbatim}
+\pgfmathprintnumber{12.345};
+\pgfmathprintnumber{0.00012345};
+\pgfmathparse{exp(15)}
+\pgfmathprintnumber{\pgfmathresult}
+\end{codeexample}
+ The style resets |1000 sep|, |dec sep|, |print sign|, |skip 0.| and sets |assume math mode|. Furthermore, it installs a |sci generic| format for verbatim output of scientific numbers.
+
+ However, it will still respect |precision|, |fixed zerofill|, |sci zerofill| and the overall styles |fixed|, |sci|, |int detect| (and their variants). It might be useful if you intent to write output files.
+\end{stylekey}
+%--------------------------------------------------
+% \subsubsection{Defining own display styles}
+% You can define own display styles, although this may require some insight into \TeX-programming. Here are two examples:
+% \begin{enumerate}
+% \item A new fixed point display style: The following code defines a new style named `\texttt{my own fixed point style}' which uses $1{\cdot}00$ instead of $1.00$.
+% \begin{lstlisting}
+% \def\myfixedpointstyleimpl#1.#2\relax{%
+% #1{\cdot}#2%
+% }%
+% \def\myfixedpointstyle#1{%
+% \pgfutilensuremath{%
+% \ifpgfmathfloatroundhasperiod
+% \expandafter\myfixedpointstyleimpl#1\relax
+% \else
+% #1%
+% \fi
+% }%
+% }
+% \pgfkeys{/my own fixed point style/.code={%
+% \let\pgfmathprintnumber@fixed@style=\myfixedpointstyle}
+% }%
+% \end{lstlisting}
+% You only need to overwrite the macro \lstinline!\pgfmathprintnumber@fixed@style!. This macro takes one argument (the result of any numerical computations). The \TeX-boolean \lstinline!\ifpgfmathfloatroundhasperiod! is true if and only if the input number contains a period.
+%
+% \item An example for a new scientific display style:
+% \begin{lstlisting}
+% % #1:
+% % 0 == '0' (the number is +- 0.0),
+% % 1 == '+',
+% % 2 == '-',
+% % 3 == 'not a number'
+% % 4 == '+ infinity'
+% % 5 == '- infinity'
+% % #2: the mantissa
+% % #3: the exponent
+% \def\myscistyle#1#2e#3\relax{%
+% ...
+% }
+% \pgfkeys{/my own sci style/.code={%
+% \let\pgfmathfloatrounddisplaystyle=\myscistyle},
+% }%
+% \end{lstlisting}
+% \end{enumerate}
+%--------------------------------------------------
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
index 7ec64df937c..1d28cfa4fea 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
@@ -11,22 +11,20 @@
\section{Evaluating Mathematical Expressions}
The easiest way of using \pgfname's mathematical engine is to provide
-a mathematical expression given in the usual infix notation (such as
-|1cm+4*2cm/5.5| or |2*3+3*sin(30)|). This expression can be parsed by
-the mathematical engine and the result be placed in a dimension
-register, a counter, or a macro. Supported are infix mathematical
-operations involving integers and non-integers, with or without
-units.
-
-It should be noted that all
-calculations must not exceed $\pm16383.99999$ at \emph{any} point,
-because the underlying algorithms rely on \TeX{} dimensions. This
-means that many of the underlying algorithms are necessarily
-approximate. It also means that some of the algorithms are not very
-fast. \TeX{} is, after all, a typesetting language and not ideally
-suited to relatively advanced mathematical operations. However, it is
-possible to change the algorithms as described in
-Section~\ref{pgfmath-reimplement}.
+a mathematical expression given in familiar infix notation, for
+example, |1cm+4*2cm/5.5| or |2*3+3*sin(30)|. This expression can be
+parsed by the mathematical engine and the result be placed in a
+dimension register, a counter, or a macro.
+
+It should be noted that all
+calculations must not exceed $\pm16383.99999$ at \emph{any} point,
+because the underlying computations rely on \TeX{} dimensions. This
+means that many of the underlying computations are necessarily
+approximate and that in addition, are not very fast. \TeX{} is,
+after all, a typesetting language and not ideally
+suited to relatively advanced mathematical operations. However, it
+is possible to change the computations as described in
+Section~\ref{pgfmath-reimplement}.
In the present section, the high-level macros for parsing an
expression are explained first, then the syntax for expression is
@@ -55,136 +53,104 @@ engine is the following:
\begin{itemize}
\item
- The result stored in the macro |\pgfmathresult| is a decimal
- \emph{without units}. This is true regardless of whether the
- \meta{expression} contains any unit specification. But, any units
- specified will be converted to points first.
-\begin{codeexample}[]
-\pgfmathparse{2pt+3.4pt} \pgfmathresult
-\end{codeexample}
-
-\begin{codeexample}[]
-\pgfmathparse{2cm+3.4cm} \pgfmathresult
-\end{codeexample}
-
- \item If no units are specified \emph{at any point} in the
- expression, the result will be multiplied by the value in
- |\pgfmathresultunitscale|, which can be a number or a dimension
- (which will be converted to points). By default it is set to 1,
- but can be changed with |\pgfmathsetresultunitscale|. Note that
- the result will still be a number \emph{without} units.
+ The result stored in the macro |\pgfmathresult| is a decimal
+ \emph{without units}. This is true regardless of whether the
+ \meta{expression} contains any unit specification. All numbers
+ with units are converted to points first.
-\begin{codeexample}[]
-\pgfmathparse{2pt+3.4pt} \pgfmathresult
-\end{codeexample}
-
-\begin{codeexample}[]
-\pgfmathsetresultunitscale{1cm}
-\pgfmathparse{2+3.4} \pgfmathresult
-\end{codeexample}
+ \item
+ You can check whether an expression contained a unit using
+ the \TeX-if |\||ifpgfmathunitsdeclared|. After a call
+ of |\pgfmathparse| this if will be true exactly if some unit was
+ encountered in the expression.
- \pgfmathsetresultunitscale{1pt}
-
- \item You can check whether an expression contained a unit using
- the \TeX-if |\||ifpgfmathunitsdeclared|. After a call
- of |\pgfmathparse| this if will be true exactly if some unit was
- encountered in the expression.
-
- \item The parser handles numbers with or without units regardless
- of the operation.
+ \item
+ The parser can recognize \TeX{} registers and box dimensions,
+ so |\mydimen|, |0.5\mydimen|, |\wd\mybox|, |0.5\dp\mybox|,
+ |\mycount\mydimen| and so on can be parsed.
-\begin{codeexample}[]
-\pgfmathparse{54pt/3cm*2.1} \pgfmathresult
-\end{codeexample}
+ \item
+ Parenthesis can be used to change the order of the evaluation.
- \item the parser can cope with \TeX{} registers, including those
- preceded by |\the|.
+ \item
+ Various functions are recognized, so it is possible to parse
+ |sin(.5*pi r)*60|, which means ``the sine of $0.5$ times $\pi$
+ radians, multiplied by 60''. The argument of functions can
+ be any expression.
- \makeatletter
+ \item
+ Scientific notation in the form |1.234e+4| is recognized (but
+ the restriction on the range of values still applies). The exponent
+ symbol can be upper or lower case (i.e., |E| or |e|).
-\begin{codeexample}[]
-\pgf@x=12.34pt
-\c@pgf@counta=5
-\pgfmathparse{\pgf@x+\c@pgf@counta*6} \pgfmathresult
-\end{codeexample}
+ \item
+ An integer with a zero-prefix (excluding, of course zero itself),
+ is interpreted as an octal number and is automatically converted
+ to base 10.
-\begin{codeexample}[]
-\pgf@x=56.78pt
-\pgfmathparse{\pgf@x+\the\pgf@x} \pgfmathresult
-\end{codeexample}
+ \item
+ An integer with prefix |0x| or |0X| is interpreted as a hexadecimal
+ number and is automatically converted to base 10. Alphabetic digits
+ can be in uppercase or lowercase.
- \item \TeX{} dimension registers can be multiplied without the |*|
- operator by preceding them with a number (\emph{not} a function),
- or a count register.
-
-\begin{codeexample}[]
-\c@pgf@counta=-4
-\pgf@x=10pt
-\pgfmathparse{.5\pgf@x-\c@pgf@counta\pgf@x} \pgfmathresult
-\end{codeexample}
+ \item
+ An integer with prefix |0b| or |0B| is interpreted as a binary
+ number and is automatically converted to base 10.
- \item Parenthesis can be used to group operations.
+ \item
+ An expression (or part of an expression) surrounded with double
+ quotes (i.e., the character |"|) will not be evaluated.
+ Obviously this should be used with great care.
-\begin{codeexample}[]
-\pgfmathparse{(4pt+0.5)*3} \pgfmathresult
-\end{codeexample}
+\end{itemize}
- \item functions are recognized, so it is possible to parse
- |sin(.5*pi r)*60|, which means ``the sine of $0.5$ times $\pi$
- radians, multiplied by 60''. The argument of most functions can
- be any expression.
+\end{command}
-\begin{codeexample}[]
-\pgfmathparse{sin(pi/2 r)*60} \pgfmathresult
-\end{codeexample}
- \item Scientific notation in the form |1.234e+4| is recognised (but
- the restriction on the range of values still applies). The exponent
- symbol can be upper or lower case (i.e., |E| or |e|).
-
-\begin{codeexample}[]
-\pgfmathparse{1.234567891e-2} \pgfmathresult
-\end{codeexample}
-\begin{codeexample}[]
-\pgfmathparse{1.234567891e4} \pgfmathresult
-\end{codeexample}
- \end{itemize}
-\end{command}
\begin{command}{\pgfmathqparse\marg{expression}}
- This macro is similar to |\pgfmathparse|: it parses
- \meta{expression} and returns the result in the macro
- |\pgfmathresult|. It differs in two respects. Firstly,
- |\pgfmathqparse| does not parse functions or scientific
- notation.
+ This macro is similar to |\pgfmathparse|: it parses
+ \meta{expression} and returns the result in the macro
+ |\pgfmathresult|. It differs in two respects. Firstly,
+ |\pgfmathqparse| does not parse functions, scientific
+ notation, the prefixes for binary octal, or hexadecimal numbers,
+ nor does it accept the special use of |"|, |?| or |:| characters.
Secondly, numbers in \meta{expression} \emph{must}
- specify a \TeX{} unit (except in such instances as |0.5\pgf@x|),
- which greatly simplifies the problem of parsing
- of non-integers. As a result of these restrictions |\pgfmathqparse|
- is about twice as fast as |\pgfmathparse|. Note that the result
- will still be a number \emph{without} units.
+ specify a \TeX{} unit (except in such instances as |0.5\pgf@x|),
+ which greatly simplifies the problem of parsing real numbers.
+ As a result of these restrictions |\pgfmathqparse|
+ is about twice as fast as |\pgfmathparse|. Note that the result
+ will still be a number without units.
\end{command}
-\begin{command}{\pgfmathsetresultunitscale\marg{number or dimension}}
- Sets the value in |\pgfmathresultunitscale|, which scales the result
- of an expression parsed with |\pgfmathparse|, if that expression
- contains no units \emph{at any point}. The argument can be an integer,
- non-integer or a dimension, but the result will still be a number
- \emph{without} units. Note, that this will affect |\pgfmathsetlength|
- and friends, but not if the expression starts with |+| (which
- switches parsing off). By default the value in
- |\pgfmathresultunitscale| is 1.
+\begin{command}{\pgfmathpostparse}
+
+ At the end of the parse this command is executed, allowing some
+ custom action to be performed on the result of the parse. When this
+ command is executed the macro |\pgfmathresult| will hold the result
+ of the parse (as ever, without units). The result of the custom
+ action should be to redefined |\pgfmathresult| appropriately.
+ By default, this command is equivalent to |\relax|. This differs
+ from previous versions, where, if the parsed expression contained
+ no units, the result of the parse was scaled according to the value
+ in |\pgfmathresultunitscale| (which by default was |1|).
+
+ This scaling can be turned on again using:
+ |\let\pgfmathpostparse=\pgfmathscaleresult|.
+ Note, however that by scaling the result, the base conversion
+ functions will not work, and the |"| character should not be
+ used to quote parts of an expression.
+
\end{command}
Instead of the |\pgfmathparse| macro you can also wrapper commands,
-whose usage is very similar to their cousins in the \calcname{}
+whose usage is very similar to their cousins in the \calcname{}
package. The only difference is that the expressions can be any
expression that is handled by |\pgfmathparse|.
-
For all of the following commands, if \meta{expression} starts with
|+|, no parsing is done and a simple assignment or increment is done
using normal \TeX\ assignments or increments. This will be orders of
-magnitude faster than calling the parser.
+magnitude faster than calling the parser.
\begin{command}{\pgfmathsetlength\marg{dimension register}\marg{expression}}
Sets the length of the \TeX{} \meta{dimension register}, to the value
@@ -193,45 +159,37 @@ magnitude faster than calling the parser.
\end{command}
\begin{command}{\pgfmathaddtolength\marg{dimension register}\marg{expression}}
- Adds the value (in points) of \meta{expression} to the \TeX{}
- \meta{dimension register}.
+ Adds the value (in points) of \meta{expression} to the \TeX{}
+ \meta{dimension register}.
\end{command}
\begin{command}{\pgfmathsetcount\marg{count register}\marg{expression}}
- Sets the value of the \TeX{} \meta{count register}, to the
- \emph{truncated} value specified by \meta{expression}.
+ Sets the value of the \TeX{} \meta{count register}, to the
+ \emph{truncated} value specified by \meta{expression}.
\end{command}
\begin{command}{\pgfmathaddtocount\marg{count register}\marg{expression}}
- Adds the \emph{truncated} value of \meta{expression} to the \TeX{}
+ Adds the \emph{truncated} value of \meta{expression} to the \TeX{}
\meta{count register}.
\end{command}
\begin{command}{\pgfmathsetcounter\marg{counter}\marg{expression}}
- Sets the value of the \LaTeX{} \meta{counter}, to the \emph{truncated}
- value specified by \meta{expression}.
+ Sets the value of the \LaTeX{} \meta{counter}, to the \emph{truncated}
+ value specified by \meta{expression}.
\end{command}
\begin{command}{\pgfmathaddtocounter\marg{counter}\marg{expression}}
- Adds the \emph{truncated} value of \meta{expression} to
+ Adds the \emph{truncated} value of \meta{expression} to
\meta{counter}.
\end{command}
-% \begin{command}{\pgfmathnewcounter\marg{counter}}
-% This is simply a version of the \LaTeX{} macro |\newcounter|,
-% implemented to maintain consistency (consistency is good,
-% inconsistency is evil). Considering |\pgfmathnewcounter{foo}|, this
-% creates a new count register |\c@foo|, and a macro |\thefoo|, which
-% returns the value in |\c@foo|.
-% \end{command}
-
\begin{command}{\pgfmathsetmacro\marg{macro}\marg{expression}}
Defines \meta{macro} as the value of \meta{expression}. The result
- is a decimal \emph{without} units.
+ is a decimal without units.
\end{command}
\begin{command}{\pgfmathsetlengthmacro\marg{macro}\marg{expression}}
- Defines \meta{macro} as the value of \meta{expression}
+ Defines \meta{macro} as the value of \meta{expression}
\LaTeX{}\emph{in points}.
\end{command}
@@ -241,200 +199,351 @@ magnitude faster than calling the parser.
-\subsection{Syntax for mathematical expressions}
+\section{Syntax for mathematical expressions}
\label{pgfmath-syntax}
-The syntax for the expressions recognized by |\pgfmathparse| and
-friends is straightfoward, and the following operations and
-functions are currently recognized:
+ The syntax for the expressions recognized by |\pgfmathparse| and
+ friends is straightforward, and the following sections describe the
+ operators and functions that are recognized by default.
-\begin{math-operator}{\mvar{x}\ +\ \mvar{y}}
- Adds \mvar{y} to \mvar{x}.
-
-\begin{codeexample}[]
-\pgfmathparse{4+2pt} \pgfmathresult
-\end{codeexample}
+\subsection{Operators}
+
+\label{pgfmath-operators}
+
+ The following operators (presented in the context in which they are used)
+ are recognized:
+
+\begin{math-operator}{+}{infix}{add}
+ Adds \mvar{x} to \mvar{y}.
\end{math-operator}
-\begin{math-operator}{\mvar{x}\ -\ \mvar{y}}
- Subtracts \mvar{y} from \mvar{x}.
-
-\begin{codeexample}[]
-\pgfmathparse{155.35-4cm} \pgfmathresult
-\end{codeexample}
+\begin{math-operator}{-}{infix}{subtract}
+ Subtracts \mvar{y} from \mvar{x}.
\end{math-operator}
-\begin{math-operator}{\mvar{x}\ *\ \mvar{y}}
- Multiplies \mvar{x} by \mvar{y}.
-
-\begin{codeexample}[]
-\pgfmathparse{3.9pt*4.56} \pgfmathresult
-\end{codeexample}
+\begin{math-operator}{-}{prefix}{neg}
+ Reverses the sign of \mvar{x}.
\end{math-operator}
-\begin{math-operator}{\mvar{x}\ /\ \mvar{y}}
- Divides \mvar{x} by \mvar{y}.
-
-\begin{codeexample}[]
-\pgfmathparse{-31.6pt/17} \pgfmathresult
-\end{codeexample}
+\begin{math-operator}{*}{infix}{multiply}
+ Multiples \mvar{x} by \mvar{y}.
\end{math-operator}
-\begin{math-operator}{\mvar{x}\ {\char94}\ \mvar{y}}
-Raises \mvar{x} to the power \mvar{y}. For greatest accuracy \mvar{y}
-should be an integer. If \mvar{y} is not an integer the actual
-calculation will be an approximation of $e^{y\ln(x)}$.
+\begin{math-operator}{/}{infix}{divide}
+ Divides \mvar{x} by \mvar{y}. An error will result if \mvar{y} is 0,
+ or if the result of the division is too big for the mathematical
+ engine. Please remember when using this command that accurate (and
+ reasonably quick) division of real numbers that are not integers
+ is particularly tricky in \TeX.
+\end{math-operator}
-{
-\catcode`\^=7
+\begin{math-operator}{\char`\^}{infix}{pow}
+ Raises \mvar{x} to the power \mvar{y}.
+\end{math-operator}
-\begin{codeexample}[]
-\pgfmathparse{2.3^4} \pgfmathresult
-\end{codeexample}
+\begin{math-operator}{!}{postfix}{factorial}
+ Calculates the factorial of \mvar{x}.
+\end{math-operator}
-\begin{codeexample}[]
-\pgfmathparse{2^-4} \pgfmathresult
-\end{codeexample}
+\begin{math-operator}{r}{postfix}{deg}
+ Converts \mvar{x} to degrees (\mvar{x} is assumed to be in radians).
+ This operator has the same precedence as multiplication.
+\end{math-operator}
+
+\begin{math-operators}{?}{:}{conditional}{ifthenelse}
+
+ |?| and |:| are special operators which can be used as a shorthand
+ for |if| \mvar{x} |then| \mvar{y} |else| \mvar{z} inside the parser.
+ The expression \mvar{x} is taken to be true if it evaluates to any
+ non-zero value.
+
+\end{math-operators}
+
+\begin{math-operator}{==}{infix}{equal}
+ Returns |1| if \mvar{x}$=$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{>}{infix}{greater}
+ Returns |1| if \mvar{x}$>$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{<}{infix}{less}
+ Returns |1| if \mvar{x}$<$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{!=}{infix}{notequal}
+ Returns |1| if \mvar{x}$\neq$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{>=}{infix}{notless}
+ Returns |1| if \mvar{x}$\geq$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{<=}{infix}{notgreater}
+ Returns |1| if \mvar{x}$\leq$\mvar{y}, |0| otherwise.
+\end{math-operator}
+
+\begin{math-operator}{{\char`\&}{\char`\&}}{infix}{and}
+ Returns |1| if both \mvar{x} and \mvar{y} evaluate to some
+ non-zero value. Both arguments are evaluated.
+\end{math-operator}
+
+
+
+{
+ \catcode`\|=12
+\begin{math-operator}[no index]{||}{infix}{or}
+ \index{*pgfmanualvbarvbarr@\protect\texttt{\protect\pgfmanualvbarvbar} math operator}%
+ \index{Math operators!*pgfmanualvbarvbar@\protect\texttt{\protect\pgfmanualvbarvbar}}%
+ Returns {\tt 1} if either \mvar{x} or \mvar{y} evaluate to some
+ non-zero value.
+\end{math-operator}
}
+
+\begin{math-operator}{!}{prefix}{not}
+ Returns |1| if \mvar{x} evaluates to zero, |0| otherwise.
\end{math-operator}
-\begin{math-operator}{\mvar{x}\ ==\ \mvar{y}}
- This evaluates to |1| if \mvar{x} equals \mvar{y}, or |0| if \mvar{x}
- does not equal \mvar{y}.
- Note that equalities (and inequalities) are evaluated left to right,
- and are only evaluated when another equality (or inequality) operator
- is scanned, or the end of the current group or parse is reached. So
- |5+4==3+2==9| results in |0| because |5+4| does not equal |3+2|,
- resulting in zero, and the second equality is therefore evaluating
- |0==9|.
+\begin{math-operators}{(}{)}{group}{}
+
+These operators act in the usual way, that is, to control the order
+in which operators are executed, for example, |(1+2)*3|. This
+includes the grouping of arguments for functions, for example,
+|sin(30*10)| or |mod(72,3)| (the comma character is also treated
+as an operator).
+
+Parentheses for functions with one argument are not always
+necessary, |sin 30| (note the space) is the same as |sin(30)|.
+However, functions have the highest precedence so, |sin 30*10|
+is the same as |sin(30)*10|.
+
+\end{math-operators}
+
+
+\begin{math-operators}{\char`\{}{\char`\}}{array}{}
+
+These operators are used to process array-like structures (within an
+expression these characters do not act like \TeX{} grouping tokens).
+The \meta{array specification} consists of comma separated elements,
+for example, |{1, 2, 3, 4, 5}|. Each element in the array will be
+evaluated as it is parsed, so expressions can be used.
+In addition, an element of an array can be an array itself,
+allowing multiple dimension arrays to be simulated:
+|{1, {2,3}, {4,5}, 6}|.
+When storing an array in a macro, do not forget the surrounding
+braces: |\def\myarray{{1,2,3}}| not |\def\myarray{1,2,3}|.
\begin{codeexample}[]
-\pgfmathparse{3*5==15} \pgfmathresult
+\def\myarray{{1,"two",2+1,"IV","cinq","sechs",sin(\i*5)*14}}
+\foreach \i in {0,...,6}{\pgfmathparse{\myarray[\i]}\pgfmathresult, }
\end{codeexample}
-\end{math-operator}
+\end{math-operators}
+\begin{math-operators}{\char`\[}{\char`\]}{array access}{array}
-\begin{math-operator}{\mvar{x}\ >\ \mvar{y}}
+|[| and |]| are two operators used in one particular circumstance: to
+access an array (specified using the |{| and |}| operators)
+using the index \mvar{x}. Indexing starts from zero,
+so, if the index is greater than, or equal to, the number of values in
+the array, an error will occur, and zero will be returned.
- This evaluates to |1| if \mvar{x} is greater than \mvar{y}, or |0| if
- \mvar{x} is smaller or equal to \mvar{y}.
-
\begin{codeexample}[]
-\pgfmathparse{17>4.2*1.97+4} \pgfmathresult
+\def\myarray{{7,-3,4,-9,11}}
+\pgfmathparse{\myarray[3]} \pgfmathresult
\end{codeexample}
-\end{math-operator}
+If the array is defined to have multiple dimensions then the array
+access operators can be immediately repeated.
-\begin{math-operator}{\mvar{x}\ <\ \mvar{y}}
-
- This evaluates to |1| if \mvar{x} is smaller than \mvar{y}, or |0| if
- \mvar{x} is greater or equal to \mvar{y}.
-
\begin{codeexample}[]
-\pgfmathparse{2<-5.2/-3.6-2} \pgfmathresult
+\def\print#1{\pgfmathparse{#1}\pgfmathresult}
+\def\identitymatrix{{{1,0,0},{0,1,0},{0,0,1}}}
+\tikz[x=0.5cm,y=0.5cm]\foreach \i in {0,1,2} \foreach \j in {0,1,2}
+ \node at (\j,-\i) [anchor=base] {\print{\identitymatrix[\i][\j]}};
\end{codeexample}
-\end{math-operator}
+\end{math-operators}
-\begin{math-function}{mod(\mvar{x},\mvar{y})}
- This evaluates \mvar{x} modulo \mvar{y} (using truncated division).
- This function cannot be nested inside itself or the functions |max|,
- |min| or |pow|.
+
+\begin{math-operators}{"}{"}{group}{}
+
+These operators are used to quote \mvar{x}. However, as every
+expression is expanded with |\edef| before it is parsed, macros
+(e.g., font commands like |\tt| or |\Huge|) may need to be
+``protected'' from this expansion (e.g., |\noexpand\Huge|). Ideally,
+you should avoid such macros anyway.
+Obviously, these operators should be used with great care as further
+calculations are unlikely to be possible with the result.
\begin{codeexample}[]
-\pgfmathparse{mod(20,6)} \pgfmathresult
+\def\x{5}
+\foreach \y in {0,10}{
+ \pgfmathparse{\x > \y ? "\noexpand\Large Bigger" : "\noexpand\tiny smaller"}
+ \x\ is \pgfmathresult\ than \y.
+}
\end{codeexample}
-\end{math-function}
+\end{math-operators}
+
+
+
+
+\subsection{Functions}
+
+\label{pgfmath-functions}
+
+The following functions are recognized:
+
+\medskip
+\def\mathlink#1{\hyperlink{math:#1}{\tt#1}}
+\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,
+ floor,frac,greater,height,hex,Hex,int,ifthenelse,
+ less,ln,log10,log2,max,min,mod,Mod,multiply,
+ neg,not,notequal,notgreater,notless,
+ oct,or,pi,pow,rad,rand,random,real,rnd,round,
+ sec,sin,sinh,sqrt,subtract,tan,tanh,true, veclen,width}
+\node [anchor=base west] at ({int(\i/11)*2.5cm},{-mod(\i,11)*1.1*\baselineskip}) {\mathlink{\f}};
+\end{tikzpicture}
+\bigskip
+
-\begin{math-function}{max(\mvar{x},\mvar{y})}
- This evaluates to the maximum of \mvar{x} or \mvar{y}. This function
- cannot be nested inside itself or the functions |min|, |mod| or
- |pow|.
+Each function has a \pgfname{} command associated with it (which is
+also shown with the function below). In general the command
+is simply the name of the function prefixed with |\pgfmath|, for
+example, |\pgfmathadd|, but there are some notable exceptions.
+
+\subsubsection{Basic arithmetic functions}
+
+\label{pgfmath-functions-basic}
+
+\begin{math-function}{add(\mvar{x},\mvar{y})}
+\mathcommand
+
+ Adds $x$ and $y$.
\begin{codeexample}[]
-\pgfmathparse{max(17,23)} \pgfmathresult
+\pgfmathparse{add(75,6)} \pgfmathresult
\end{codeexample}
-
\end{math-function}
-\begin{math-function}{min(\mvar{x},\mvar{y})}
- This evaluates to the minimum of \mvar{x} or \mvar{y}. This function
- cannot be nested inside itself or the functions |max|, |mod| or
- |pow|.
+\begin{math-function}{subtract(\mvar{x},\mvar{y})}
+\mathcommand
+
+ Subtract $x$ from $y$.
\begin{codeexample}[]
-\pgfmathparse{min(17,23)} \pgfmathresult
+\pgfmathparse{subtract(75,6)} \pgfmathresult
\end{codeexample}
-
\end{math-function}
-\begin{math-function}{abs(\mvar{x})}
+\begin{math-function}{neg(\mvar{x})}
+\mathcommand
- Evaluates the absolute value of $x$.
+ This returns $-\mvar{x}$.
\begin{codeexample}[]
-\pgfmathparse{abs(-5)} \pgfmathresult
+\pgfmathparse{neg(50)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{multiply(\mvar{x},\mvar{y})}
+\mathcommand
+
+ Multiply $x$ by $y$.
+
\begin{codeexample}[]
-\pgfmathparse{-abs(4*-3)} \pgfmathresult
+\pgfmathparse{multiply(75,6)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+\begin{math-function}{divide(\mvar{x},\mvar{y})}
+\mathcommand
+
+ Divide $x$ by $y$.
+
+\begin{codeexample}[]
+\pgfmathparse{divide(75,6)} \pgfmathresult
+\end{codeexample}
\end{math-function}
-\begin{math-function}{round(\mvar{x})}
+\begin{math-function}{div(\mvar{x},\mvar{y})}
+\mathcommand
- Rounds \mvar{x} to the nearest integer. It uses ``asymmetric half-up''
- rounding. So |1.5| is rounded to |2|, but |-1.5| is rounded to |-2|
- (\emph{not} |0|).
+ Divide $x$ by $y$ and round to the nearest integer
\begin{codeexample}[]
-\pgfmathparse{round(32.5/17)} \pgfmathresult
+\pgfmathparse{div(75,9)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{factorial(\mvar{x})}
+\mathcommand
+
+ Return \mvar{x}!.
\begin{codeexample}[]
-\pgfmathparse{round(398/12)} \pgfmathresult
+\pgfmathparse{factorial(5)} \pgfmathresult
\end{codeexample}
\end{math-function}
-\begin{math-function}{floor(\mvar{x})}
+\begin{math-function}{sqrt(\mvar{x})}
+\mathcommand
+
+ Calculates $\sqrt{\textrm{\mvar{x}}}$.
- Rounds \mvar{x} down to the nearest integer.
-
\begin{codeexample}[]
-\pgfmathparse{floor(32.5/17)} \pgfmathresult
+\pgfmathparse{sqrt(10)} \pgfmathresult
\end{codeexample}
\begin{codeexample}[]
-\pgfmathparse{floor(398/12)} \pgfmathresult
+\pgfmathparse{sqrt(8765.432)} \pgfmathresult
\end{codeexample}
\end{math-function}
-\begin{math-function}{ceil(\mvar{x})}
+\begin{math-function}{pow(\mvar{x},\mvar{y})}
+\mathcommand
- Rounds \mvar{x} up to the nearest integer.
+ Raises \mvar{x} to the power \mvar{y}. For greatest accuracy
+ \mvar{y} should be an integer. If \mvar{y} is not an integer
+ the actual calculation will be an approximation of $e^{yln(x)}$.
\begin{codeexample}[]
-\pgfmathparse{ceil(32.5/17)} \pgfmathresult
+\pgfmathparse{pow(2,7)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+
+\begin{math-function}{e}
+\mathcommand
+
+ Returns the value 2.718281828.
+{
+\catcode`\^=7
+
\begin{codeexample}[]
-\pgfmathparse{ceil(398/12)} \pgfmathresult
+\pgfmathparse{(e^2-e^-2)/2} \pgfmathresult
\end{codeexample}
+}
\end{math-function}
\begin{math-function}{exp(\mvar{x})}
+\mathcommand
+
{
\catcode`\^=7
- Maclaurin series for $e^x$.
+ Maclaurin series for $e^x$.
}
\begin{codeexample}[]
\pgfmathparse{exp(1)} \pgfmathresult
@@ -448,10 +557,14 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\begin{math-function}{ln(\mvar{x})}
+\mathcommand
+
{
\catcode`\^=7
- An approximation for for $\ln(\textrm{\mvar{x}})$.
+ An approximation for $\ln(\textrm{\mvar{x}})$.
+ This uses an algorithm due to Rouben Rostamian, and coefficients
+ suggested by Alain Matthes.
}
\begin{codeexample}[]
\pgfmathparse{ln(10)} \pgfmathresult
@@ -463,77 +576,183 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
-\begin{math-function}{pow(\mvar{x},\mvar{y})}
+\begin{math-function}{log10(\mvar{x})}
+\mathcommand[logten(\mvar{x})]
- Raises \mvar{x} to the power \mvar{y}.
+ An approximation for $\log_{10}(\textrm{\mvar{x}})$.
\begin{codeexample}[]
-\pgfmathparse{pow(2,7)} \pgfmathresult
+\pgfmathparse{log10(100)} \pgfmathresult
\end{codeexample}
\end{math-function}
-\begin{math-function}{sqrt(\mvar{x})}
+\begin{math-function}{log2(\mvar{x})}
+\mathcommand[logtwo(\mvar{x})]
- Calculates $\sqrt{\textrm{\mvar{x}}}$.
+ An approximation for $\log_2(\textrm{\mvar{x}})$.
\begin{codeexample}[]
-\pgfmathparse{sqrt(10)} \pgfmathresult
+\pgfmathparse{log2(128)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{abs(\mvar{x})}
+\mathcommand
+
+ Evaluates the absolute value of $x$.
+
\begin{codeexample}[]
-\pgfmathparse{sqrt(8765.432)} \pgfmathresult
+\pgfmathparse{abs(-5)} \pgfmathresult
\end{codeexample}
+\begin{codeexample}[]
+\pgfmathparse{-abs(4*-3)} \pgfmathresult
+\end{codeexample}
\end{math-function}
-\begin{math-function}{veclen(\mvar{x},\mvar{y})}
+\begin{math-function}{mod(\mvar{x},\mvar{y})}
+\mathcommand
- Calculates $\sqrt{\left(\textrm{\mvar{x}}^2+\textrm{\mvar{y}}^2\right)}$.
+ This evaluates \mvar{x} modulo \mvar{y}, using truncated division.
+ The sign of the result is the same as the sign of
+ $\frac{\textrm{\mvar{x}}}{\textrm{\mvar{y}}}$.
\begin{codeexample}[]
-\pgfmathparse{veclen(12,5)} \pgfmathresult
+\pgfmathparse{mod(20,6)} \pgfmathresult
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathparse{mod(-100,30)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{Mod(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This evaluates \mvar{x} modulo \mvar{y}, using floored division.
+ The sign of the result is never negative.
+
+\begin{codeexample}[]
+\pgfmathparse{Mod(-100,30)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+
+
+
+\subsubsection{Rounding functions}
+
+\label{pgfmath-functions-rounding}
+
+\begin{math-function}{round(\mvar{x})}
+\mathcommand
+
+ Rounds \mvar{x} to the nearest integer. It uses ``asymmetric half-up''
+ rounding. So |1.5| is rounded to |2|, but |-1.5| is rounded to |-2|
+ (\emph{not} |1|).
+
+\begin{codeexample}[]
+\pgfmathparse{round(32.5/17)} \pgfmathresult
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathparse{round(398/12)} \pgfmathresult
\end{codeexample}
\end{math-function}
-\begin{math-constant}{pi}
+\begin{math-function}{floor(\mvar{x})}
+\mathcommand
- The constant $\pi=3.14159$.
+ Rounds \mvar{x} down to the nearest integer.
\begin{codeexample}[]
-\pgfmathparse{pi} \pgfmathresult
+\pgfmathparse{floor(32.5/17)} \pgfmathresult
\end{codeexample}
\begin{codeexample}[]
-\pgfmathparse{pi r} \pgfmathresult
+\pgfmathparse{floor(398/12)} \pgfmathresult
\end{codeexample}
-\end{math-constant}
+\end{math-function}
-\begin{math-operator}{\mvar{x}\ r}
+\begin{math-function}{ceil(\mvar{x})}
+\mathcommand
- This converts \mvar{x} from radians to degrees. Note that |r| will
- evaluate any preceding series of multiplication or division
- \emph{before} conversion, but not other operations. So |3*4/6r|
- converts 2 radians to degrees, but |3-4+6r|, converts 6 radians to
- degrees and adds the result to |-1|.
+ Rounds \mvar{x} up to the nearest integer.
\begin{codeexample}[]
-\pgfmathparse{2*pi r-pi r} \pgfmathresult
+\pgfmathparse{ceil(32.5/17)} \pgfmathresult
\end{codeexample}
\begin{codeexample}[]
-\pgfmathparse{2*pi/8 r} \pgfmathresult
+\pgfmathparse{ceil(398/12)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{int(\mvar{x})}
+\mathcommand
+
+ Returns the integer part of \mvar{x}.
+
\begin{codeexample}[]
-\pgfmathparse{sin(3*pi/2r)*60} \pgfmathresult
+\pgfmathparse{int(32.5/17)} \pgfmathresult
\end{codeexample}
-\end{math-operator}
+\end{math-function}
+
+\begin{math-function}{frac(\mvar{x})}
+\mathcommand
+
+ Returns the fractional part of \mvar{x}.
+
+\begin{codeexample}[]
+\pgfmathparse{frac(32.5/17)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{real(\mvar{x})}
+\mathcommand
+
+ Ensures \mvar{x} contains a decimal point.
+
+\begin{codeexample}[]
+\pgfmathparse{real(4)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+
+
+\subsubsection{Trigonometric functions}
+
+\label{pgfmath-functions-trigonometric}
+
+\begin{math-function}{pi}
+\mathcommand
+
+ Returns the value $\pi=3.141592654$.
+
+\begin{codeexample}[]
+\pgfmathparse{pi} \pgfmathresult
+\end{codeexample}
+
+\begin{codeexample}[]
+\pgfmathparse{pi r} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
\begin{math-function}{rad(\mvar{x})}
+\mathcommand
Convert \mvar{x} to radians. \mvar{x} is assumed to be in degrees.
@@ -544,6 +763,7 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{deg(\mvar{x})}
+\mathcommand
Convert \mvar{x} to degrees. \mvar{x} is assumed to be in radians.
@@ -554,8 +774,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{sin(\mvar{x})}
+\mathcommand
- Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -563,14 +784,15 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{codeexample}
\begin{codeexample}[]
-\pgfmathparse{sin(pi/3 r)}
+\pgfmathparse{sin(pi/3 r)} \pgfmathresult
\end{codeexample}
\end{math-function}
\begin{math-function}{cos(\mvar{x})}
+\mathcommand
- Cosine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Cosine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -584,8 +806,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{tan(\mvar{x})}
+\mathcommand
- Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -600,8 +823,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\begin{math-function}{sec(\mvar{x})}
+\mathcommand
- Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -611,8 +835,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{cosec(\mvar{x})}
+\mathcommand
- Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -622,8 +847,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{cot(\mvar{x})}
+\mathcommand
- Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
radians.
\begin{codeexample}[]
@@ -633,6 +859,7 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{asin(\mvar{x})}
+\mathcommand
Arcsine of \mvar{x}. The result is in degrees and in the range $\pm90^\circ$.
@@ -643,9 +870,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{acos(\mvar{x})}
+\mathcommand
- Arccosine of \mvar{x} in degrees. The result is in the range $\pm90^\circ$.
-
+ Arccosine of \mvar{x} in degrees. The result is in the range $[0^\circ,180^\circ]$.
\begin{codeexample}[]
\pgfmathparse{acos(0.5)} \pgfmathresult
@@ -654,8 +881,9 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
\begin{math-function}{atan(\mvar{x})}
+\mathcommand
- Arctangent of $x$ in degrees.
+ Arctangent of $x$ in degrees.
\begin{codeexample}[]
\pgfmathparse{atan(1)} \pgfmathresult
@@ -663,34 +891,392 @@ calculation will be an approximation of $e^{y\ln(x)}$.
\end{math-function}
-\begin{math-function}{rnd}
+\begin{math-function}{atan2(\mvar{x},\mvar{y})}
+\mathcommand[atantwo(\mvar{x},\mvar{y})]
- Generates a pseudo-random number between 0 and 1.
+ Arctangent of $y\div x$ in degrees. This also takes into account the
+ quadrants.
+
+\begin{codeexample}[]
+\pgfmathparse{atan2(-4,3)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\subsubsection{Comparison and logical functions}
+
+\label{pgfmath-functions-comparison}
+
+\begin{math-function}{equal(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}=\mvar{y}$ and |0| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{equal(20,20)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{greater(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}>\mvar{y}$ and |0| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{greater(20,25)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{less(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}<\mvar{y}$ and |0| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{greater(20,25)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{notequal(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |0| if $\mvar{x}=\mvar{y}$ and |1| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{notequal(20,25)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{notgreater(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}\leq\mvar{y}$ and |0| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{notgreater(20,25)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{notless(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}\geq\mvar{y}$ and |0| otherwise.
+
+\begin{codeexample}[]
+\pgfmathparse{notless(20,25)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{and(\mvar{x},\mvar{y})}
+\mathcommand
+ This returns |1| if \mvar{x} and \mvar{y} both evaluate to
+ non-zero values. Otherwise |0| is returned.
+
\begin{codeexample}[]
-\pgfmathparse{rnd} \pgfmathresult
+\pgfmathparse{and(5>4,6>7)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{or(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This returns |1| if either \mvar{x} or \mvar{y} evaluate to
+ non-zero values. Otherwise |0| is returned.
+
\begin{codeexample}[]
-\pgfmathparse{2*rnd} \pgfmathresult
+\pgfmathparse{and(5>4,6>7)} \pgfmathresult
\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{not(\mvar{x})}
+\mathcommand
+
+ This returns |1| if $\mvar{x}=0$, otherwise |0|.
+
\begin{codeexample}[]
-\pgfmathparse{-rnd+5} \pgfmathresult
+\pgfmathparse{not(true)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+\begin{math-function}{ifthenelse(\mvar{x},\mvar{y},\mvar{z})}
+\mathcommand
+
+ This returns \mvar{y} if \mvar{x} evaluates to some non-zero value,
+ otherwise \mvar{z} is returned.
+
+\begin{codeexample}[]
+\pgfmathparse{ifthenelse(5==4,"yes","no")} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{true}
+\mathcommand
+
+ This evaluates to |1|.
+
+\begin{codeexample}[]
+\pgfmathparse{true ? "yes" : "no"} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{false}
+\mathcommand
+
+ This evaluates to |0|.
+
+\begin{codeexample}[]
+\pgfmathparse{false ? "yes" : "no"} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+
+\subsubsection{Pseudo-random functions}
+
+\label{pgfmath-functions-random}
+
+\begin{math-function}{rnd}
+\mathcommand
+
+ Generates a pseudo-random number between 0 and 1.
+
+\begin{codeexample}[]
+\foreach \x in {1,...,10}{\pgfmathparse{rnd}\pgfmathresult, }
\end{codeexample}
\end{math-function}
\begin{math-function}{rand}
+\mathcommand
Generates a pseudo-random number between -1 and 1.
\begin{codeexample}[]
-\pgfmathparse{rand} \pgfmathresult
+\foreach \x in {1,...,10}{\pgfmathparse{rand}\pgfmathresult, }
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{random(\opt{\mvar{x},\mvar{y}})}
+\mathcommand
+ This function takes zero, one or two arguments. If there are zero
+ arguments, a random number between 0 and 1 is generated. If there is
+ one argument \mvar{x}, a random integer between 1 and \mvar{x} is
+ generated. Finally, if there are two arguments, a random integer
+ between \mvar{x} and \mvar{y} is generated. If there are no
+ arguments the \pgfname{} command should be called as follows:
+ |\pgfmathrandom{}|.
+
+\begin{codeexample}[]
+\foreach \x in {1,...,10}{\pgfmathparse{random()}\pgfmathresult, }
+\end{codeexample}
+
+\begin{codeexample}[]
+\foreach \x in {1,...,10}{\pgfmathparse{random(100)}\pgfmathresult, }
+\end{codeexample}
+
+\begin{codeexample}[]
+\foreach \x in {1,...,10}{\pgfmathparse{random(232,762)}\pgfmathresult, }
\end{codeexample}
+\end{math-function}
+
+\subsubsection{Base conversion functions}
+
+\label{pgfmath-functions-base}
+\begin{math-function}{hex(\mvar{x})}
+\mathcommand
+
+ Convert \mvar{x}{} (assumed to be an integer in base 10) to a
+ hexadecimal representation, using lower case alphabetic digits.
+ No further calculation will be possible with the result.
+
\begin{codeexample}[]
-\pgfmathparse{rand*15} \pgfmathresult
-\end{codeexample}
+\pgfmathparse{hex(65535)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{Hex(\mvar{x})}
+\mathcommand
+
+ Convert \mvar{x}{} (assumed to be an integer in base 10) to a
+ hexadecimal representation, using upper case alphabetic digits.
+ No further calculation will be possible with the result.
+
+\begin{codeexample}[]
+\pgfmathparse{Hex(65535)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{oct(\mvar{x})}
+\mathcommand
+ Convert \mvar{x}{} (assumed to be an integer in base 10) to a
+ octal representation.
+ No further calculation should be attempted with the result, as
+ the parser can only process numbers converted to base 10.
+\begin{codeexample}[]
+\pgfmathparse{oct(63)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{bin(\mvar{x})}
+\mathcommand
+
+ Convert \mvar{x}{} (assumed to be an integer in base 10) to a
+ binary representation.
+ No further calculation should be attempted with the result, as
+ the parser can only process numbers converted to base 10.
+
+\begin{codeexample}[]
+\pgfmathparse{bin(185)} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\subsubsection{Miscellaneous functions}
+
+\label{pgfmath-functions-misc}
+
+\begin{math-function}{min(\mvar{x$_1$},\mvar{x$_2$},\ldots,\mvar{x$_n$})}
+\mathcommand[min({\mvar{x$_1$},\mvar{x$_2$},\ldots},{\ldots,\mvar{x$_{n-1}$},\mvar{x$_n$}})]
+
+ Return the minimum value from \mvar{x$_1$}\ldots\mvar{x$_n$}.
+ For historical reasons, the command |\pgfmathmin| takes two
+ arguments, but each of these can contain an arbitrary number
+ of comma separated values.
+
+\begin{codeexample}[]
+\pgfmathparse{min(3,4,-2,250,-8,100)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+\begin{math-function}{max(\mvar{x$_1$},\mvar{x$_2$},\ldots,\mvar{x$_n$})}
+\mathcommand[max({\mvar{x$_1$},\mvar{x$_2$},\ldots},{\ldots,\mvar{x$_{n-1}$},\mvar{x$_n$}})]
+
+ Return the maximum value from \mvar{x$_1$}\ldots\mvar{x$_n$}.
+ Again, for historical reasons, the command |\pgfmathmax| takes two
+ arguments, but each of these can contain an arbitrary number
+ of comma separated values.
+
+\begin{codeexample}[]
+\pgfmathparse{max(3,4,-2,250,-8,100)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+\begin{math-function}{veclen(\mvar{x},\mvar{y})}
+\mathcommand
+
+ Calculates $\sqrt{\left(\textrm{\mvar{x}}^2+\textrm{\mvar{y}}^2\right)}$.
+ This uses a polynomial approximation, based on ideas due
+ to Rouben Rostamian
+\begin{codeexample}[]
+\pgfmathparse{veclen(12,5)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+
+
+
+\begin{math-function}{array(\mvar{x},\mvar{y})}
+\mathcommand
+
+ This accesses the array \mvar{x} at the index \mvar{y}. The
+ array must begin and end with braces (e.g., |{1,2,3,4}|) and
+ array indexing starts at |0|.
+
+\begin{codeexample}[]
+\pgfmathparse{array({9,13,17,21},2)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+
+The following hyperbolic functions were adapted from code
+suggested by Martin Heller:
+
+\begin{math-function}{sinh(\mvar{x})}
+\mathcommand
+
+ The hyperbolic sine of \mvar{x}%
+
+\begin{codeexample}[]
+\pgfmathparse{sinh(0.5)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{cosh(\mvar{x})}
+\mathcommand
+
+ The hyperbolic cosine of \mvar{x}%
+
+\begin{codeexample}[]
+\pgfmathparse{cosh(0.5)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{tanh(\mvar{x})}
+\mathcommand
+
+ The hyperbolic tangent of \mvar{x}%
+
+\begin{codeexample}[]
+\pgfmathparse{tanh(0.5)} \pgfmathresult
+\end{codeexample}
+
+\end{math-function}
+
+\begin{math-function}{width("\mvar{x}")}
+\mathcommand
+
+ Return the width of a \TeX{} (horizontal) box containing \mvar{x}.
+ The quote characters are necessary to prevent \mvar{x}{} being
+ parsed.
+ It is important to remember that any expression is expanded with
+ |\edef| before being parsed, so any macros (e.g., font commands
+ like |\tt| or |\Huge|) will need to be ``protected'' (e.g.,
+ |\noexpand\Huge| is usually sufficient).
+
+\begin{codeexample}[]
+\pgfmathparse{width("Some Lovely Text")} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{height("\mvar{x}")}
+\mathcommand
+
+ Return the height of a box containing \mvar{x}.
+
+\begin{codeexample}[]
+\pgfmathparse{height("Some Lovely Text")} \pgfmathresult
+\end{codeexample}
+\end{math-function}
+
+\begin{math-function}{depth("\mvar{x}")}
+\mathcommand
+
+ Returns the depth of a box containing \mvar{x}.
+
+\begin{codeexample}[]
+\pgfmathparse{depth("Some Lovely Text")} \pgfmathresult
+\end{codeexample}
\end{math-function}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex
new file mode 100644
index 00000000000..8668d69ad24
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex
@@ -0,0 +1,96 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+
+\section{Parser Module}
+
+\label{section-module-parser}
+
+\begin{pgfmodule}{parser}
+ This module defines some commands for creating a simple
+ letter-by-letter parser.
+\end{pgfmodule}
+
+This module provides commands for defining a parser that scans some
+given text letter-by-letter. For each letter, some code is executed
+and, possible, a state-switch occurs. The parsing process ends when a
+final state has been reached.
+
+\begin{command}{\pgfparserparse\marg{parser name}\meta{text}}
+ This command is used to parse the \meta{text} using the (previously
+ defined) parser named \meta{parser name}.
+
+ The \meta{text} is not contained in curly braces, rather it is all
+ the text that follows. The end of the text is determined implicitly,
+ namely when the final state of the parser has been reached.
+
+ The parser works as follows: At any moment, it is in a certain
+ \emph{state}, initially this state is called |initial|. Then, the
+ first letter of the \meta{text} is examined (using the |\futurlet|
+ command). For each possible state and each possible letter, some
+ action code is stored in the parser in a table. This code is then
+ executed. This code may, but need not, trigger a \emph{state
+ switch}, causing a new state to be set. The parser then moves on
+ to the next character of the text and repeats the whole
+ procedure, unless it is in the state |final|, which causes the
+ parsing process to stop immediately.
+
+ In the following example, the parser counts the number of |a|'s
+ in the \text{text}, ignoring any |b|'s. The \meta{text} ends with
+ the first~|c|.
+\begin{codeexample}[]
+\newcount\mycount
+\pgfparserdef{myparser}{initial}{the letter a}
+{\advance\mycount by 1\relax}
+\pgfparserdef{myparser}{initial}{the letter b}
+{} % do nothing
+\pgfparserdef{myparser}{initial}{the letter c}
+{\pgfparserswitch{final}}% done!
+
+\pgfparserparse{myparser}aabaabababbbbbabaabcccc
+There are \the\mycount\ a's.
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfparserdef\marg{parser name}\marg{state}\marg{symbol meaning}\marg{action}}
+ This command should be used repeatedly to define a parser named
+ \meta{parser name}. With a call to this command you specify that the
+ \meta{parser name} should do the following: When it is in state
+ \meta{state} and reads the letter \meta{symbol meaning}, perform the
+ code stored in \meta{action}.
+
+ The \meta{symbol meaning} must be the text that results from
+ applying the \TeX\ command |\meaning| to the given character. For
+ instance, |\meaning a| yields |the letter a|, while |\meaning 1|
+ yields |the character 1|. A space yields |blank space|.
+
+ Inside the \meta{action} you can perform almost any kind of
+ code. This code will not be surrounded by a scope, so its effect
+ persist after the parsing is done. However, each time after the
+ \meta{action} is executed, control goes back to the parser. You
+ should not launch a parser inside the \meta{action} code, unless you
+ put it in a scope.
+
+ When you set the \meta{state} to |all|, the state \meta{action} is
+ performed in all states as a fallback, whenever \meta{symbol
+ meaning} is encountered. This means that when you do not specify
+ anything explicitly for a state and a letter, but you do specify
+ something for |all| and this letter, then the specified
+ \meta{action} will be used.
+
+ When the parser encounters a letter for which nothing is specified
+ in the current state (neither directly nor indirectly via |all|), an
+ error occurs.
+\end{command}
+
+\begin{command}{\pgfparserswitch\marg{state}}
+ This command can be called inside the action code of a parser to
+ cause a state switch to \meta{state}.
+\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex
new file mode 100644
index 00000000000..5044c0bd183
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex
@@ -0,0 +1,653 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+
+\section{Object-Oriented Programming}
+
+\label{section-oop}
+
+This section describes the |oo| module.
+
+\begin{pgfmodule}{oo}
+ This module defines a relatively small set of \TeX\ commands for
+ defining classes, methods, attributes and objects in the sense of
+ object-oriented programming.
+\end{pgfmodule}
+
+In this chapter it is assumed that you are familiar with the basics
+of a typical object-oriented programming language like Java, C++ or
+Eiffel.
+
+
+
+\subsection{Overview}
+
+\TeX\ does not support object-oriented programming, presumably because
+it was written at a time when this style of programming was not yet
+``en vogue.'' When one is used to the object-oriented style of
+thinking, some programming constructs in \TeX\ often seem overly
+complicated. The object-oriented programming module of \pgfname\ may
+help here. It is written completely using simple \TeX\ macros and is,
+thus, perfectly portable. This also means, however, that it is not
+particularly fast (but not too slow either), so you should use it only
+for non-time-critical things.
+
+Basically, the oo-system supports \emph{classes} (in the
+object-oriented sense, this has nothing to do with \LaTeX-classes),
+\emph{methods}, \emph{constructors}, \emph{attributes},
+\emph{objects}, and \emph{object identities}. It (currently) does not
+support either inheritance, overloading, destructors, or class nesting.
+
+The first step is to define a class, using the macro |\pgfooclass|
+(all normal macros in \pgfname's object-oriented system start with
+|\pgfoo|). This macro gets the name of a class and in its body a
+number of \emph{methods} are defined. These are defined using the
+|\method| macro (which is defined only inside such a class definition)
+and they look a bit like method definitions in, say, Java. Object
+attributes are declared using the |\attribute| command, which is also
+defined only inside a class definition.
+
+Once a class has been defined, you can create objects of this
+class. Objects are created using |\pgfoonew|. Such an object has many
+characteristics of objects in a normal object-oriented programming
+language: Each object has a \emph{unique identity}, so when you create
+another object this object is completely distinct from all other
+objects. Each object also has a set of private attributes, which may
+change over time. Suppose, for instance, that we have a |point|
+class. Then creating a new object (called an instance) of this class
+would typically have an |x|-attribute and a |y|-attribute. These can
+be changed over time. Creating another instance of the
+|point| class creates another object with its own |x|- and
+|y|-attributes.
+
+Given an object, you can call a method for this object. Inside the
+method the attributes of the object for which the method is being
+called can be accessed.
+
+The life of an object always ends with the end of the \TeX\ scope in
+which it was created. However, changes to attribute values are not
+local to scopes, so when you change an attribute anywhere, this change
+persists till the end of the life of the object or until the attribute
+is changed again.
+
+\subsection{A Running Example: The Stamp Class}
+
+As a running example we will develop a |stamp| class and |stamp|
+objects. The idea is that a stamp object is able to ``stamp
+something'' on a picture. This means that a stamp object has an
+attribute storing the ``stamp text'' and there is a method that asks
+the object to place this text somewhere on a
+canvas. The method can be called repeatedly and there can be several
+different stamp objects, each producing a different text. Stamp
+objects can either be created dynamically when needed or a library
+might define many such objects in an outer scope.
+
+Such stamps are similar to many things present in \pgfname\ such as
+arrow tips, patterns, or shadings and, indeed, these could all have
+been implemented in this object-oriented fashion (which might have
+been better, but the object-oriented subsystem is a fairly new
+addition to \pgfname).
+
+
+\subsection{Classes}
+
+We start with the definition of the |stamp| class. This is done using
+the |\pgfooclass| macro:
+
+\begin{command}{\pgfooclass\marg{class name}\marg{body}}
+ This command defines a class named \meta{class name}. The name of
+ the class can contain spaces and most other characters, but no
+ periods. So, valid class names are |MyClass| or |my class| or
+ |Class_C++_emulation??1|.
+
+ The \meta{body} is actually just executed, so any
+ normal \TeX-code is permissible here. However, while the \meta{body} is
+ being executed, the macros |\method| and |\attribute| are setup so
+ that they can be used to define methods and attributes for this
+ class (the original meanings are restored afterward).
+
+ The definition of a class is local to the scope where the class has
+ been defined.
+\begin{codeexample}[code only]
+\pgfooclass{stamp}{
+ % This is the class stamp
+
+ \attribute text;
+ \attribute rotation angle=20;
+
+ \method stamp(#1) { % The constructor
+ ...
+ }
+
+ \method apply(#1,#2) { % Causes the stamp to be shown at coordinate (#1,#2)
+ ...
+ }
+}
+
+% We can now create objects of type "stamp"
+\end{codeexample}
+\end{command}
+
+The \meta{body} of a class usually just consists of calls to the macros
+|\attribute| and |\method|, which will be discussed in more detail in
+later sections.
+
+
+
+\subsection{Objects}
+
+Once a class has been declared, we can start creating objects for this
+class. For this the |\pgfoonew| command can be used, which has a
+peculiar syntax:
+
+\begin{command}{\pgfoonew\opt{\meta{object handle or attribute}|=|}|new |\meta{class
+ name}|(|\meta{constructor arguments}|)|}
+ Causes a new object to be created. The class of the object will be
+ \meta{class name}, which must previously have been declared using
+ |\pgfooclass|. Once the object has been created, the constructor
+ method of the object will be called with the parameter list set to
+ \meta{constructor arguments}.
+
+ The resulting object is stored internally and its lifetime will
+ end exactly at the end of the current scope.
+
+ Here is an example in which three stamp objects are created.
+\begin{codeexample}[code only]
+\pgfoonew \firststamp = new stamp()
+\pgfoonew \secondstamp = new stamp()
+{
+ \pgfoonew \thirdstamp = new stamp()
+ ...
+}
+% \thirdstamp no longer exists, but \firststamp and \secondstamp do
+% even if you try to store \thirdstamp in a global variable, trying
+% to access it will result in an error.
+\end{codeexample}
+
+ The optional \meta{object handle or attribute} can either be an
+ \meta{object handle} or an \meta{attribute}. When an \meta{object
+ handle} is give, it must be a normal \TeX\ macro name that will
+ ``point'' to the object (handles are discussed in more detail in
+ Section~\ref{section-identities}). You can use this macro to call
+ methods of the object as discussed in the following section. When an
+ \meta{attribute} is given, it must be given in curly braces (the
+ curly braces are used to detect the presence of an attribute). In
+ this case, a handle to the newly created object is stored in this
+ attribute.
+\begin{codeexample}[code only]
+\pgfooclass{foo}
+{
+ \attribute stamp obj;
+ \attribute another object;
+
+ \method \foo() {
+ \pgfoonew{stamp obj}=new stamp()
+ \pgfoonew{another object}=new bar()
+ }
+ ...
+}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfoogc}
+ This command causes the ``garbage collector'' to be invoked. The job
+ of this garbage collector is to free the global \TeX-macros that are
+ used by ``dead'' objects (objects whose life-time has ended). This
+ macro is called automatically after every scope in which an object
+ has been created, so you normally do not need to call this macro
+ yourself.
+\end{command}
+
+
+\subsection{Methods}
+
+Methods are defined inside the body of classes using the following
+command:
+
+\begin{command}{\method \meta{method name}|(|\meta{parameter list}|)|\marg{method body}}
+ This macro, which is only defined inside a class definition, defines
+ a new method named \meta{method name}. Just like class names, method
+ names can contain spaces and other characters, so \meta{method names} like
+ |put_stamp_here| or |put stamp here| are both legal.
+
+ Three method names are special: First, a method having the same name
+ as the class is called the \emph{constructor} of the class. The must be
+ such a method, even if its body is empty. There are (currently) no
+ destructors; objects simply become ``undefined'' at the
+ end of the scope in which they have been created. The other two
+ methods are called |get id| and |get handle|, which are always automatically
+ defined and which you cannot redefine. They are discussed in
+ Section~\ref{section-identities}.
+
+ Overloading of methods is not possible, that is, it is illegal to
+ have two methods inside a single class with the same name (despite
+ possibly different parameter lists). However, two different classes
+ may contain a method with the same name, that is, classes form
+ namespaces for methods.
+
+ The \meta{method name} must be followed by a \meta{parameter list}
+ in parentheses, which must be present even when the \meta{parameter
+ list} is empty. The \meta{parameter list} is actually a normal
+ \TeX\ parameter list that will be matched against the parameters
+ inside the parentheses upon method invocation and, thus, could be
+ something like |#1#2 foo #3 bar.|, but a list like |#1,#2,#3| is
+ more customary. By setting the parameter list to just |#1| and then
+ calling, say, |\pgfkeys{#1}| at the beginning of a method, you can
+ implement Objective-C-like named parameters.
+
+ When a method is called, the \meta{body} of
+ the method will be executed. The main difference to a normal macro
+ is that while the \meta{body} is executed a special macro called
+ |\pgfoothis| is setup in such a way that it references that object
+ for which the method is executed.
+\end{command}
+
+In order to call a method for an object, you first need to create the
+object and you need a handle for this object. In order to invoke a
+method for this object, a special syntax is used that is similar to
+Java or C++ syntax:
+
+\begin{pgfmanualentry}
+ \pgfmanualentryheadline{\meta{object handle}|.|\meta{method name}|(|\meta{parameters}|)|}%
+ \pgfmanualbody
+ This causes the method \meta{method name} to be called for the
+ object referenced by the \meta{object handle}. Naturally, the method
+ is the one defined in the class of the object. The \meta{parameters}
+ are matched against the parameters of the method and, then, the
+ method body is executed. The execution of the method body is
+ \emph{not} done inside a scope, so the effects of a method body
+ persist.
+
+\begin{codeexample}[code only]
+\pgfooclass{stamp}{
+ % This is the class stamp
+
+ \method stamp() { % The constructor
+ }
+
+ \method apply(#1,#2) { % Causes the stamp to be shown at coordinate (#1,#2)
+ % Draw the stamp:
+ \node [rotate=20,font=\huge] at (#1,#2) {Passed};
+ }
+}
+
+\pgfoonew \mystamp=new stamp()
+
+\begin{tikzpicture}
+ \mystamp.apply(1,2)
+ \mystamp.apply(3,4)
+\end{tikzpicture}
+\end{codeexample}
+
+ Inside a method, you can call other methods. If you have a handle
+ for another object, you can simply call it in the manner described
+ above. In order to call a method of the current object, you can use
+ the special object handle |\pgfoothis|.
+
+ \begin{command}{\pgfoothis}
+ This object handle is defined only when a method is being
+ executed. There, it is then set to point to the object for which
+ the method is being called, which allows you to call another
+ method for the same object.
+
+\begin{codeexample}[code only]
+\pgfooclass{stamp}{
+ % This is the class stamp
+
+ \method stamp() {}
+
+ \method apply(#1,#2) {
+ \pgfoothis.shift origin(#1,#2)
+
+ % Draw the stamp:
+ \node [rotate=20,font=\huge] {Passed};
+ }
+
+ % Private method:
+ \method shift origin(#1,#2) {
+ \tikzset{xshift=#1,yshift=#2}
+ }
+}
+\end{codeexample}
+ \end{command}
+\end{pgfmanualentry}
+
+
+
+\subsection{Attributes}
+
+Every object has a set of attributes, which may change over
+time. Attributes are declared using the |\attribute| command, which,
+like the |\method| command, is defined only inside the scope of
+|\pgfooclass|. Attributes can be modified (only) by methods. To take
+the |stamp| example, an attribute of a |stamp| object might be the
+text that should be stamped when the |apply| method is called.
+
+When an attribute is changed, this change is \emph{not} local to the
+current \TeX\ group. Changes will persist till the end
+of the object's life or until the attribute is changed once more.
+
+To declare an attribute you should use the |\attribute| command:
+\begin{command}{\attribute \meta{attribute name}\opt{|=|\meta{initial
+ value}}|;|}
+ This command can only be given inside the body of an |\pgfooclass|
+ command. It declares the attribute named \meta{attribute name}. This
+ name, like method or class names, can be quite arbitrary, but should
+ not contain periods. Valid names are |an_attribute?| or
+ |my attribute|.
+
+ You can optionally specify an \meta{initial value} for the
+ attribute; if none is given, the empty string is used
+ automatically. The initial value is the value that the attribute
+ will have just after the object has been created and before the
+ constructor is called.
+
+\begin{codeexample}[code only]
+\pgfooclass{stamp}{
+ % This is the class stamp
+
+ \attribute text;
+ \attribute rotation angle = 20;
+
+ \method stamp(#1) {
+ \pgfooset{text}{#1} % Set the text
+ }
+
+ \method apply(#1,#2) {
+ \pgfoothis.shift origin(#1,#2)
+
+ % Draw the stamp:
+ \node [rotate=\pgfoovalueof{rotation angle},font=\huge]
+ {\pgfoovalueof{text}};
+ }
+
+ \method shift origin(#1,#2) { ... }
+
+ \method set rotation (#1) {
+ \pgfooset{rotation angle}{#1}
+ }
+}
+\end{codeexample}
+\end{command}
+
+Attributes can be set and read only inside methods, it is not possible
+to do so using an object handle. Spoken in terms of traditional
+object-oriented programming, attributes are always private. You need
+to define getter and setter methods if you wish to read or modify
+attributes.
+
+Reading and writing attributes is not done using the ``dot-notation''
+that is used for method calls. This is mostly due to efficiency
+reasons. Instead, a set of special macros is used, all of which can
+\emph{only be used inside methods}.
+
+\begin{command}{\pgfooset\marg{attribute}\marg{value}}
+ Sets the \meta{attribute} of the current object to
+ \meta{value}.
+\begin{codeexample}[code only]
+\method set rotation (#1) {
+ \pgfooset{rotation angle}{#1}
+}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfoolet\marg{attribute}\marg{macro}}
+ Sets the \meta{attribute} of the current value to the current value
+ of \meta{macro} using \TeX's |\let| command.
+\begin{codeexample}[code only]
+\method foo () {
+ \pgfoolet{my func}\myfunc
+ % Changing \myfunc now has no effect on the value of attribute my func
+}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfoovalueof\marg{attribute}}
+ Expands (eventually) to the current value of \meta{attribute} of
+ the current object.
+\begin{codeexample}[code only]
+\method apply(#1,#2) {
+ \pgfoothis.shift origin(#1,#2)
+
+ \node [rotate=\pgfoovalueof{rotation angle},font=\huge]
+ {\pgfoovalueof{text}};
+}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfooget\marg{attribute}\marg{macro}}
+ Reads the current value of \meta{attribute} and stores the result in
+ \meta{macro}.
+\begin{codeexample}[code only]
+...
+ \method get rotation (#1) {
+ \pgfooget{rotation angle}{#1}
+ }
+...
+
+\mystamp.get rotation(\therotation)
+``\therotation'' is now ``20'' (or whatever).
+\end{codeexample}
+\end{command}
+
+
+\subsection{Identities}
+\label{section-identities}
+
+Every object has a unique identity, which is simply an integer. It is
+possible to retrieve the object id using the |get id| method (discussed
+below), but normally you will not need to do so because the id itself
+cannot be used to access an object. Rather, you access objects via
+their methods and these, in turn, can only be called via object
+handles.
+
+Object handles can be created in four ways:
+\begin{enumerate}
+\item Calling |\pgfoonew|\meta{object handle}|=...| will cause
+ \meta{object handle} to be a handle to the newly created object.
+\item Using |\let| to create an alias of an existing object handle: If
+ |\mystamp| is a handle, saying |\let\myotherstamp=\mystamp| creates
+ a second handle to the same object.
+\item |\pgfooobj|\marg{id} can be used as an object handle to the
+ object with the given \meta{id}.
+\item Using the |get handle| method to create a handle to a given object.
+\end{enumerate}
+
+Let us have a look at the last two methods.
+
+\begin{command}{\pgfooobj\marg{id}}
+ Provided that \meta{id} is the id of an existing object (an object
+ whose life-time has not expired), calling this command yields a
+ handle to this object. The handle can then be used to call methods:
+\begin{codeexample}[code only]
+% Create a new object:
+\pgfoonew \mystamp=new stamp()
+
+% Get the object's id and store it in \myid:
+\mystamp.get id(\myid)
+
+% The following two calls have the same effect:
+\mystamp.apply(1,1)
+\pgfooobj{\myid}.apply(1,1)
+\end{codeexample}
+\end{command}
+
+The |get id| method can be used to retrieve the id of an object. This
+method is predefined for every class and you should not try to define
+a method of this name yourself.
+
+\begin{predefinedmethod}{get id(\meta{macro})}
+ Calling \meta{obj}|.get id(|\meta{macro}|)| stores the id \meta{obj} in
+ \meta{macro}. This is mainly useful when you wish to store an
+ object for a longer time and you cannot guarantee that any handle
+ that you happen to have for this object will be available later on.
+
+ The only way to use the retrieved id later on is to call
+ |\pgfooobj|.
+
+ Different object that are alive (that are still within the scope in
+ which they were created) will always have different ids, so you can
+ use the id to test for equality of objects. However, after an object
+ has been destroyed because its scope has ended the same id may be
+ used again for newly created objects.
+
+ Here is a typical application where you need to call this method:
+ You wish to collect a list of objects for which you wish to call a
+ specific method from time to time. For the collection process you
+ wish to offer a macro called |\addtoobjectlist|, which takes an
+ object handle as parameter. It is quite easy to store this handle
+ somewhere, but a handle is, well, just a handle. Typically, shortly
+ after the call to |\addtoobjectlist| the handle will no longer be
+ valid or even exist, even though the object still exists. In this
+ case, you wish to store the object id somewhere instead of the
+ handle. Thus, for the object passed to |\addtoobjectlist| you call
+ the |get id| method and store the resulting id, rather than the handle.
+\end{predefinedmethod}
+
+There is a second predefined methods, called |get handle|, which is also
+used to create object handles.
+
+\begin{predefinedmethod}{get handle(\marg{macro name})}
+ Calling this method for an object will cause \meta{macro name} to
+ become a handle to the given object. For any object handle |\obj| --
+ other than |\pgfoothis| -- the following two have the same effect:
+ \begin{enumerate}
+ \item |\let|\meta{macro name}|=\obj|
+ \item |\obj.get handle(|\meta{macro name}|)|
+ \end{enumerate}
+
+ The first method is simpler and faster. However, for |\pgfoothis|
+ there is a difference: The call |\pgfoothis.get handle(|\meta{macro name}|)| will
+ cause \meta{macro name} to be an object handle to the current
+ object and will persist to be so even after the method is done. By
+ comparison, |\let|\meta{macro name}|=\pgfoothis| causes |\obj| to be
+ the same as the very special macro |\pgfoothis|, so |\obj| will
+ always refer to the current object, which may change over time.
+\end{predefinedmethod}
+
+
+
+
+\subsection{The Signal Class}
+
+\label{section-signals}
+
+The object-oriented module predefines, in addition to the basic mechanism
+for defining and using classes and object, one class: |signal|. This
+class implements a so-called signal--slot mechanism.
+
+\begin{ooclass}{signal}
+ This class is used to implement a simple signal--slot
+ mechanism. The idea is the following: Form time to time special
+ things happen about which a number of objects need to be
+ informed. Different things can happen and different object will be
+ interested in these things. A |signal| object can be used to signal
+ that such special things of a certain kind have happened. For
+ example, on signal object might be used to signal the event that ``a
+ page has been shipped out.'' Another signal might be used to signal
+ that ``a figure is about to be typeset,'' and so on.
+
+ Objects can ``tune in'' to signals. They do so by \emph{connecting}
+ one of their methods (then called a \emph{slot}) to the
+ signal. Then, whenever the signal is \emph{emitted}, the method of
+ the connected object(s) get called. Different objects can connect
+ different slots to the same signal as long as the argument lists
+ will fit. For example, the object that is used to signal the ``end
+ of page has been reached'' might emit signals that have, say, the
+ box number in which the finished page can be found as a parameter
+ (actually, the finished page is always in box 255). Then one object
+ could connect a method |handle page(#1)| to this signal, another
+ might connect the method |emergency action(#1)| to this signal, and
+ so on.
+
+ Currently, it is not possible to ``unregister'' or ``detach'' a slot
+ from a signal, that is, once an object has been connect to a signal,
+ it will continue to receive emissions of this signal till the end
+ of the life-time of the signal. This is even true when the object no
+ longer exists (but the signal does), so care must be taken that
+ signal objects are always created before the objects that are
+ listening to them.
+
+ \begin{method}{signal()}
+ The constructor does nothing.
+ \end{method}
+
+ \begin{method}{connect(\meta{object handle},\meta{method name})}
+ This method gets an \meta{object handle} as parameter and a
+ \meta{method name} of this object. It will queue the object-method
+ pair in an internal list and each time the signal emits something,
+ this object's method is called.
+
+ Be careful not to pass |\pgfoothis| as \meta{object handle}. This
+ would cause the signal object to connect to itself. Rather, if you
+ wish to connect a signal to a method of the current object you
+ first need to create an alias using the |get handle| method:
+\begin{codeexample}[code only]
+\pgfooclass{some class}{
+ \method some class() {
+ \pgfoothis.get handle(\me)
+ \somesignal.connect(\me,foo)
+ \anothersignal.connect(\me,bar)
+ }
+ \method foo () {}
+ \method bar (#1,#2) {}
+}
+\pgfoonew \objA=new some class()
+\pgfoonew \objB=new some class()
+\end{codeexample}
+ \end{method}
+
+ \begin{method}{emit(\meta{arguments})}
+ This method emits a signal to all connected slots. This means that
+ for all objects that have previously been connected via a call of
+ |connect|, the method (slot) that was specified during the call of
+ |connect| is invoked with given \meta{arguments}.
+\begin{codeexample}[code only]
+\anothersignal.emit(1,2)
+% will call \objA.bar(1,2) and \objB.bar(1,2)
+\end{codeexample}
+ \end{method}
+\end{ooclass}
+
+
+\subsection{Implementation Notes}
+
+For the curious, here are some notes on how the oo-system is
+implemented:
+
+\begin{itemize}
+\item There is an object id counter that gets incremented each time an
+ object is created. However, this counter is local to the current
+ scope, which means that it is reset at the end of each scope,
+ corresponding to the fact that at the end of a scope all objects
+ created in this scope become invalid. Newly created objects will
+ then have the same id as ``deleted'' objects.
+\item Attributes are stored globally. For each attribute of each
+ object there is a macro whose name is composed of the object's id
+ and the attribute name. Changes to object attributes are always
+ global.
+\item A call to the garbage collector causes a loop to be executed
+ that tries to find objects whose object number is larger than the
+ current maximum alive objects. The global attributes of these
+ objects are then freed (set to |\relax|) by calling a special
+ internal method of these (dead) objects.
+
+ The garbage collector is automatically called after each group in
+ which an object was created using |\aftergroup|.
+\item When a method is called, before the method call some code is
+ executed that sets a global counter storing the current object id to
+ the object id of the object being called. After the method call some
+ code is inserted that restores the global counter to its original
+ value. This is done without scopes, so some tricky |\expandafter|
+ magic is needed. Note that, because of this process, you cannot use
+ commands like |\pgfutil@ifnextchar| at the end of a method.
+\item An object handle contains just the code to setup and restore the
+ current object number to the number of the object being called.
+\end{itemize}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
index f6097340d54..57bf5b7cd98 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
@@ -188,10 +188,10 @@ select a layout using the following command:
\begin{itemize}
\item
\declare{|physical paper height=|\meta{size}} sets the
- height of the physical pape size to \meta{size}.
+ height of the physical page size to \meta{size}.
\item
\declare{|physical paper width=|\meta{size}} sets the
- width of the physical pape size to \meta{size}.
+ width of the physical Pappe size to \meta{size}.
\item
\declare{|a0paper|} sets the physical page size to DIN A0 paper.
\item
@@ -266,7 +266,7 @@ select a layout using the following command:
drawn in each corner. Next, a clipping region is set up that
contains all of the logical page except for little rounded
corners. Finally, the logical page is draw, clipped against the
- clipping region.
+ clipping region.
Note that every logical page should fill its background for this to
work.
@@ -306,7 +306,7 @@ select a layout using the following command:
\item \declare{|second bottom|} puts the second page below the main
page. This make the physical pages twice as high as the logical
ones.
- \item \declare{|second top|} works like |second bottom|.
+ \item \declare{|second top|} works like |second bottom|.
\end{itemize}
\end{pgflayout}
@@ -320,7 +320,7 @@ select a layout using the following command:
current page should be put there, once it is finished.
The same options as for |two screens with lagging second| may be
- given.
+ given.
\end{pgflayout}
@@ -440,13 +440,13 @@ following two commands are used to define the layout:
\item \declare{|logical pages=|\meta{logical pages}} specified how many
logical pages there are, in total. These are numbered 1 to
\meta{logical pages}.
- \item \declare{|first logical shipout=|\meta{first}}. See the the
+ \item \declare{|first logical shipout=|\meta{first}}. See the
next option. By default, \meta{first} is 1.
\item \declare{|last logical shipout=|\meta{last}}. Together
with the previous option, these two options define an interval of
pages inside the range 1 to \meta{logical pages}. Only this range
is used to store the pages that are shipped out by \TeX. This
- means that after a physical shipout has just occured (or at the
+ means that after a physical shipout has just occurred (or at the
beginning), the first time \TeX\ wishes to perform a shipout, the
page to be shipped out is stored in logical page \meta{first}. The
next time \TeX\ performs a shipout, the page is stored in logical
@@ -543,7 +543,7 @@ following two commands are used to define the layout:
|2| will double the size. ``At least'' means that if options like
|resize height| are given and if the scaling required to meet that
option is less than \meta{factor}, that other scaling is used
- instead.
+ instead.
\item
\declare{|xscale=|\meta{factor}}
scales the logical page along the $x$-axis by the given
@@ -560,7 +560,7 @@ following two commands are used to define the layout:
rotation need not be a multiple of |90|.
\item
\declare{|copy from=|\meta{logical page number}}.
- Normally, after a physical shipout has occured, all logical pages
+ Normally, after a physical shipout has occurred, all logical pages
are voided in a loop. However, if this option is given, the
current logical page is filled with the contents of the old
logical page number \meta{logical page number}.
@@ -605,7 +605,7 @@ following two commands are used to define the layout:
\declare{|corner width|=\meta{size}}
adds black ``rounded corners'' to the page. See the description of
the predefined layout |rounded corners| on
- page~\pageref{layout-rounded-corners}.
+ page~\pageref{layout-rounded-corners}.
\end{itemize}
\end{command}
@@ -644,14 +644,14 @@ following command:
\end{command}
The final way of setting a logical page is using the following
-command:
+command:
\begin{command}{\pgfpagescurrentpagewillbelogicalpage\marg{number}}
When the current \TeX\ page has been typeset, it will be become the given
logical page \meta{number}. This command ``interrupts'' the normal
order of logical pages, that is, it behaves like the previous
command and does not update the \meta{current logical page}
- counter.
+ counter.
\begin{codeexample}[code only]
\pgfpagesuselayout{two screens with optional second}
@@ -667,7 +667,7 @@ Text for main page.
\end{codeexample}
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
index 6526f40394f..318c01cf384 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
@@ -17,7 +17,7 @@ This section describes the package |pgfcalendar|.
This package can be used independently of \pgfname. It has two
purposes:
\begin{enumerate}
- \item It provides functions for working with dates. Most noticably,
+ \item It provides functions for working with dates. Most noticeably,
it can convert a date in ISO-standard format (like 1975-12-26) to
a so-called Julian day number, which is defined in Wikipedia as
follows: ``The Julian day or Julian day number is the
@@ -35,7 +35,7 @@ This section describes the package |pgfcalendar|.
is highly configurable and flexible (for example, it can produce
both plain text calendars and also complicated \tikzname-based
calendars), but most users will not use the macro directly. It is
- the job of a frontend to provide useful configruations for
+ the job of a frontend to provide useful configurations for
typesetting calendars based on this command.
\end{enumerate}
\end{package}
@@ -73,20 +73,20 @@ This section describes the package |pgfcalendar|.
\item |2006-01-01| refers to the first day of 2006.
\item |2006-02-last| refers to February 28, 2006.
\item |\year-\month-\day| refers to today.
- \item |2006-01-01+2| refser to January 3, 2006.
+ \item |2006-01-01+2| refers to January 3, 2006.
\item |\year-\month-\day+1| refers to tomorrow.
\item |\year-\month-\day+-1| refers to yesterday.
\end{itemize}
-
+
The conversion method is taken from the English Wikipedia entry on
- Julian days.
+ Julian days.
\newcount\mycount
\example |\pgfcalendardatetojulian{2007-01-14}{\mycount}| sets
|\mycount| to
\pgfcalendardatetojulian{2007-01-14}{\mycount}\the\mycount.
-
+
\end{command}
\begin{command}{\pgfcalendarjuliantodate\marg{Julian day}\marg{year
@@ -130,7 +130,7 @@ This section describes the package |pgfcalendar|.
\example |\pgfcalendarjuliantoweekday{2454115}{\mycount}| sets
|\mycount| to
- \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount.
+ \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount.
\end{command}
@@ -164,7 +164,7 @@ This section describes the package |pgfcalendar|.
\itemcalendaroption{Sunday} as above.
\itemcalendaroption{workday} Passed by Mondays, Tuesdays,
Wednesdays, Thursdays, and Fridays.
- \itemcalendaroption{weekend} Passed Saturdays and Sundays.
+ \itemcalendaroption{weekend} Passed Saturdays and Sundays.
\itemcalendaroption{equals}|=|\meta{reference} The \meta{reference}
can be in one of two forms: Either, it is a full ISO format date
like |2007-01-01| or the year may be missing as in |12-31|. In the
@@ -184,7 +184,7 @@ This section describes the package |pgfcalendar|.
year.
\itemcalendaroption{at most}|=|\meta{reference} as above.
\itemcalendaroption{between}|=|\meta{start reference}| and |\meta{end
- refernce} This test checks whether the current date lies between
+ reference} This test checks whether the current date lies between
the two given reference dates. Both full and short version may be
given.
@@ -258,16 +258,16 @@ This section describes the package |pgfcalendar|.
more details on translations.
\example |\pgfcalendarweekdayname{2}| yields
- \texttt{\pgfcalendarweekdayname{2}}.
+ \texttt{\pgfcalendarweekdayname{2}}.
\end{command}
\begin{command}{\pgfcalendarweekdayshortname\marg{week day number}}
- This command works similiarly to the previous command, only an
+ This command works similarly to the previous command, only an
abbreviated version of the week day is produced.
\example |\pgfcalendarweekdayshortname{2}| yields
- \texttt{\pgfcalendarweekdayshortname{2}}.
+ \texttt{\pgfcalendarweekdayshortname{2}}.
\end{command}
@@ -276,7 +276,7 @@ This section describes the package |pgfcalendar|.
is given by the \meta{month number}.
\example |\pgfcalendarmonthname{12}| yields
- \texttt{\pgfcalendarmonthname{12}}.
+ \texttt{\pgfcalendarmonthname{12}}.
\end{command}
@@ -284,7 +284,7 @@ This section describes the package |pgfcalendar|.
As above, only an abbreviated version is produced.
\example |\pgfcalendarmonthshortname{12}| yields
- \texttt{\pgfcalendarmonthshortname{12}}.
+ \texttt{\pgfcalendarmonthshortname{12}}.
\end{command}
@@ -319,14 +319,14 @@ documentation of this package for more details.
\medskip
\textbf{Basic typesetting process.}
A calendar is typeset as follows: The \meta{start date} and
- \meta{end date} specify a range of dates. For each date in this
+ \meta{end date} specify a range of dates. For each date in this
range the \meta{rendering code} is executed with certain macros
setup to yield information about the \emph{current date}
(the current date in the enumeration of dates of the
range). Typically, the \meta{rendering code} places nodes inside a
picture, but it can do other things as well. Note that it is also
the job of the \meta{rendering code} to position the calendar
- correctly.
+ correctly.
The different calls of the \meta{rending code} are not
surrounded by \TeX\ groups (though you can do so yourself, of
@@ -339,7 +339,7 @@ documentation of this package for more details.
\begin{itemize}
\item |\pgfcalendarprefix|
- The \meta{prefix} parameter. This prefix is recomended for nodes
+ The \meta{prefix} parameter. This prefix is recommended for nodes
inside the calendar, but you have to use it yourself explicitly.
\item |\pgfcalendarbeginiso|
The \meta{start date} of range being typeset in ISO format (like 2006-01-10).
@@ -349,7 +349,7 @@ documentation of this package for more details.
The \meta{end date} of range being typeset in ISO format.
\item |\pgfcalendarendjulian|
Julian day number of \meta{end date}.
- \item |\pgfcalendarcurrentjulian| This \TeX\ count holds the
+ \item |\pgfcalendarcurrentjulian| This \TeX\ count holds the
Julian day number of day currently begin rendered.
\item |\pgfcalendarcurrentweekday| The weekday
(a number with zero representing Monday) of the current date.
@@ -357,7 +357,7 @@ documentation of this package for more details.
\item |\pgfcalendarcurrentmonth| The month of the current date
(always two digits with a leading zero, if necessary).
\item |\pgfcalendarcurrentday| The day of month of the current date
- (alwyas two digits).
+ (always two digits).
\end{itemize}
\medskip
@@ -375,7 +375,7 @@ documentation of this package for more details.
In a first example, let us create a very simple calendar: It just
lists the dates in a certain range.
\begin{codeexample}[vbox,ignorespaces]
-\pgfcalendar{cal}{2007-01-20}{2007-02-10}{\pgfcalendarcurrentday\ }
+\pgfcalendar{cal}{2007-01-20}{2007-02-10}{\pgfcalendarcurrentday\ }
\end{codeexample}
Let us now make this a little more interesting: Let us add a line
break after each Sunday.
@@ -384,7 +384,7 @@ documentation of this package for more details.
{
\pgfcalendarcurrentday\
\ifdate{Sunday}{\par}{}
-}
+}
\end{codeexample}
We now want to have all Mondays to be aligned on a column. For this,
different approaches work. Here is one based positioning each day
@@ -395,7 +395,7 @@ documentation of this package for more details.
\leavevmode%
\hbox to0pt{\hskip\pgfcalendarcurrentweekday cm\pgfcalendarcurrentday\hss}%
\ifdate{Sunday}{\par}{}%
-}
+}
\end{codeexample}
Let us now typeset two complete months.
\begin{codeexample}[vbox,ignorespaces]
@@ -412,11 +412,11 @@ documentation of this package for more details.
}%
}%
\ifdate{Sunday}{\par}{}%
-}
+}
\end{codeexample}
- For our final example, we use a |{tikzpicture}|.
+ For our final example, we use a |{tikzpicture}|.
\begin{codeexample}[vbox,ignorespaces]
-\begin{tikzpicture}
+\begin{tikzpicture}
\pgfcalendar{cal}{2007-01-20}{2007-02-10}{%
\ifdate{workday}
{\tikzset{filling/.style={fill=blue!20}}}
@@ -452,12 +452,12 @@ documentation of this package for more details.
\end{itemize}
Normally, you should say |\let\%=\pgfcalendarshorthand| locally, so
that you can write |\%wt| instead of the much more cumbersome
- |\pgfcalendarshorthand{w}{t}|.
+ |\pgfcalendarshorthand{w}{t}|.
\begin{codeexample}[leave comments]
\let\%=\pgfcalendarshorthand
\pgfcalendar{cal}{2007-01-20}{2007-01-20}
-{ ISO form: \%y0-\%m0-\%d0, long form: \%wt, \%mt \%d-, \%y0}
+{ ISO form: \%y0-\%m0-\%d0, long form: \%wt, \%mt \%d-, \%y0}
\end{codeexample}
\end{command}
@@ -469,7 +469,5 @@ documentation of this package for more details.
calendar, followed by a hyphen, followed by the ISO format version
of the date. Thus, when the date |2007-01-01| is typeset in a
calendar for the prefix |mycal|, the macro expands to
- |mycal-2007-01-01|.
+ |mycal-2007-01-01|.
\end{command}
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
index fb89643018c..9c3ef4832a8 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
@@ -20,8 +20,8 @@ automatically by \tikzname, but not by \pgfname:
two new commands: |\foreach| and |\breakforeach|.
\end{package}
-\begin{command}{\foreach| |\meta{variables}| in |\meta{list}
- \meta{commands}}
+\begin{command}{\foreach| |\meta{variables}| |\opt{{\ttfamily[}\meta{options}{\ttfamily]}}%
+ | in |\meta{list} \meta{commands}}
The syntax of this command is a bit complicated, so let us go
through it step-by-step.
@@ -30,7 +30,10 @@ automatically by \tikzname, but not by \pgfname:
active characters. If you do not know what active characters are,
you are blessed.)
- Still in the easiest case, \meta{list} is either a comma-separated
+ Still in the easiest case, \meta{options} will be omitted. The keys
+ for customizing this command will be discussed below.
+
+ Again, in the easiest case, \meta{list} is either a comma-separated
list of values surrounded by curly braces or it is the name of a
macro that contain such a list of values. Anything can be used as a
value, but numbers are most likely.
@@ -112,7 +115,7 @@ automatically by \tikzname, but not by \pgfname:
\dots, $x+md$,'' where the last dots are semantic dots, not
syntactic dots. The value $m$ is the largest number such that $x +
md \le z$ if $d$ is positive or such that $x+md \ge z$ if $d$ is
- negative.
+ negative.
Perhaps it is best to explain this by some examples: The following
\meta{list} have the same effects:
@@ -133,8 +136,8 @@ automatically by \tikzname, but not by \pgfname:
$2^{-n}$ for some small $n$, rounding errors can occur pretty
easily. Thus, in the second last case, |0.5| should probably be
replaced by |0.501| for robustness.
-
- There is yet another special case for the |...| statement: If the
+
+ There is another special case for the |...| statement: If the
|...| is used right after the first item in the list, that is, if
there is an $x$, but no $y$, the difference $d$ obviously cannot be
computed and is set to $1$ if the number $z$ following the dots is
@@ -144,7 +147,26 @@ automatically by \tikzname, but not by \pgfname:
|\foreach \x in {9,...,3.5} {\x, }| yields \foreach \x in {9,...,3.5} {\x, }
- \medskip
+
+ There is a yet a further special case for the |...| statement, in that
+ it can indicate an alphabetic character sequence:
+
+ |\foreach \x in {a,...,m} {\x, }| yields \foreach \x in {a,...,m} {\x, }
+
+ |\foreach \x in {Z,X,...,M} {\x, }| yields \foreach \x in {Z,X,...,M} {\x, }
+
+ A final special case for the |...| statement is contextual replacement.
+ If the |...| is used in some context, for example, |sin(...)|, this
+ context will be interpreted correctly, provided that the list items
+ prior to the |...| statement have \emph{exactly} the same pattern,
+ except that, instead of dots, they have a number or a character:
+
+ |\foreach \x in {2^1,2^...,2^7} {$\x$, }| yields \foreach \x in {2^1,2^...,2^7} {$\x$, }
+
+ |\foreach \x in {0\pi,0.5\pi,...\pi,3\pi} {$\x$, }| yields \foreach \x in {0\pi,0.5\pi,...\pi,3\pi} {$\x$, }
+
+ |\foreach \x in {A_1,..._1,H_1} {$\x$, }| yields \foreach \x in {A_1,..._1,H_1} {$\x$, }
+
\textbf{Special handling of pairs.}
Different list items are separated by commas. However, this causes a
problem when the list items contain commas themselves as pairs like
@@ -160,7 +182,7 @@ automatically by \tikzname, but not by \pgfname:
\foreach \position in {(0,0), (1,1), (2,0), (3,1)}
\draw \position rectangle +(.25,.5);
\end{codeexample}
-
+
\medskip
\textbf{Using the foreach-statement inside paths.}
\tikzname\ allows you to use a |\foreach| statement inside a path
@@ -178,7 +200,7 @@ automatically by \tikzname, but not by \pgfname:
\begin{codeexample}[]
\tikz \draw \foreach \p in {1,...,3} {(\p,1)--(\p,3) (1,\p)--(3,\p)};
\end{codeexample}
-
+
\medskip
\textbf{Multiple variables.}
You will often wish to iterate over two variables at the same
@@ -211,7 +233,7 @@ automatically by \tikzname, but not by \pgfname:
\draw (\x,0) node{$\xtext$};
\end{tikzpicture}
\end{codeexample}
-
+
Here are more useful examples:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -224,7 +246,7 @@ automatically by \tikzname, but not by \pgfname:
% Draw some connections:
\foreach \source/\target in {a/b, b/c, c/a, c/d}
- \draw (\source) .. controls +(.75cm,0pt) and +(-.75cm,0pt)..(\target);
+ \draw (\source) .. controls +(.75cm,0pt) and +(-.75cm,0pt)..(\target);
\end{tikzpicture}
\end{codeexample}
@@ -233,7 +255,7 @@ automatically by \tikzname, but not by \pgfname:
% Let's draw circles at interesting points:
\foreach \x / \y / \diameter in {0 / 0 / 2mm, 1 / 1 / 3mm, 2 / 0 / 1mm}
\draw (\x,\y) circle (\diameter);
-
+
% Same effect
\foreach \center/\diameter in {{(0,0)/2mm}, {(1,1)/3mm}, {(2,0)/1mm}}
\draw[yshift=2.5cm] \center circle (\diameter);
@@ -251,7 +273,7 @@ automatically by \tikzname, but not by \pgfname:
\draw[line width=1pt] (\angle:1.8cm) -- (\angle:2cm);
\draw (\angle:1.4cm) node{\textsf{\label}};
}
-
+
\foreach \angle in {0,90,180,270}
\draw[line width=2pt] (\angle:1.6cm) -- (\angle:2cm);
@@ -266,6 +288,80 @@ automatically by \tikzname, but not by \pgfname:
\foreach \y / \colb in {0/red,1/green,2/blue,3/yellow}
\shade[ball color=\cola!50!\colb] (\x,\y) circle (0.4cm);
\end{codeexample}
+
+ \medskip
+ \textbf{Options to customize the foreach-statement.}
+
+ The keys described below can be used in the \meta{options} argument
+ to the |\foreach| command. They all have the path |/pgf/foreach/|,
+ however, the path is set automatically when \meta{options} are
+ parsed, so it does not have to explicitly stated.
+
+\begin{key}{/pgf/foreach/var=\meta{variable}}
+ This key provides an alternative way to specify variables:
+ |\foreach [var=\x,var=\y]| is the same as |\foreach \x/\y|.
+ If used, this key should be used before the other keys.
+\end{key}
+
+\begin{key}{/pgf/foreach/evaluate=\meta{variable}| |\opt{|as |\meta{macro}| using |\meta{formula}}}
+ By default list items are not evaluated: |1+2|, yields |1+2|,
+ not |3|. This key allows a variable to be evaluated using the
+ mathematical engine. The variable must have been specified either
+ using the |var| key or in the \meta{variables} argument of the
+ |foreach| command.
+ By default, the result of the evaluation will be stored in
+ \meta{variable}. However, the optional |as |\meta{macro} statement
+ can be used to store the result in \meta{macro}.
+
+\begin{codeexample}[]
+\foreach \x [evaluate=\x] in {2^0,2^...,2^8}{$\x$, }
+\end{codeexample}
+
+\begin{codeexample}[]
+\foreach \x [evaluate=\x as \xeval] in {2^0,2^...,2^8}{$\x=\xeval$, }
+\end{codeexample}
+
+ The optional |using |\meta{formula} statement means an evaluation
+ does not have to be explicitly stated for each item in \meta{list}.
+ The \meta{formula} should contain at least one reference to
+ \meta{variable}.
+
+\begin{codeexample}[]
+\tikz\foreach \x [evaluate=\x as \shade using \x*10] in {0,1,...,10}
+ \node [fill=red!\shade!yellow, minimum size=0.65cm] at (\x,0) {\x};
+\end{codeexample}
+
+\end{key}
+
+\begin{key}{/pgf/foreach/remember=\meta{variable}| as |\meta{macro}| |\opt{|(initially |\meta{value}|)|}}
+ This key allows the item value stored in \meta{variable} to be
+ remembered during the next iteration, stored in \meta{macro}.
+ If a variable is evaluated, the result of this evaluation is
+ remembered.
+ By default the value of \meta{variable} is zero for the first
+ iteration, however, the optional |(initially |\meta{value}|)|
+ statement, allows the \meta{macro} to be initially defined
+ as \meta{value}.
+
+\begin{codeexample}[]
+\foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{$\overrightarrow{\lastx\x}$, }
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/foreach/count=\meta{macro}| |\opt{|from |\meta{value}}}
+ This key allows \meta{macro} to hold the position in the list of
+ the current item. The optional |from |\meta{value} statement allows
+ the counting to begin from \meta{value}.
+
+\begin{codeexample}[]
+\tikz[x=0.75cm,y=0.75cm]
+ \foreach \x [count=\xi] in {a,...,e}
+ \foreach \y [count=\yi] in {\x,...,e}
+ \node [draw, top color=white, bottom color=blue!50, minimum size=0.666cm]
+ at (\xi,-\yi) {$\mathstrut\x\y$};
+\end{codeexample}
+\end{key}
+
\end{command}
@@ -274,7 +370,7 @@ automatically by \tikzname, but not by \pgfname:
executions of the \meta{commands} will occur. However, the current
execution of the \meta{commands} is continued normally, so it is
probably best to use this command only at the end of a |\foreach|
- command.
+ command.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -286,10 +382,8 @@ automatically by \tikzname, but not by \pgfname:
\ifnum \x<\y
\breakforeach
\fi
- }
+ }
\end{tikzpicture}
\end{codeexample}
-
-\end{command}
-
+\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
index 121e8b6b768..4ce292d380d 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
@@ -18,7 +18,7 @@ automatically by both \pgfname\ and \tikzname.
This package can be used independently of \pgfname. Note that no
other package of \pgfname\ needs to be loaded (so neither the
emulation layer nor the system layer is needed). The Con\TeX t
- abbreviation is |pgfkey| if |pgfmod| is not loaded.
+ abbreviation is |pgfkey| if |pgfmod| is not loaded. % pgfkey --> pgfkeys?
\end{package}
@@ -40,10 +40,6 @@ following:
\item |pgfkeys| organizes keys in a tree, while |keyval| and |xkeyval|
use families. In |pgfkeys| the families correspond to the root
entries of the key tree.
-\item For efficiency reasons, |pgfkeys| does not directly support
- setting keys drawn from multiple families as |xkeyval| does. This
- can be emulated if necessary, but it will be slower than |xkeyval|'s
- native support.
\item |pgfkeys| has no save-stack impact (you will have to read the
\TeX Book very carefully to appreciate this).
\item |pgfkeys| is slightly slower than |keyval|, but not much.
@@ -89,7 +85,7 @@ a new command. Rather, the |\pgfkeys| command can also be used to set
the code of a key. This is done using so-called \emph{handlers}. They
look like keys whose names look like ``hidden files in Unix'' since
they start with a dot. The handler for setting the code of a key is
-appropriately called |.code| and it is used as follows:
+appropriately called |/.code| and it is used as follows:
\begin{codeexample}[]
\pgfkeys{/my key/.code=The value is '#1'.}
\pgfkeys{/my key=hi!}
@@ -100,7 +96,7 @@ set to |hi!|.
There are numerous handlers for defining a key. For instance, we can
also define a key whose value actually consists of more than one
-parameter.
+parameter.
\begin{codeexample}[]
\pgfkeys{/my key/.code 2 args=The values are '#1' and '#2'.}
\pgfkeys{/my key={a1}{a2}}
@@ -108,7 +104,7 @@ parameter.
We often want to have keys where the code is called with some default
value if the user does not provide a value. Not surprisingly, this is
-also done using a handler, this time called |.default|.
+also done using a handler, this time called |/.default|.
\begin{codeexample}[]
\pgfkeys{/my key/.code=(#1)}
\pgfkeys{/my key/.default=hello}
@@ -117,15 +113,15 @@ also done using a handler, this time called |.default|.
The other way round, it is also possible to specify that a value
\emph{must} be specified, using a handler called
-|.value required|. Finally, you can also require that no value
-\emph{may} be specified using |.value forbidden|.
+|/.value required|. Finally, you can also require that no value
+\emph{may} be specified using |/.value forbidden|.
All keys for a package like, say, \tikzname\ start with the path
|/tikz|. We obviously do not like to write this path down every
time we use a key (so we do not have to write things like
|\draw[/tikz/line width=1cm]|). What we need is to somehow ``change
the default path to a specific location.'' This is done using the
-handler |.cd| (for ``change directory''). Once this handler has been
+handler |/.cd| (for ``change directory''). Once this handler has been
used on a key, all subsequent keys {\itshape in the current call of
|\pgfkeys| only} are automatically prefixed with this path, if
necessary.
@@ -180,12 +176,12 @@ different parts separated by slashes. A typical key might be
Let us fix some further terminology: Given a key like |/a/b/c|, we
call the part leading up the last slash (|/a/b|) the \emph{path} of
the key. We call everything after the last slash (|c|) the \emph{name}
-of the key (in a file system this would be the file name).
+of the key (in a file system this would be the file name).
We do not always wish to specify keys completely. Instead, we usually
specify only part of a key (typically only the name) and the
\emph{default path} is then added to the key at the front. So, when
-the default path is |/tikz| and you
+the default path is |/tikz| and you
refer to the (partial) key |line width|, the actual key that is used
is |/tikz/line width|. There is a simple rule for deciding whether a
key is a partial key or a full key: If it starts with a slash, then it
@@ -219,7 +215,7 @@ continue with the next subsection.
like |#| or unbalanced \TeX-ifs.
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
-\pgfkeysvalueof{/my family/my key}
+\pgfkeysvalueof{/my family/my key}
\end{codeexample}
The setting of a key is always local to the current \TeX\ group.
@@ -231,7 +227,7 @@ continue with the next subsection.
\begin{codeexample}[]
\def\helloworld{Hello, world!}
\pgfkeyslet{/my family/my key}{\helloworld}
-\pgfkeysvalueof{/my family/my key}
+\pgfkeysvalueof{/my family/my key}
\end{codeexample}
You should never let a key be equal to |\relax|. Such a key may or
may not be indistinguishable from an undefined key.
@@ -240,7 +236,7 @@ continue with the next subsection.
\begin{command}{\pgfkeysgetvalue\marg{full key}\marg{macro}}
Retrieves the tokens stored in the \meta{full key} and lets
\meta{macro} be equal to these tokens. If the key has
- not been set, the \meta{macro} will be equal to |\relax|.
+ not been set, the \meta{macro} will be equal to |\relax|.
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysgetvalue{/my family/my key}{\helloworld}
@@ -267,7 +263,7 @@ continue with the next subsection.
This command will use e\TeX's |\ifcsname| command, if available, for
efficiency. This means, however, that it may behave differently for
\TeX\ and for e\TeX\ when you set keys to |\relax|. For this reason
- you should not do so.
+ you should not do so.
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysifdefined{/my family/my key}{yes}{no}
@@ -290,7 +286,7 @@ taken. This action can be one of the following:
\item If the key's name (the part after the last slahs) is a known
\emph{handler}, then this handler will take care of the key.
\item If the key is totally unknown, one of several possible
- \emph{unknown key handlers} is called.
+ \emph{unknown key handlers} is called.
\end{enumerate}
Addtionally, if the \meta{value} is missing, a default value may or
@@ -316,8 +312,8 @@ let us have a quick look at the command itself.
then used. The default path is just the root path |/| when the first
key is handled, but it may change later on. At the end of the
command, the default path is reset to the value it had before this
- command was executed.
-
+ command was executed.
+
Calls of this command may be nested. Thus, it is permissible to call
|\pgfkeys| inside the code that is executed for a key. Since the
default path is restored after a call of |\pgfkeys|, the default
@@ -329,7 +325,7 @@ let us have a quick look at the command itself.
This command has the same effect as |\pgfkeys{|\meta{default
path}|/.cd,|\meta{key list}|}|, it is only marginally
quicker. This command should not be used in user code, but rather in
- commands like |\tikzset| or |\pgfset| that get called very often.
+ commands like |\tikzset| or |\pgfset| that get called very often.
\end{command}
\begin{command}{\pgfkeysalso\marg{key list}}
@@ -358,8 +354,8 @@ value is defined, it will be used as if you had written
\meta{key}|=|\meta{default value}.
In the following, the details of how default values are determined is
-described; however, you should normally use the handlers |.default|
-and |.value required| as described in
+described; however, you should normally use the handlers |/.default|
+and |/.value required| as described in
Section~\ref{section-default-handlers} and you can may wish to skip
the following details.
@@ -370,7 +366,7 @@ following happens:
particular, the commands |\pgfkeys{my key}| and
|\pgfkeys{my key=\pgfkeysnovalue}| have exactly the same effect and
you can ``simulate'' a missing value by providing the value
- |\pgfkeysnovalue|, which is sometimes useful.
+ |\pgfkeysnovalue|, which is sometimes useful.
\item If the \meta{value} is |\pgfkeysnovalue|, then it is checked
whether the subkey \meta{key}|/.@def| exists. For instance, if you
write |\pgfkeys{/my key}|, then it is checked whether the key
@@ -451,10 +447,27 @@ handlers described in Section~\ref{section-code-handlers}.
command.
\end{command}
-\begin{command}{\pgfkeysdeargs\marg{key}\marg{argument pattern}\marg{code}}
+\begin{command}{\pgfkeysdefnargs\marg{key}\marg{argument count}\marg{code}}
This command works like |\pgfkeysdef|, but it allows you to provide
- an arbitrary \meta{argument pattern} rather than just the simple
- single argument of |\pgfkeysdef|.
+ an arbitrary \meta{argument count} between $0$ and $9$ (inclusive).
+
+\begin{codeexample}[]
+\pgfkeysdefnargs{/my key}{2}{\def\a{#1}\def\b{#2}}
+\pgfkeys{/my key=
+ {hello}
+ {world}}
+
+|\a| is `\a', |\b| is `\b'.
+\end{codeexample}
+ The resulting key will expect exactly \marg{argument count} arguments.
+\end{command}
+\begin{command}{\pgfkeysedefnargs\marg{key}\marg{argument count}\marg{code}}
+ The |\edef| version of |\pgfkeysdefnargs|.
+\end{command}
+
+\begin{command}{\pgfkeysdefargs\marg{key}\marg{argument pattern}\marg{code}}
+ This command works like |\pgfkeysdefnargs|, but it allows you to provide
+ an arbitrary \meta{argument pattern} rather than just a number of arguments.
\begin{codeexample}[]
\pgfkeysdefargs{/my key}{#1+#2}{\def\a{#1}\def\b{#2}}
@@ -462,6 +475,7 @@ handlers described in Section~\ref{section-code-handlers}.
|\a| is \a, |\b| is \b.
\end{codeexample}
+ Note that |\pgfkeysdefnargs| is \emph{better} when it comes to simple argument \emph{counts}\footnote{When the resulting keys are used, the \texttt{defnargs} variant allows spaces between arguments whereas the \texttt{defargs} variant does not; it considers the spaces as part of the argument.}.
\end{command}
\begin{command}{\pgfkeysedefargs\marg{key}\marg{argument pattern}\marg{code}}
@@ -477,7 +491,7 @@ it is checked whether the \meta{key} itself exists (has been
previously assigned a value using, for instance,
|\pgfkeyssetvalue|). In this case, the tokens stored in \meta{key} are
replaced by \meta{value} and |\pgfkeys| proceeds with the next key in
-the \meta{key list}.
+the \meta{key list}.
\subsubsection{Keys That Are Handled}
@@ -500,7 +514,7 @@ key). It decomposed into two parts:
It is recommended (but not necessary) that the name of a handler
starts with a dot (but not with |.@|), so that they are easy to
- detect for the reader.
+ detect for the reader.
\end{enumerate}
(For efficiency reasons, these two macros are only setup at this point;
@@ -518,7 +532,7 @@ It is the job of the handlers to so something useful with the
For an example, let us write a handler that will output the value
stored in a key to the log file. We call this handler
-|.print to log|. The idea is that when someone tries to use the key
+|/.print to log|. The idea is that when someone tries to use the key
|/my key/.print to log|, then this key will not be defined and the
handler gets executed. The handler will then have access to the
path-part of the key, which is |/my key|, via the macro
@@ -549,8 +563,100 @@ name) and assign the parameter value to it.
\pgfkeys{/my key=hallo}
\end{codeexample}
+There are some parameters for handled keys which prove to be useful in some (possibly rare) special cases:
+\begin{key}{/handler config=\mchoice{all,only existing,full or existing} (initially all)}
+ Changes the initial configuration how key handlers will be used.
+
+ This configuration is for advanced users and rarely necessary.
+
+ \begin{description}
+ \item[\texttt{all}]
+ The preconfigured setting |all| works as described above and
+ imposes no restriction on the key setting process.
+
+ \item[\texttt{only existing}]
+ The value |only existing| modifies the algorithm for handled keys
+ as follows: a handler \meta{key name}|/.|\meta{handler} will be
+ executed only if \meta{key name} is either a key which stores its
+ value directly or a command key for which |/.@cmd| exists. If
+ \meta{key name} does \emph{not} exist already, the complete string
+ \meta{key name}|/.|\meta{handler} is considered to be an unknown
+ key and the procedure described in the next section applies (for
+ the path of \meta{key name}).
+\begin{codeexample}[]
+% Define a test key and error handlers:
+\pgfkeys{/the/key/.code={Initial definition. }}
+\pgfkeys{/handlers/.unknown/.code={Unknown key `\pgfkeyscurrentkey'. }}
+
+% calling the test key yields 'Initial definition. ':
+\pgfkeys{/the/key}
+
+% Change configuration:
+\pgfkeys{/handler config=only existing}
+
+% allowed: key *re*-definition:
+\pgfkeys{/the/key/.code={Re-Definition. }}
+% calling the key yields 'Re-Definition. ':
+\pgfkeys{/the/key}
+
+% not allowed: definition of new keys:
+% this checks for '/the/other key/.unknown'
+% and '/handlers/.unknown'
+% and yields finally
+% 'Unknown key `/the/other key/.code`'
+\pgfkeys{/the/other key/.code={New definition. }}
+\end{codeexample}
+ It is necessary to exclude some key handlers from this
+ procedure. Altogether, the detailed procedure is as follows:
+ \begin{enumerate}
+ \item If a handled key like |/a path/a key/.a handler=value| is
+ encountered, it is checked whether the handler should be
+ invoked. This is the case if
+ \begin{itemize}
+ \item An exception from |only existing| for this key exists (see below),
+ \item The key |/a path/a key| exists already -- either directly as
+ storage key or with the |.@cmd| suffix.
+ \end{itemize}
+ \item If the check passes, everything works as before.
+ \item If the check fails, the complete key will be considered to be
+ unknown. In that case, the handling of unknown keys as described
+ in the next section applies. There, the current key path will be
+ set to |/a path| and the current key's name to |key/.a handler|.
+ \end{enumerate}
+
+ A consequence of this configuration is to provide more meaningful
+ processing of handled keys if a search path for keys is in effect,
+ see section~\ref{sec:pgf:unknown:keys} for an example.
+
+ \item[\texttt{full or existing}] Finally, the choice
+ |full or existing| is a variant of |only existing|: it works in
+ the same way
+ for keys which do not have a full key path. For example, the style
+
+ |\pgfkeys{/my path/.cd,key/.style={|$\dotsc$|}}|
+
+ can only be redefined: it doesn't have a full path, so the
+ |only existing| mechanism applies. But the style
+
+ |\pgfkeys{/my path/key/.style={|$\dotsc$|}}|
+
+ will still work. This allows users to override the |only existing|
+ feature if they know what they're doing (and provide full key
+ paths).
+ \end{description}
+\end{key}
+
+\begin{key}{/handler config/only existing/add exception=\marg{key
+ handler name}}
+ Allows to add exceptions to the |/handler config=only existing|
+ feature. Initially exceptions for the key handlers
+ |/.cd|, |/.try|, |/.retry|, |/.lastretry| and |/.unknown| are
+ defined. The value \marg{key handler name} should be the name of a
+ key handler.
+\end{key}
\subsubsection{Keys That Are Unknown}
+\label{sec:pgf:unknown:keys}
For some keys, neither the key is defined nor its |.@cmd| subkey nor
is a handler defined for this key. In this case, it is checked whether
@@ -567,7 +673,7 @@ the code of the key \meta{my path prefix}|/.unknown|. This also allows
you to setup ``search paths.'' The idea is that you would like keys to
be searched not only in a single default path, but in
several. Suppose, for instance, that you would like keys to be
-searched
+searched
for in |/a|, |/b|, and |/b/c|. We setup a key |/my search path| for
this:
\begin{codeexample}[code only]
@@ -584,12 +690,67 @@ this:
\pgfkeys{/my search path/.cd,foo,bar}
\end{codeexample}
In the above code, |foo| and |bar| will be searched for in the three
-directories |/a|, |/b|, and |/b/c|.
+directories |/a|, |/b|, and |/b/c|. Before you start implementing
+search paths using this pattern, consider the |/.search also| handler
+discussed below.
If the key \meta{current path}|/.unknown/.@cmd| does not exist, the
handler |/handlers/.unknown| is invoked instead, which is always
defined and which prints an error message by default.
+\subsubsection{Search Paths And Handled Keys}
+
+There is one special case which occurs in the search path example
+above. What happens if we want to change a style? For example,
+\begin{codeexample}[code only]
+\pgfkeys{/my search path/.cd,custom/.style={variables}}
+\end{codeexample}
+\noindent could mean a style in |/my search path/|, |/a/|, |/b/| or
+even |/b/c/|!
+
+Due to the rules for handled keys, the answer is
+|/my search path/custom/.style={variables}|.
+It may be useful to modify this default behavior. One useful thing
+would be to search for \emph{existing} styles named |custom| and
+redefine them. For example, if a style |/b/custom| exists, the
+assignment |custom/.style={variables}| should probably redefine
+|/b/custom| instead of |/my search path/custom|. This can be done
+using |handler config|:
+\begin{codeexample}[]
+\pgfkeys{/my search path/.unknown/.code=
+ {%
+ \let\searchname=\pgfkeyscurrentname%
+ \pgfkeysalso{%
+ /a/\searchname/.try=#1,
+ /b/\searchname/.retry=#1,
+ /b/c/\searchname/.retry=#1%
+ }%
+ }%
+}
+
+% Let's define /b/custom here:
+\pgfkeys{/b/custom/.code={This is `\pgfkeyscurrentkey'. }}
+
+% Reconfigure treatment of key handlers:
+\pgfkeys{/handler config=only existing}
+
+% The search path procedure will find /b/custom
+% -> leads to This is `/b/custom'
+\pgfkeys{/my search path/.cd,custom}
+
+% Due to the reconfiguration, this will find /b/custom instead of
+% defining /my search path/custom:
+\pgfkeys{/my search path/.cd,custom/.append code={Modified. }}
+
+% So using the search path, we again find /b/custom which
+% leads to This is `/b/custom' Modified
+\pgfkeys{/my search path/.cd,custom}
+\end{codeexample}
+
+A slightly different approach to search paths can be realized using
+the |/.search also| key handler, see below.
+
+
\subsection{Key Handlers}
We now describe which key handlers are defined by default. You can
@@ -607,17 +768,138 @@ also define new ones as described in Section~\ref{section-key-handlers}.
\end{handler}
\begin{handler}{{.is family}}
+\label{section-is family-handler}
This handler sets up things such that when \meta{key} is executed, then
the current path is set to \meta{key}. A typical use is the following:
\begin{codeexample}[code only]
\pgfkeys{/tikz/.is family}
-\pgfkeys{tikz,line width=1cm}
+\pgfkeys{tikz,line width=1cm}
\end{codeexample}
The effect of this handler is the same as if you had written
\meta{key}|/.style=|\meta{key}|/.cd|, only the code produced by the
- |.is family| handler is quicker.
+ |/.is family| handler is quicker.
\end{handler}
+\begin{handler}{{.search also}=\marg{path list}}
+ A style which installs a |/.unknown| handler into \meta{key}. This
+ |/.unknown| handler will then search for unknown keys in every path
+ provided in \marg{path list}.
+
+\begin{codeexample}[]
+% define a key:
+\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}}
+
+% set up a search path:
+\pgfkeys{/main path/.search also={/secondary path}}
+
+% try searching for `option=value' in '/main path':
+% -> this finds `/secondary path/option'!
+\pgfkeys{/main path/.cd,option=value}
+\end{codeexample}
+
+ The |/.search also| handler follows the strategy
+ \begin{enumerate}
+ \item If a user provides a fully qualified key which could not be
+ found, for example the full string |/main path/option|, it assume
+ that the user new what he is doing -- and does \emph{not} continue
+ searching for |an option| in \marg{path list}.
+ \item If a user provides only the key's name, for example |option|
+ and |option| can't be found in the current default path (which is
+ |/main path| in our example above), the current default path is
+ set to the next element in \marg{path list} (which is
+ |/secondary path| here) and |\pgfkeys| will be restarted.
+
+ This will be iterated until either a match has been found or all
+ elements in \marg{path list} have been tested.
+
+ \item If all elements in \marg{path list} have been checked and the
+ key is still unknown, the fall-back handler |/handlers/.unknown|
+ will be invoked.
+ \end{enumerate}
+\begin{codeexample}[]
+% define a key:
+\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}}
+
+% set up a search path:
+\pgfkeys{/main path/.search also={/secondary path}}
+
+% try searching for `option=value' in '/main path':
+% -> this finds `/secondary path/option'!
+\pgfkeys{/main path/.cd,option=value}
+
+% negative example:
+% try searching for fully qualified key /main path/option.
+% This won't be handled by .search also.
+\pgfkeys{/handlers/.unknown/.code={Found unknown option \pgfkeyscurrentkeyRAW={#1}!}}%
+\pgfkeys{/main path/.cd,/main path/option=value}
+\end{codeexample}
+
+ Please note that the strategy of |/.search also| is different from
+ the first example provided in section~\ref{sec:pgf:unknown:keys}
+ ``Unknown Keys'' because |/.search also| only applies only for keys
+ which are not fully qualified.
+
+
+ For those who are familiar with |\pgfkeys|, the actual
+ implementation of |/.search also| might be interesting:
+ \begin{enumerate}
+ \item |\pgfkeys{/path/.search also={/tikz}}| is equivalent to
+\begin{codeexample}[code only]
+\pgfkeys{/path/.unknown/.code={%
+ \ifpgfkeysaddeddefaultpath
+ % only process keys for which no full path has been
+ % provided:
+ \pgfkeyssuccessfalse
+ \let\pgfkeys@searchalso@name =\pgfkeyscurrentkeyRAW
+ \ifpgfkeyssuccess
+ \else
+ % search with /tikz as default path:
+ \pgfqkeys{/tikz}{\pgfkeys@searchalso@name={#1}}%
+ \fi
+ \else
+ \def\pgfutilnext{\pgfkeysvalueof {/handlers/.unknown/.@cmd}#1\pgfeov}%
+ \pgfutilnext
+ \fi
+ }
+}
+\end{codeexample}
+ \item |\pgfkeys{/path/.search also={/tikz,/pgf}}| is equivalent to
+\begin{codeexample}[code only]
+\pgfkeys{/path/.unknown/.code={%
+ \ifpgfkeysaddeddefaultpath
+ \pgfkeyssuccessfalse
+ \let\pgfkeys@searchalso@name=\pgfkeyscurrentkeyRAW
+ \ifpgfkeyssuccess
+ \else
+ % step 1: search in /tikz with .try:
+ \pgfqkeys{/tikz}{\pgfkeys@searchalso@name/.try={#1}}%
+ \fi
+ \ifpgfkeyssuccess
+ \else
+ % step 2: search in /pgf (without .try!):
+ \pgfqkeys{/pgf}{\pgfkeys@searchalso@name={#1}}%
+ \fi
+ \else
+ \def\pgfutilnext{\pgfkeysvalueof {/handlers/.unknown/.@cmd}#1\pgfeov}%
+ \pgfutilnext
+ \fi
+ }
+}
+\end{codeexample}
+ \end{enumerate}
+
+ To also enable searching for styles (or other handled keys),
+ consider changing the configuration for handled keys to
+ |/hander config=full or existing| when you use |/.search also|,
+ that is, use
+\begin{codeexample}[code only]
+\pgfkeys{
+ /main path/.search also={/secondary path},
+ /handler config=full or existing}
+\end{codeexample}
+\end{handler}
+
+
\subsubsection{Setting Defaults}
\label{section-default-handlers}
@@ -643,7 +925,7 @@ also define new ones as described in Section~\ref{section-key-handlers}.
This handler works be adding code to the code of the key. This means
that you have to define the key first before you can use this
- handler.
+ handler.
\begin{codeexample}[code only]
\pgfkeys{/my key/.code=I do not want an argument!}
\pgfkeys{/my key/.value forbidden}
@@ -681,13 +963,13 @@ A number of handlers exist for defining the code of keys.
\end{handler}
\begin{handler}{{.ecode}|=|\meta{code}}
- This handler works like |.code|, only the command |\pgfkeysedef| is
- used.
+ This handler works like |/.code|, only the command |\pgfkeysedef| is
+ used.
\end{handler}
\begin{handler}{{.code 2 args}|=|\meta{code}}
- This handler works like |.code|, only two arguments rather than one
+ This handler works like |/.code|, only two arguments rather than one
are expected when the \meta{code} is executed. This means that when
\meta{key}|=|\meta{value} is encountered in a key list, the
\meta{value} should consist of two arguments. For instance,
@@ -695,42 +977,64 @@ A number of handlers exist for defining the code of keys.
executed with any occurrence of |#1| replaced |first| and any
occurrence of |#2| replaced by |second|.
- 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|.
-
\begin{codeexample}[code only]
\pgfkeys{/page size/.code 2 args={\paperheight=#2\paperwidth=#1}}
\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|.
\end{handler}
\begin{handler}{{.ecode 2 args}|=|\meta{code}}
- This handler works like |.code 2 args|, only an |\edef| is used
+ This handler works like |/.code 2 args|, only an |\edef| is used
rather than a |\def| to define the macro.
\end{handler}
+\begin{handler}{{.code n args}|=|\marg{argument count}\marg{code}}
+ This handler also works like |/.code|, but you can now specify a
+ number of arguments between $0$ and $9$ (inclusive).
+\begin{codeexample}[]
+\pgfkeys{/a key/.code n args={2}{First=`#1', Second=`#2'}}
+\pgfkeys{/a key={A}{B}}
+\end{codeexample}
+ In contrast to |/.code 2 args|, there must be exactly \meta{argument
+ count} arguments, not more and not less and these arguments should
+ be properly delimited.
+\end{handler}
+
+\begin{handler}{{.ecode n args}|=|\marg{argument count}\marg{code}}
+ This handler works like |/.code n args|, only an |\edef| is used
+ rather than a |\def| to define the macro.
+\end{handler}
\begin{handler}{{.code args}|=|\marg{argument pattern}\marg{code}}
- This handler also works like |.code|, but you can now specify an
- arbitrary \meta{argument pattern}. Such a pattern is a usual \TeX\
- macro pattern. For instance, suppose \meta{argument pattern} is
- |(#1/#2)| and \meta{key}|=|\meta{value} is encountered in a
- key list with \meta{value} being |(first/second)|. Then \meta{code}
- is executed with any occurrence of |#1| replaced |first| and any
- occurrence of |#2| replaced by |second|. So, the actual \meta{value}
- is matched against the \meta{argument pattern} in the standard \TeX\
- way.
+ This handler is the most flexible way to define a |/.code| key: you
+ can now specify an arbitrary \meta{argument pattern}. Such a pattern
+ is a usual \TeX\ macro pattern. For instance, suppose \meta{argument
+ pattern} is |(#1/#2)| and \meta{key}|=|\meta{value} is encountered
+ in a key list with \meta{value} being |(first/second)|. Then
+ \meta{code} is executed with any occurrence of |#1| replaced |first|
+ and any occurrence of |#2| replaced by |second|. So, the actual
+ \meta{value} is matched against the \meta{argument pattern} in the
+ standard \TeX\ way.
\begin{codeexample}[code only]
\pgfkeys{/page size/.code args={#1 and #2}{\paperheight=#2\paperwidth=#1}}
\pgfkeys{/page size=30cm and 20cm}
\end{codeexample}
+
+ Note that |/.code n args| should be preferred in case you need just a number
+ of arguments (when the resulting keys are used, |/.code n args|
+ gobbles spaces between the arguments whereas |/.code args| considers
+ spaces to be part of the argument).
\end{handler}
\begin{handler}{{.ecode args}|=|\marg{argument pattern}\marg{code}}
- This handler works like |.code args|, only an |\edef| is used
+ This handler works like |/.code args|, only an |\edef| is used
rather than a |\def| to define the macro.
\end{handler}
@@ -743,11 +1047,11 @@ There are also handlers for modifying existing keys.
\meta{append code} is added to this code at the end. Either can be
empty. The argument list of \meta{code} cannot be changed using this
handler. Note that both \meta{prefix code} and \meta{append code}
- may contain parameters like |#2|.
-
+ may contain parameters like |#2|.
+
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1}}
-\newdimen\myparindent
+\newdimen\myparindent
\pgfkeys{/par indent/.add code={}{\myparindent=#1}}
...
\pgfkeys{/par indent=1cm} % This will set both \parindent and
@@ -772,7 +1076,7 @@ There are also handlers for modifying existing keys.
The following handlers allow you to define \emph{styles}. A style is a
key list that is processed whenever the style is given as a key in a
key list. Thus, a style ``stands for'' a certain key value
-list. Styles can be parametrized just like normal code.
+list. Styles can be parameterized just like normal code.
\begin{handler}{{.style}|=|\meta{key list}}
This handler set things up so that whenever \meta{key}|=|\meta{value} is
@@ -784,7 +1088,7 @@ list. Styles can be parametrized just like normal code.
You can achieve the same effect by writing
\meta{key}|/.code=\pgfkeysalso{|\meta{key list}|}|. This means, in
particular, that the code of a key could also first execute some
- normal code and only then process some further keys.
+ normal code and only then process some further keys.
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1}}
@@ -794,7 +1098,7 @@ list. Styles can be parametrized just like normal code.
...
\pgfkeys{/normal indent}
\end{codeexample}
- The following example shows a parametrized style ``in action''.
+ The following example shows a parameterized style ``in action''.
\begin{codeexample}[]
\begin{tikzpicture}[outline/.style={draw=#1,fill=#1!20}]
\node [outline=red] {red box};
@@ -804,7 +1108,7 @@ list. Styles can be parametrized just like normal code.
\end{handler}
\begin{handler}{{.estyle}|=|\meta{key list}}
- This handler works like |.style|, only the \meta{code} is set using
+ This handler works like |/.style|, only the \meta{code} is set using
|\edef| rather than |\def|. Thus, all macros in the \meta{code} are
expanded prior to saving the style.
\end{handler}
@@ -812,10 +1116,10 @@ list. Styles can be parametrized just like normal code.
For styles the corresponding handlers as for normal code exist:
\begin{handler}{{.style 2 args}|=|\meta{key list}}
- This handler works like |.code 2 args|, only for styles. Thus, the
+ This handler works like |/.code 2 args|, only for styles. Thus, the
\meta{key list} may contain occurrences of both |#1| and |#2| and
when the style is used, two parameters must be given as
- \meta{value}.
+ \meta{value}.
\begin{codeexample}[code only]
\pgfkeys{/paper height/.code={\paperheight=#1},/paper width/.code={\paperwidth=#1}}
\pgfkeys{/page size/.style 2 args={/paper height=#1,/paper width=#2}}
@@ -824,24 +1128,28 @@ For styles the corresponding handlers as for normal code exist:
\end{handler}
\begin{handler}{{.estyle 2 args}|=|\meta{key list}}
- This handler works like |.style 2 args|, only an |\edef| is used
+ This handler works like |/.style 2 args|, only an |\edef| is used
rather than a |\def| to define the macro.
\end{handler}
\begin{handler}{{.style args}|=|\marg{argument pattern}\marg{key list}}
- This handler works like |.code args|, only for styles.
+ This handler works like |/.code args|, only for styles.
\end{handler}
\begin{handler}{{.estyle args}|=|\marg{argument pattern}\marg{code}}
- This handler works like |.ecode args|, only for styles.
+ This handler works like |/.ecode args|, only for styles.
+\end{handler}
+
+\begin{handler}{{.style n args}|=|\marg{argument count}\meta{key list}}
+ This handler works like |/.code n args|, only for styles. Here, \meta{key list} may depend on all \meta{argument count} parameters.
\end{handler}
\begin{handler}{{.add style}|=|\marg{prefix key list}\marg{append key list}}
- This handler works like |.add code|, only for styles. However, it is
+ This handler works like |/.add code|, only for styles. However, it is
permissible to add styles to keys that have previously been set
- using |.code|. (It is also permissible to add normal \meta{code} to
- a key that has previously been set using |.style|). When you add a
- style to a key that was previously set using |.code|, the following
+ using |/.code|. (It is also permissible to add normal \meta{code} to
+ a key that has previously been set using |/.style|). When you add a
+ style to a key that was previously set using |/.code|, the following
happens: When \meta{key} is processed, the \meta{prefix key list}
will be processed first, then the \meta{code} that was previously
stored in \meta{key}|/.@cmd|, and then the keys in \meta{append key
@@ -856,11 +1164,11 @@ For styles the corresponding handlers as for normal code exist:
\end{handler}
\begin{handler}{{.prefix style}|=|\meta{prefix key list}}
- Works like |.add style|, but only for the prefix key list.
+ Works like |/.add style|, but only for the prefix key list.
\end{handler}
\begin{handler}{{.append style}|=|\meta{append key list}}
- Works like |.add style|, but only for the append key list.
+ Works like |/.add style|, but only for the append key list.
\end{handler}
@@ -894,12 +1202,12 @@ that is directly stored in a key.
|/my key=\pgfkeysnovalue| and, thus, |\pgfkeysnovalue| will be
stored in |/my key|.
- To retrieve the value stored in a key, the handler |.get| is used.
+ To retrieve the value stored in a key, the handler |/.get| is used.
\end{handler}
\begin{handler}{{.get}|=|\meta{macro}}
Executes a |\let| command so that \meta{macro} contains the contents
- stored in \meta{key}.
+ stored in \meta{key}.
\begin{codeexample}[]
\pgfkeys{/my key/.initial=red}
@@ -914,6 +1222,21 @@ that is directly stored in a key.
value} at the end of the value stored in \meta{key}.
\end{handler}
+\begin{handler}{{.prefix}|=|\marg{prefix value}}
+ Adds the \meta{prefix value} and the beginning of the value stored in \meta{key}.
+\end{handler}
+
+\begin{handler}{{.append}|=|\marg{append value}}
+ Adds the \meta{append value} at the end of the value stored in \meta{key}.
+\end{handler}
+
+\begin{handler}{{.link}|=|\meta{another key}}
+ Stores the value |\pgfkeysvalueof{|\meta{another key}|}| in the
+ \meta{key}. The idea is that when you expand the \meta{key}, the
+ value of \meta{another key} is expanded instead. This corresponds
+ loosely to the notion of soft links in Unix, hence the name.
+\end{handler}
+
The next handler is useful for the common situation where
\meta{key}|=|\meta{value} should cause the \meta{value} to be stored
in some macro. Note that, typically, you could just as well store the
@@ -923,10 +1246,10 @@ value in the key itself.
This handler has the following effect: When you write
\meta{key}|=|\meta{value}, the code
|\def|\meta{macro}|{|\meta{value}|}| is executed. Thus, the given
- value is ``stored'' in the \meta{macro}.
+ value is ``stored'' in the \meta{macro}.
\begin{codeexample}[]
\pgfkeys{/text/.store in=\mytext}
-\def\a{world}
+\def\a{world}
\pgfkeys{/text=Hello \a!}
\def\a{Gruffalo}
\mytext
@@ -934,13 +1257,13 @@ value in the key itself.
\end{handler}
\begin{handler}{{.estore in}|=|\meta{macro}}
- This handler is similar to |.store in|, only the code
+ This handler is similar to |/.store in|, only the code
|\edef|\meta{macro}|{|\meta{value}|}| is used. Thus, the
macro-expanded version of \meta{value} is stored in the
- \meta{macro}.
+ \meta{macro}.
\begin{codeexample}[]
\pgfkeys{/text/.estore in=\mytext}
-\def\a{world}
+\def\a{world}
\pgfkeys{/text=Hello \a!}
\def\a{Gruffalo}
\mytext
@@ -948,18 +1271,18 @@ value in the key itself.
\end{handler}
In another common situation a key is used to set a \TeX-if to true or
-false.
+false.
\begin{handler}{{.is if}|=|\meta{\TeX-if name}}
This handler has the following effect: When you write
\meta{key}|=|\meta{value}, it is first checked that \meta{value} is
|true| or |false| (the default is |true| if no \meta{value} is
given). If this is not the case, the error key
- |/errors/boolean expected| is executed. Otherwise,
+ |/errors/boolean expected| is executed. Otherwise,
the code |\|\meta{\TeX-if name}\meta{value} is executed, which sets
the \TeX-if accordingly.
\begin{codeexample}[]
-\newif\iftheworldisflat
+\newif\iftheworldisflat
\pgfkeys{/flat world/.is if=theworldisflat}
\pgfkeys{/flat world=false}
\iftheworldisflat
@@ -995,7 +1318,7 @@ handler is useful.
\end{handler}
-\subsubsection{Expanding Values}
+\subsubsection{Expanded and Multiple Values}
When you write \meta{key}|=|\meta{value}, you usually wish to use the
\meta{value} ``as is.'' Indeed, great care is taken to ensure that you
@@ -1046,6 +1369,20 @@ Key 4:& \pgfkeys{/key4}
before processing \meta{key}|=|\meta{result}.
\end{handler}
+\begin{handler}{{.list}|=|\meta{comma-separated list of values}}
+ This handler causes the key to be used repeatedly, namely once for
+ every element of the list of values. Note that the list of values
+ should typically be surrounded by braces since, otherwise, \TeX\
+ will not be able to tell whether a comma starts a new key or a new
+ value.
+
+ The \meta{list of values} is processed using the |\foreach|
+ statement, so you can use the |...| notation.
+\begin{codeexample}[]
+\pgfkeys{/foo/.code=(#1)}
+\pgfkeys{/foo/.list={a,b,0,1,...,5}}
+\end{codeexample}
+\end{handler}
\subsubsection{Handlers for Testing Keys}
@@ -1053,13 +1390,13 @@ Key 4:& \pgfkeys{/key4}
This handler causes the same things to be done as if
\meta{key}|=|\meta{value} had been written instead. However, if
neither \meta{key}|/.@cmd| nor the key itself is defined, no
- handlers will be called. Instead,
+ handlers will be called. Instead,
the execution of the key just stops. Thus, this handler will ``try''
to use the key, but no further action is taken when the key is not
defined.
The \TeX-if |\||ifpgfkeyssuccess| will be set according to whether
- the \meta{key} was successfully executed or not.
+ the \meta{key} was successfully executed or not.
\begin{codeexample}[]
\pgfkeys{/a/.code=(a:#1)}
\pgfkeys{/b/.code=(b:#1)}
@@ -1068,9 +1405,9 @@ Key 4:& \pgfkeys{/key4}
\end{handler}
\begin{handler}{{.retry}|=|\meta{value}}
- This handler works just like |.try|, only it will not do anything if
+ This handler works just like |/.try|, only it will not do anything if
|\||ifpgfkeyssuccess| is false. Thus, this handler will only retry
- to set a key if ``the last attempt failed''.
+ to set a key if ``the last attempt failed''.
\begin{codeexample}[]
\pgfkeys{/a/.code=(a:#1)}
\pgfkeys{/b/.code=(b:#1)}
@@ -1078,6 +1415,10 @@ Key 4:& \pgfkeys{/key4}
\end{codeexample}
\end{handler}
+\begin{handler}{{.lastretry}|=|\meta{value}}
+ This handler works like |/.retry|, only it will invoke the usual handlers for unknowns keys if |\||ifpgfkeyssuccess| is false. Thus, this handlers will only try to set a key if ``the last attempt failed''. Furthermore, this here is the last such attempt.
+\end{handler}
+
\subsubsection{Handlers for Key Inspection}
@@ -1098,7 +1439,7 @@ Key 4:& \pgfkeys{/key4}
The following key is not a handler, but it also commonly used for
inspecting things:
\begin{key}{/utils/exec=\meta{code}}
- This key will simply execute the given \meta{code}.
+ This key will simply execute the given \meta{code}.
\example |\pgfkeys{some key=some value,/utils/exec=\show\hallo,obscure key=obscure}|
\end{key}
@@ -1118,7 +1459,7 @@ language currently set so that users get a localized error message.
\begin{key}{/errors/value required=\marg{offending key}\marg{value}}
This key is executed whenever an \meta{offending key} is used
- without a value when a value is actually required.
+ without a value when a value is actually required.
\end{key}
\begin{key}{/errors/value forbidden=\marg{offending key}\marg{value}}
@@ -1127,16 +1468,18 @@ language currently set so that users get a localized error message.
\end{key}
\begin{key}{/errors/boolean expected=\marg{offending key}\marg{value}}
- This key is executed whenever a key setup using |.is if| gets called
+ This key is executed whenever a key setup using |/.is if| gets called
with a \meta{value} other than |true| or |false|.
\end{key}
\begin{key}{/errors/unknown choice value=\marg{offending key}\marg{value}}
This key is executed whenever a choice is used as a \meta{value} for
- a key setup using the |.is choice| handler that is not defined.
+ a key setup using the |/.is choice| handler that is not defined.
\end{key}
\begin{key}{/errors/unknown key=\marg{offending key}\marg{value}}
This key is executed whenever a key is unknown and no specific
- |.unknown| handler is found.
+ |/.unknown| handler is found.
\end{key}
+
+\input pgfmanual-en-pgfkeysfiltered.tex
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex
new file mode 100644
index 00000000000..b5c7e260432
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex
@@ -0,0 +1,405 @@
+\subsection{Key Filtering}
+\begingroup
+
+{\small \emph{An extension by Christian Feuers\"anger}}
+\vspace{0.4cm}%
+
+\noindent
+Normally, a call to |\pgfkeys| sets all keys provided in its argument list. This is usually what users expect it to do. However, implementations of different packages or \pgfname-libraries may need more control over the key setting procedure: library~A may want to set its options directly and communicate all remaining ones to library~B.
+
+This section describes key filtering methods of \pgfname, including options for family groupings. If you merely want to use \pgfname\ (or its libraries), you can skip this section. It is addressed to package (or library) authors.
+
+\subsubsection{Starting With An Example}
+\label{section-key-filter-example}
+Users of |xkeyval| are familiar with the concept of key families: keys belong to groups and those keys can be `filtered' out of other options. \pgfname\ supports family groupings and more abstract key selection mechanism with |\pgfkeysfiltered|, a variant of |\pgfkeys|. Suppose we have the example key grouping
+
+\pgfkeys{
+ /my group/A1/.code=(A1:#1),
+ /my group/A2/.code=(A2:#1),
+ /my group/A3/.code=(A3:#1),
+ /my group/B/.code=(B:#1),
+ /my group/C/.code=(B:#1),
+ /my group/A/.is family,
+ /my group/A1/.belongs to family=/my group/A,
+ /my group/A2/.belongs to family=/my group/A,
+ /my group/A3/.belongs to family=/my group/A,
+ /pgf/key filters/active families/.install key filter,
+ /my group/A/.activate family,
+}%
+\begin{codeexample}[code only]
+\pgfkeys{
+ /my group/A1/.code=(A1:#1),
+ /my group/A2/.code=(A2:#1),
+ /my group/A3/.code=(A3:#1),
+ /my group/B/.code=(B:#1),
+ /my group/C/.code=(B:#1),
+}
+\end{codeexample}
+
+\noindent and we want to set options |A1|, |A2| and |A3| only. A call to |\pgfkeys| yields
+\begin{codeexample}[]
+\pgfkeys{/my group/A1=a1, /my group/A2=a2, /my group/B=b, /my group/C=c}
+\end{codeexample}
+\noindent because all those command option are processed consecutively.
+
+Now, let's define a family named |A| which contains |A1|, |A2| and |A3| and set only family members of |A|. We prepare our key settings with
+\begin{codeexample}[code only]
+\pgfkeys{
+ /my group/A/.is family,
+ /my group/A1/.belongs to family=/my group/A,
+ /my group/A2/.belongs to family=/my group/A,
+ /my group/A3/.belongs to family=/my group/A,
+}
+\end{codeexample}
+\noindent and
+\begin{codeexample}[code only]
+\pgfkeys{/pgf/key filters/active families/.install key filter}
+\end{codeexample}
+\noindent After this preparation, we can use |\pgfkeysfiltered| with
+\begin{codeexample}[]
+\pgfkeys{/my group/A/.activate family}
+\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2,
+ /my group/B=b, /my group/C=c}
+\end{codeexample}
+\noindent or
+\begin{codeexample}[]
+\pgfkeys{/my group/A/.activate family}
+\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2,
+ /my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3}
+\end{codeexample}
+\noindent to set only keys which belong to an `active' family -- in our case, only family~|A| was active, so the remaining options have not been processed. The family processing is quite fast and allows an arbitrary number of active key families.
+
+Unprocessed options can be collected into a macro (similar to |xkeyval|'s |\xkv@rm|), discarded or handled manually. The details of key selection and family declaration are described in the following sections.
+
+\subsubsection{Setting Filters}
+The command |\pgfkeysfiltered| is the main tool to process only selected options. It works as follows.
+\begin{command}{\pgfkeysfiltered\marg{key-value-list}}
+ Processes all options in exactly the same way as |\pgfkeys|\marg{key-value-list}, but a key filter is considered as soon as key identification is complete.
+
+ The key filter tells |\pgfkeysfiltered| whether it should continue to apply the current option (return value is `true') or whether something different shall be done (filter returns `false').
+
+ There is exactly one key filter in effect, and it is installed by the |.install key filter| handler or by |\pgfkeysinstallkeyfilter|.
+
+ If the key filter returns `false', a unique key filter handler gets control. This handler is installed by the |.install key filter handler| method and has access to the key's full name, value and (possibly) path.
+
+ Key filtering applies to any (possibly nested) call to |\pgfkeys|, |\pgfkeysalso|, |\pgfqkeys| and |\pgfqkeysalso| during the evaluation of \marg{key-value-list}. It does \emph{not} apply to routines like |\pgfkeyssetvalue| or |\pgfkeysgetvalue|. Furthermore, keys belonging to |/errors| are always processed. Key filtering routines can't be nested: you can't combine different key filters automatically.
+\end{command}
+
+\begin{command}{\pgfqkeysfiltered\marg{default-path}\marg{key-value-list}}
+ A variant of |\pgfkeysfiltered| which uses the `quick' search path setting. It is the |\pgfqkeys| variant of |\pgfkeysfiltered|, see the documentation for |\pgfqkeys| for more details.
+\end{command}
+
+\begin{command}{\pgfkeysalsofrom\marg{macro}}
+ A variant of |\pgfkeysalso| which loads its key list from \marg{macro}.
+
+ It is useful in conjunction with the |/pgf/key filter handlers/append filtered to=|\meta{macro} handler.
+
+ The following example uses the same settings as in the intro section~\ref{section-key-filter-example}.
+\begin{codeexample}[]
+\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions}
+\def\remainingoptions{}
+\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2,
+ /my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3}
+
+Remaining: `\remainingoptions'.
+\pgfkeysalsofrom{\remainingoptions}
+\end{codeexample}
+\end{command}
+
+\begin{command}{\pgfkeysalsofiltered\marg{key-value-list}}
+ This command works as |\pgfkeysfiltered|, but it does not change the current default path. See the documentation of |\pgfkeysalso| for more details.
+\end{command}
+
+\begin{command}{\pgfkeysalsofilteredfrom\marg{macro}}
+ A variant of |\pgfkeysalsofiltered| which loads its key list from \marg{macro}.
+\end{command}
+
+\begin{handler}{{.install key filter}|=|\meta{optional arguments}}
+ This handler install a key filter. A key filter is a command key which sets the \TeX-boolean |\ifpgfkeysfiltercontinue|, that means a key with existing `|/.@cmd|' suffix. A simple example is a key filter which returns always true:
+\begin{codeexample}[code only]
+\pgfkeys{/foo/bar/true key filter/.code={\pgfkeysfiltercontinuetrue}}
+\pgfkeys{/foo/bar/true key filter/.install key filter}
+\end{codeexample}
+ If key filters require arguments, they are installed by |.install key filter| as well. An example is the |/pgf/key filters/equals| handler:
+\begin{codeexample}[]
+\pgfkeys{/pgf/key filters/equals/.install key filter={/my group/A1}}
+\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2,
+/my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3}
+\end{codeexample}
+ If a key filter requires more than one argument, you need to provide the complete argument listing in braces like |{{first}{second}}|.
+
+ You can also use |\pgfkeysinstallkeyfilter|\meta{full key}\meta{optional arguments}, it has the same effect.
+
+ See section~\ref{section-key-writing-filters} for how to write key filters.
+\end{handler}
+
+\begin{handler}{{.install key filter handler}|=|\meta{optional arguments}}
+ This handler installs the routine which will be invoked for every \emph{unprocessed} option, that means any option for which the key filter returned `false'.
+
+ The |.install key filter handler| is used in the same way as |.install key filter|. There exists a macro version, |\pgfkeysinstallkeyfilterhandler|\meta{full key}\meta{optional arguments}, which has the same effect.
+
+ See section~\ref{section-key-writing-filters} for how to write key filter handlers.
+\end{handler}
+
+\subsubsection{Handlers For Unprocessed Keys}
+Each option for which key filters decided to skip them is handed over to a `key filter handler'. There are several predefined key filter handlers.
+
+\begin{key}{/pgf/key filter handlers/append filtered to=\marg{macro}}
+ Install this filter handler to append any unprocessed options to macro \marg{macro}.
+\begin{codeexample}[]
+\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions}
+\def\remainingoptions{}
+\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2,
+ /my group/B=b, /my group/C=c, /tikz/color=blue}
+
+Remaining options: `\remainingoptions'.
+\end{codeexample}
+ This example uses the same keys as defined in the intro section~\ref{section-key-filter-example}.
+\end{key}
+
+\begin{key}{/pgf/key filter handlers/ignore}
+ Install this filter handler if you simply want to ignore any unprocessed option. This is the default.
+\end{key}
+
+\begin{key}{/pgf/key filter handlers/log}
+ This key filter handler writes messages for any unprocessed option to your logfile (and terminal).
+\end{key}
+
+
+\subsubsection{Family Support}
+\pgfname supports a family concept: every option can be associated with (at most) one family. Families form loose key groups which are independent of the key hierarchy. For example, |/my tree/key1| can belong to family |/tikz|.
+
+It is possible to `activate' or `deactivate' single families. Furthermore, it is possible to set only keys which belong to active families using appropriate key filter handlers.
+
+The family support is fast: if there are $N$ options in a key-value-list and there are $K$ active families, the runtime for |\pgfkeysfiltered| is $O(N+K)$ (activate every family $O(K)$, check every option $O(N)$, deactivate every family $O(K)$).
+
+\begin{handler}{{.is family}}
+ Defines a new family. This option has already been described in section~\ref{section-is family-handler} on page~\pageref{section-is family-handler}.
+\end{handler}
+
+\begin{handler}{{.activate family}}
+ Activates a family. The family needs to be defined, otherwise |/errors/family unknown| will be raised.
+
+ Activation means a \TeX-boolean will be set to |true|, indicating that a family should be processed.
+
+ You can also use |\pgfkeysactivatefamily|\meta{full path} to get the same effect. Furthermore, you can use |\pgfkeysactivatefamilies|\meta{list of families}\meta{macro name for de-activation} to activate a list of families (see section~\ref{section-key-filter-api}).
+\end{handler}
+
+\begin{handler}{{.deactivate family}}
+ Deactivates a family. The family needs to be defined, otherwise |/errors/family unknown| will be raised.
+
+ You can also use |\pgfkeysdeactivatefamily|\meta{full path} to get the same effect.
+\end{handler}
+
+\begin{handler}{{.belongs to family}|=|\marg{family name}}
+ Associates the current option with \marg{family name}, which is expected to be a full path of a family.
+\begin{codeexample}[code only]
+\pgfkeys{/foo/bar/.is family}
+\pgfkeys{
+ /foo/a/.belongs to family=/foo/bar,
+ /foo/b/.belongs to family=/foo/bar
+}
+\end{codeexample}
+ Each option can have up to one family, |.belongs to family| overwrites any old setting.
+\end{handler}
+
+\begin{key}{/pgf/key filters/active families}
+ Install this key filter if |\pgfkeysfiltered| should only process activated families. If a key does not belong to any family, it is not processed. If a key is completely unknown within the default path, the normal `unknown' handlers of |\pgfkeys| are invoked.
+\end{key}
+
+\begin{key}{/pgf/key filters/active families or no family=\marg{key filter 1}\marg{key filter 2}}
+ This key filter configures |\pgfkeysfiltered| to work as follows.
+ \begin{enumerate}
+ \item If the current key belongs to a family, set |\ifpgfkeysfiltercontinue| to true if and only if its family is active.
+ \item If the current key does \emph{not} belong to a family, assign |\ifpgfkeysfiltercontinue| as result of \marg{key filter 1}.
+ \item If the current key is unknown within the default path, assign |\ifpgfkeysfiltercontinue| as result of \marg{key filter 2}.
+ \end{enumerate}
+ The arguments \marg{key filter 1} and \marg{key filter 2} are other key filters (possibly with options) and allow fine-grained control over the filtering process.
+ \begin{codeexample}[code only]
+ \pgfkeysinstallkeyfilter
+ {/pgf/key filters/active families or no family}
+ {{/pgf/key filters/is descendant of=/tikz}% for keys without family
+ {/pgf/key filters/false}% for unknown keys
+ }%
+ \end{codeexample}
+ This key filter will return true for any option with active family. If an option has no family, the return value is true if and only if it belongs to |/tikz|. If the option is unknown, the return value is |false| and unknown handlers won't be called.
+\end{key}
+
+\begin{key}{/pgf/key filters/active families or no family DEBUG=\marg{key filter 1}\marg{key filter 2}}
+ A variant of |active families or no family| which protocols each action on your terminal (log-file).
+\end{key}
+
+\begin{key}{/pgf/key filters/active families and known}
+ A fast alias for
+
+ |/pgf/key filters/active families or no family=|\par
+ \noindent\hskip10pt|{/pgf/keys filters/false}|\par
+ \noindent\hskip10pt|{/pgf/keys filters/false}|.
+\end{key}
+\begin{key}{/pgf/key filters/active families or descendants of=\marg{path prefix}}
+ A fast alias for
+
+ |/pgf/key filters/active families or no family=|\par
+ \noindent\hskip10pt|{/pgf/keys filters/is descendant of=|\marg{path prefix}|}|\par
+ \noindent\hskip10pt|{/pgf/keys filters/false}|.
+\end{key}
+
+\begin{command}{\pgfkeysactivatefamiliesandfilteroptions\marg{family list}\marg{key-value-list}}%
+ A simple shortcut macro which activates any family in the comma separated \marg{family list}, invokes |\pgfkeysfiltered|\meta{key-value-list} and deactivates the families afterwards.
+
+ Please note that you will need to install a family key filter, otherwise family activation has no effect.
+\end{command}
+\begin{command}{\pgfqkeysactivatefamiliesandfilteroptions\marg{family list}\marg{default path}\marg{key-value-list}}%
+ The `quick' default path variant of |\pgfkeysactivatefamiliesandfilteroptions|.
+\end{command}
+
+\begin{command}{\pgfkeysactivatesinglefamilyandfilteroptions\marg{family name}\marg{key-value-list}}%
+ A shortcut macro which activates a single family and invokes |\pgfkeysfiltered|.
+
+ Please note that you will need to install a family key filter, otherwise family activation has no effect.
+\end{command}
+\begin{command}{\pgfqkeysactivatesinglefamilyandfilteroptions\marg{family name}\marg{default path}\marg{key-value-list}}%
+ The `quick' default path variant of |\pgfkeysactivatesinglefamilyandfilteroptions|.
+\end{command}
+
+\subsubsection{Other Key Filters}
+There are some more key filters which have nothing to do with family handling.
+\begin{key}{/pgf/key filters/is descendant of=\marg{path}}
+ Install this key filter to process only options belonging to the key tree \marg{path}. It returns true for every key which has key path \marg{path}. It also returns true for any unknown key, that means unknown keys are processed using the standard unknown handlers of \pgfname.
+\begin{codeexample}[]
+\pgfkeys{
+/group 1/A/.code={(A:#1)},
+/group 1/foo/bar/B/.code={(B:#1)},
+/group 2/C/.code={(C:#1)},
+/pgf/key filters/is descendant of/.install key filter=/group 1}
+\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/key filters/equals=\marg{full key}}
+ Install this key filter to process only the fully qualified option \marg{full key}. The filter returns true for any unknown key or if the key equals \marg{full key}.
+\begin{codeexample}[]
+\pgfkeys{
+/group 1/A/.code={(A:#1)},
+/group 1/B/.code={(B:#1)},
+/pgf/key filters/equals/.install key filter=/group 1/A}
+\pgfqkeysfiltered{/group 1}{A=a,B=b}
+\end{codeexample}
+\end{key}
+
+\begin{key}{/pgf/key filters/not=\marg{key filter}}
+ This key filter logically inverts the result of \marg{key filter}.
+\begin{codeexample}[]
+\pgfkeys{
+/group 1/A/.code={(A:#1)},
+/group 1/foo/bar/B/.code={(B:#1)},
+/group 2/C/.code={(C:#1)},
+/pgf/key filters/not/.install key filter=
+ {/pgf/key filters/is descendant of=/group 1}}
+\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c}
+\end{codeexample}
+ Please note that unknown keys will be handed to the usual unknown handlers.
+\end{key}
+
+\begin{key}{/pgf/key filters/and=\marg{key filter 1}\marg{key filter 2}}
+ This key filter returns true if and only if both, \marg{key filter 1} and \marg{key filter 2} return true.
+
+\end{key}
+
+\begin{key}{/pgf/key filters/or=\marg{key filter 1}\marg{key filter 2}}
+ This key filter returns true if one of \marg{key filter 1} and \marg{key filter 2} returns true.
+
+\end{key}
+
+\begin{key}{/pgf/key filters/true}
+ This key filter returns always true.
+\end{key}
+
+\begin{key}{/pgf/key filters/false}
+ This key filter returns always false (including unknown keys).
+\end{key}
+
+\begin{key}{/pgf/key filters/defined}
+ This key filter returns false if the current key is unknown, which avoids calling the unknown handlers.
+\end{key}
+
+\subsubsection{Programmer Interface}
+\label{section-key-filter-api}%
+\begin{plainenvironment}{{pgfkeysinterruptkeyfilter}}%
+ Temporarily disables key filtering inside of the environment. If key filtering is not active, this has no effect at all.
+
+ Please note that no \TeX-group is introduced.
+\end{plainenvironment}
+
+\begin{command}{\pgfkeyssavekeyfilterstateto\marg{macro}}
+Creates \marg{macro} which contains commands to re-activate the current
+key filter and key filter handler. It can be used to temporarily
+switch the key filter.
+\end{command}
+
+\begin{command}{\pgfkeysinstallkeyfilter\marg{full key}\marg{optional arguments}}%
+ The command |\pgfkeysinstallkeyfilter{|\meta{full key}|}{|\meta{optional arguments}|}| has the same effect as |\pgfkeys{|\meta{full key}|/.install key filter={|\meta{optional arguments}|}}|.
+\end{command}
+
+\begin{command}{\pgfkeysinstallkeyfilterhandler\marg{full key}\marg{optional arguments}}%
+ The command |\pgfkeysinstallkeyfilterhandler{|\meta{full key}|}{|\meta{optional arguments}|}| has the same effect as |\pgfkeys{|\meta{full key}|/.install key filter handler={|\meta{optional arguments}|}}|.
+\end{command}
+
+
+\begin{command}{\pgfkeysactivatefamily\marg{family name}}%
+ Equivalent to |\pgfkeys{|\meta{family name}|/.activate family}|.
+\end{command}
+
+\begin{command}{\pgfkeysdeactivatefamily\marg{family name}}%
+ Equivalent to |\pgfkeys{|\meta{family name}|/.dactivate family}|.
+\end{command}
+
+\begin{command}{\pgfkeysactivatefamilies\marg{family list}\marg{deactivate macro name}}%
+ Activates each family in \meta{family list} and creates a macro \meta{deactivate macro name} which de-activates each family in \meta{family list}.
+\begin{codeexample}[code only]
+\pgfkeysactivatefamilies{/family 1,/family 2,/family 3}{\deactivatename}
+\pgfkeysfiltered{foo,bar}
+\deactivatename
+\end{codeexample}
+\end{command}
+
+
+\begin{command}{\pgfkeysiffamilydefined\marg{family}\marg{true case}\marg{false case}}%
+ Checks whether the full key \meta{family} is a family and executes either \meta{true case} or \meta{false case}.
+\end{command}
+
+\begin{command}{\pgfkeysisfamilyactive\marg{family}}%
+ Sets the \TeX-boolean |\ifpgfkeysfiltercontinue| to whether \meta{family} is active or not.
+\end{command}
+
+\begin{command}{\pgfkeysgetfamily\marg{key}\marg{resultmacro}}%
+ Returns the family associated to a full key \meta{key} into macro \meta{resultmacro}.
+\end{command}
+
+\begin{command}{\pgfkeyssetfamily\marg{key}\marg{family}}%
+ The command |\pgfkeyssetfamily|\marg{full key}\marg{family} has the same effect as |\pgfkeys{|\meta{full key}|/.belongs to family=|\marg{family}|}|.
+\end{command}
+
+\subsubsection{Defining Own Filters Or Filter Handlers}
+\label{section-key-writing-filters}
+ During |\pgfkeysfiltered|, the key filter code will be invoked. At this time, the full key path including key name is available as |\pgfkeyscurrentkey|, the key name before default paths have been considered as |\pgfkeyscurrentkeyRAW| and the values as |\pgfkeyscurrentvalue|.
+
+ Furthermore, the macro |\pgfkeyscasenumber| contains the current key's type as an integer:
+\begin{itemize}
+\item[\meta{1}] The key is a command key (i.e. |.../.@cmd| exists).
+\item[\meta{2}] The key contains its value directly.
+\item[\meta{3}] The key is handled (for example it is |.code| or |.cd|).
+
+In this case, the macros |\pgfkeyscurrentname| and |\pgfkeyscurrentpath| are set to the handlers name and path, respectively.
+Invoke |\pgfkeyssplitpath{}| to extract these values for non-handled keys.
+\item[\meta{0}] The key is unknown.
+\end{itemize}
+ Any key filter or key filter handler can access these variables. Key filters are expected to set the \TeX-boolean |\ifpgfkeysfiltercontinue| to whether the current key shall be processed or not.
+
+\begin{command}{\pgfkeysevalkeyfilterwith\marg{full key}=\marg{filter arguments}}
+ Evaluates a fully qualified key filter \meta{full key} with argument(s) \meta{filter arguments}.
+\begin{codeexample}[code only]
+\pgfkeysevalkeyfilterwith{/pgf/key filters/equals=/tikz}
+\end{codeexample}
+\end{command}
+\endgroup
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
index 9c10da526c8..3739db4d83b 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
@@ -39,7 +39,7 @@ command.
\end{command}
\begin{command}{\pgfsys@endpicture}
- Called at the end of a pgfpicture.
+ Called at the end of a pgfpicture.
Most drivers will need to implement this command.
\end{command}
@@ -51,7 +51,7 @@ command.
box that contains only the |\special|'s that make up the description
of the picture. The job of this command is to resize and shift
\meta{box} according to the baseline shift and the size of the
- box.
+ box.
This command has a default implementation and need not be
implemented by a driver file.
@@ -61,15 +61,15 @@ command.
This version of the |\pgfsys@beginpicture| picture command can be
used for pictures that are guaranteed not to contain any escaped
boxes (see below). In this case, a driver might provide a more
- compact version of the command.
-
+ compact version of the command.
+
This command has a default implementation and need not be
implemented by a driver file.
\end{command}
\begin{command}{\pgfsys@endpurepicture}
Called at the end of a ``pure'' |{pgfpicture}|.
-
+
This command has a default implementation and need not be
implemented by a driver file.
\end{command}
@@ -82,14 +82,14 @@ force. For this escaping, the following command is used:
\begin{command}{\pgfsys@hbox\marg{box number}}
Called to insert a (horizontal) TeX box inside a
|{pgfpicture}|.
-
+
Most drivers will need to (re-)implement this command.
\end{command}
\begin{command}{\pgfsys@hboxsynced\marg{box number}}
Called to insert a (horizontal) TeX box inside a
- |{pgfpicture}|, but with the current coordiante transformation
- matrix synced with the canvas transformation matrix.
+ |{pgfpicture}|, but with the current coordinate transformation
+ matrix synced with the canvas transformation matrix.
This command should do the same as if you used
|\pgflowlevelsynccm| followed by |\pgfsys@hbox|. However, the default
@@ -118,14 +118,14 @@ force. For this escaping, the following command is used:
|\pgf@sys@bp| helps with this conversion.
\example Draw a line from $(10\mathrm{pt},10\mathrm{pt})$ to the
- origin of the picture.
+ origin of the picture.
\begin{codeexample}[code only]
\pgfsys@moveto{10pt}{10pt}
\pgfsys@lineto{0pt}{0pt}
\pgfsys@stroke
\end{codeexample}
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -133,7 +133,7 @@ force. For this escaping, the following command is used:
Continue the current path to $(x,y)$ with
a straight line.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -148,7 +148,7 @@ force. For this escaping, the following command is used:
\pgfsys@stroke
\end{codeexample}
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -159,9 +159,9 @@ force. For this escaping, the following command is used:
This command can be ``mapped back'' to |\pgfsys@moveto| and
|\pgfsys@lineto| commands, but it is included since \pdf\ has a
- special, quick version of this command.
+ special, quick version of this command.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -189,13 +189,13 @@ force. For this escaping, the following command is used:
\pgfsys@lineto{0bp}{0bp}
\pgfsys@stroke
\end{codeexample}
-
+
The difference between the above will be that in the second triangle
the corner at the origin will be wrong; it will just be the overlay
of two lines going in different directions, not a sharp pointed
corner.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -207,11 +207,11 @@ force. For this escaping, the following command is used:
Perform a concatenation of the canvas transformation matrix with the
matrix given by the values \meta{a} to \meta{f}, see the \pdf\ or
PostScript manual for details. The values \meta{a} to \meta{d} are
- dimensionless factors, \meta{e} and \meta{f} are \TeX\ dimensions
+ dimensionless factors, \meta{e} and \meta{f} are \TeX\ dimensions
\example |\pgfsys@transformcm{1}{0}{0}{1}{1cm}{1cm}|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -221,7 +221,7 @@ force. For this escaping, the following command is used:
This command has a default implementation and need not be
implemented by a driver file.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@transformxyscale\marg{x scale}\marg{y scale}}
@@ -236,7 +236,7 @@ force. For this escaping, the following command is used:
This command has a default implementation and need not be
implemented by a driver file.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -257,7 +257,7 @@ force. For this escaping, the following command is used:
\item[Stroke color]
This special color is used for stroking. If it is not set, the
current color is used.
-
+
\item[Cap]
The cap describes how the endings of lines are drawn. A round cap
adds a little half circle to these endings. A butt cap ends the
@@ -266,7 +266,7 @@ force. For this escaping, the following command is used:
lines protrude over the endpoint by the line thickness. (See also
the \pdf\ manual.) If the path has been closed, no cap
is drawn.
-
+
\item[Join]
This describes how a bend (a join) in a path is rendered. A round
join draws bends using small arcs. A bevel join just draws the two
@@ -274,21 +274,21 @@ force. For this escaping, the following command is used:
convex. A miter join extends the lines so that they form a single
sharp corner, but only up to a certain miter limit. (See the \pdf\
manual once more.)
-
+
\item[Dash]
The line may be dashed according to a dashing pattern.
-
+
\item[Clipping area]
If a clipping area is established, only those parts of the path
that are inside the clipping area will be drawn.
\end{description}
-
+
In addition to stroking a path, the path may also be used for
clipping after it has been stroked. This will happen if the
|\pgfsys@clipnext| is used prior to this command, see there for
details.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -299,7 +299,7 @@ force. For this escaping, the following command is used:
This command has a default implementation and need not be
implemented by a driver file.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -311,19 +311,19 @@ force. For this escaping, the following command is used:
used to determine whether a point is inside or outside the
path, except if |\ifpgfsys@eorule| holds -- in which case the
even-odd rule should be used. (See the \pdf\ or PostScript manual
- for details.)
-
+ for details.)
+
The following graphic state parameters influence the filling:
-
+
\begin{description}
\item[Interior rule]
If |\ifpgfsys@eorule| is set, the even-odd rule is used, otherwise
the non-zero winding number rule.
-
+
\item[Fill color]
If the fill color is not especially set, the current color is
- used.
-
+ used.
+
\item[Clipping area]
If a clipping area is established, only those parts of the filling
area that are inside the clipping area will be drawn.
@@ -332,7 +332,7 @@ force. For this escaping, the following command is used:
In addition to filling the path, the path will also be used for
clipping if |\pgfsys@clipnext| is used prior to this command.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@fillstroke}
@@ -345,17 +345,17 @@ force. For this escaping, the following command is used:
In addition to stroking and filling the path, the path will also be
used for clipping if |\pgfsys@clipnext| is used prior to this command.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@discardpath}
Normally, this command should ``throw away'' the current path.
However, after |\pgfsys@clipnext| has been called, the current path
- should subsequently be used for clipping. See |\pgfsys@clipnext| for
- details.
+ should subsequently be used for clipping. See |\pgfsys@clipnext| for
+ details.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -381,50 +381,50 @@ force. For this escaping, the following command is used:
Sets the width of lines, when stroked, to \meta{width}, which must
be a \TeX\ dimension.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@buttcap}
Sets the cap to a butt cap. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@roundcap}
Sets the cap to a round cap. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@rectcap}
Sets the cap to a rectangular cap. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@miterjoin}
Sets the join to a miter join. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@setmiterlimit\marg{factor}}
Sets the miter limit of lines to \meta{factor}. See
the \pdf\ or PostScript for details on what the miter limit is.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@roundjoin}
Sets the join to a round join. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@beveljoin}
Sets the join to a bevel join. See |\pgfsys@stroke|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@setdash\marg{pattern}\marg{phase}}
@@ -433,7 +433,7 @@ force. For this escaping, the following command is used:
single dimension.
\example |\pgfsys@setdash{3pt,3pt}{0pt}|
-
+
The list of values in \meta{pattern} is used to determine the
lengths of the ``on'' phases of the dashing and of the ``off''
phases. For example, if \meta{pattern} is |3bp,4bp|, then the dashing
@@ -441,15 +441,15 @@ force. For this escaping, the following command is used:
followed by 4bp off, and so on.'' A pattern of |.5pt,4pt,3pt,1.5pt| means
``.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on, \dots'' If the
number of entries is odd, the last one is used twice, so |3pt| means
- ``3pt on, 3pt off, 3pt on, 3pt off, \dots'' An empty list
+ ``3pt on, 3pt off, 3pt on, 3pt off, \dots'' An empty list
means ``always on.''
-
+
The second argument determines the ``phase'' of the pattern. For
example, for a pattern of |3bp,4bp| and a phase of |1bp|, the pattern
would start: ``2bp on, 4bp off, 3bp on, 4bp off, 3bp on, 4bp off,
\dots''
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
{\let\ifpgfsys@eorule=\relax
@@ -468,34 +468,34 @@ and |xcolor| package, which perform similar functions. However, the
|color| package does not support having two different colors for
stroking and filling, which is a useful feature that is supported by
\pgfname. For this reason, the \pgfname\ system layer offers commands for
-setting these colors separatedly. Also, plain \TeX\ profits from the
+setting these colors separately. Also, plain \TeX\ profits from the
fact that \pgfname\ can set colors.
-For \pdf, implementing these color commands is easy since \pdf\
+For \pdf, implementing these color commands is easy since \pdf\
supports different stroking and filling colors directly. For
PostScript, a more complicated approach is needed in which the colors
need to be stored in special PostScript variables that are set
whenever a stroking or a filling operation is done.
\begin{command}{\pgfsys@color@rgb\marg{red}\marg{green}\marg{blue}}
- Sets the color used for stroking and filling operations to the given
+ Sets the color used for stroking and filling operations to the given
red/green/blue tuple (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@rgb@stroke\marg{red}\marg{green}\marg{blue}}
Sets the color used for stroking operations to the given
- red/green/blue tuple (numbers between 0 and 1).
+ red/green/blue tuple (numbers between 0 and 1).
\example Make stroked text dark red: |\pgfsys@color@rgb@stroke{0.5}{0}{0}|
The special stroking color is only used if the stroking color has
been set since the last |\color| or |\pgfsys@color@xxx|
command. Thus, each |\color| command will reset both the stroking
- and filling colors by calling |\pgfsys@color@reset|.
+ and filling colors by calling |\pgfsys@color@reset|.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@rgb@fill\marg{red}\marg{green}\marg{blue}}
@@ -503,70 +503,70 @@ whenever a stroking or a filling operation is done.
red/green/blue tuple (numbers between 0 and 1). This color may be
different from the stroking color.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmyk\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}}
Sets the color used for stroking and filling operations to the given
- cymk tuple (numbers between 0 and 1).
+ cymk tuple (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmyk@stroke\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}}
Sets the color used for stroking operations to the given cymk tuple
- (numbers between 0 and 1).
+ (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmyk@fill\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}}
Sets the color used for filling operations to the given cymk tuple
- (numbers between 0 and 1).
+ (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmy\marg{cyan}\marg{magenta}\marg{yellow}}
Sets the color used for stroking and filling operations to the given
- cym tuple (numbers between 0 and 1).
+ cymk tuple (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmy@stroke\marg{cyan}\marg{magenta}\marg{yellow}}
- Sets the color used for stroking operations to the given cym tuple
- (numbers between 0 and 1).
+ Sets the color used for stroking operations to the given cymk tuple
+ (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@cmy@fill\marg{cyan}\marg{magenta}\marg{yellow}}
- Sets the color used for filling operations to the given cym tuple
- (numbers between 0 and 1).
+ Sets the color used for filling operations to the given cymk tuple
+ (numbers between 0 and 1).
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@gray\marg{black}}
Sets the color used for stroking and filling operations to the given
black value, where 0 means black and 1 means white.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@gray@stroke\marg{black}}
Sets the color used for stroking operations to the given black value,
where 0 means black and 1 means white.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@gray@fill\marg{black}}
Sets the color used for filling operations to the given black value,
where 0 means black and 1 means white.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@reset}
@@ -587,7 +587,7 @@ whenever a stroking or a filling operation is done.
or stroke color might be in force. However, when the box is later on
inserted at some point, a special fill color might already have been
set. In this case, this command is not guaranteed to reset the color
- correctly.
+ correctly.
\end{command}
\begin{command}{\pgfsys@color@reset@inordertrue}
@@ -596,7 +596,7 @@ whenever a stroking or a filling operation is done.
\end{command}
\begin{command}{\pgfsys@color@reset@inorderfalse}
- Switches off the optimized color resetting.
+ Switches off the optimized color resetting.
\end{command}
\begin{command}{\pgfsys@color@unstacked\marg{\LaTeX\ color}}
@@ -648,7 +648,7 @@ whenever a stroking or a filling operation is done.
\end{command}
\begin{command}{\pgfsys@setpatterncolored\marg{name}}
- Sets the fill color to the pattern named \meta{name}. This pattern
+ Sets the fill color to the pattern named \meta{name}. This pattern
must have been declared with the |1| flag.
\end{command}
@@ -662,22 +662,22 @@ local.
\begin{command}{\pgfsys@beginscope}
Saves the current graphic state on a graphic state stack. All
changes to the graphic state parameters mentioned for |\pgfsys@stroke|
- and |\pgfsys@fill| will be local to the current graphic state and
+ and |\pgfsys@fill| will be local to the current graphic state and
the old values will be restored after |\pgfsys@endscope| is used.
-
+
\emph{Warning:} \pdf\ and PostScript differ with respect to the
question of whether the current path is part of the graphic state or
not. For this reason, you should never use this command unless the
- path is currently empty. For example, it might be a good idea to use
- |\pgfsys@discardpath| prior to calling this command.
+ path is currently empty. For example, it might be a good idea to use
+ |\pgfsys@discardpath| prior to calling this command.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@endscope}
Restores the last saved graphic state.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -699,12 +699,12 @@ The system layer provides some commands for image inclusion.
\begin{command}{\pgfsys@defineimage}
- Called, when an image should be defined.
-
+ Called, when an image should be defined.
+
This command does not take any parameters. Instead, certain macros
will be preinstalled with appropriate values when this command is
invoked. These are:
-
+
\begin{itemize}
\item\declare{|\pgf@filename|}
File name of the image to be defined.
@@ -714,19 +714,19 @@ The system layer provides some commands for image inclusion.
\item\declare{|\pgf@imageheight|}
Will be set to the desired (scaled) height of the image.
-
+
If this macro and also the height macro are empty, the image
should have its ``natural'' size.
-
+
If exactly only of them is specified, the undefined value the
image is scaled so that the aspect ratio is kept.
-
+
If both are set, the image is scaled in both directions
independently, possibly changing the aspect ratio.
\end{itemize}
-
+
The following macros presumable mostly make sense for drivers that
- can handle \pdf:
+ can handle \pdf:
\begin{itemize}
\item \declare{|\pgf@imagepage|}
@@ -734,15 +734,15 @@ The system layer provides some commands for image inclusion.
``image.''
\item\declare{|\pgf@imagemask|}
- If set, it will be set to |/SMask x 0 R| where |x| is the \pdf\
+ If set, it will be set to |/SMask x 0 R| where |x| is the \pdf\
object number of a soft mask to be applied to the image.
\item\declare{|\pgf@imageinterpolate|}
If set, it will be set to |/Interpolate true| or
|/Interpolate false|, indicating whether the image should be
- interpolated in \pdf.
+ interpolated in \pdf.
\end{itemize}
-
+
The command should now setup the macro |\pgf@image| such that calling
this macro will result in typesetting the image. Thus, |\pgf@image| is
the ``return value'' of the command.
@@ -761,18 +761,18 @@ The system layer provides some commands for image inclusion.
command should be the definition of a macro called |\@pgfshading|\meta{name}|!|
(or |\csname @pdfshading|\meta{name}|!\endcsname|, to be
precise). When invoked, this new macro should insert a shading at
- the current position.
-
+ the current position.
+
\meta{name} is the name of the shading, which is also used in the
output macro name. \meta{height} is the height of the shading and
must be given as a TeX dimension like |2cm| or
- |10pt|. \meta{specification} is a shading color
+ |10pt|. \meta{specification} is a shading color
specification as specified in Section~\ref{section-shadings}. The
- shading specification implicitly fixes the width of the shading.
-
+ shading specification implicitly fixes the width of the shading.
+
When |\@pgfshading|\meta{name}|!| is invoked, it should insert a box
of height \meta{height} and the width implicit in the shading
- declaration.
+ declaration.
\end{command}
@@ -793,7 +793,7 @@ The system layer provides some commands for image inclusion.
\end{command}
-\begin{command}{\pgfsys@radialshading\marg{name}\marg{lower left
+\begin{command}{\pgfsys@functionalshading\marg{name}\marg{lower left
corner}\meta{upper right corner}\marg{type 4 function}}
Declares a shading using a PostScript-like function that provides a
color for each point. Like the previous macros, this command
@@ -816,7 +816,7 @@ The system layer provides some commands for image inclusion.
green, and blue components of the color.
A buggy function will result is \emph{totally unpredictable chaos} during
- rendering.
+ rendering.
\end{command}
@@ -835,7 +835,7 @@ The system layer provides some commands for image inclusion.
This takes a TeX box and converts it into a transparency
group. This means that any transparency settings apply to the box as
a whole. For instance, if a box contains two overlapping black
- circles and you draw the box and, thus, the two cirlces normally
+ circles and you draw the box and, thus, the two circles normally
with 50\% transparency, then the overlap will be darker than the
rest. By comparison, if the circles are part of a transparency
group, the overlap will get the same color as the rest.
@@ -854,7 +854,7 @@ The system layer provides some commands for image inclusion.
fading. The fading should be centered on the origin and have its
original size, except that the parameters \meta{a} to \meta{f}
specify a transformation matrix that should be applied additionally
- to the fading before it is installed. The transformtion should not
+ to the fading before it is installed. The transformation should not
apply to the following graphics, however.
\end{command}
@@ -866,8 +866,8 @@ The system layer provides some commands for image inclusion.
the command is called. The result should be to set the macro
|\pgf@mask| to a pdf object count that can subsequently be used as a
transparency mask. The following macros will be set when this command is
- invoked:
-
+ invoked:
+
\begin{itemize}
\item \declare{|\pgf@filename|}
File name of the mask to be defined.
@@ -887,7 +887,7 @@ The system layer provides some commands for image inclusion.
\subsection{Reusable Objects System Commands}
\begin{command}{\pgfsys@invoke\marg{literals}}
- This command gets protocoled literals and should insert them into
+ This command gets protocolled literals and should insert them into
the |.pdf| or |.dvi| file using an appropriate |\special|.
\end{command}
@@ -897,7 +897,7 @@ The system layer provides some commands for image inclusion.
precached in some way and then be rendered more quickly when used
several times. For example, an arrow head might be defined and
prerendered in this way.
-
+
The parameter \meta{name} is the name for later use. \meta{lower
left} and \meta{upper right} are \pgfname\ points specifying a bounding
box for the object. \meta{code} is the code for the object. The code
@@ -909,7 +909,7 @@ The system layer provides some commands for image inclusion.
\begin{command}{\pgfsys@useobject\marg{name}\marg{extra code}}
Renders a previously declared object. The first parameter is the
- name of the the object. The second parameter is extra code that
+ name of the object. The second parameter is extra code that
should be executed right \emph{before} the object is
rendered. Typically, this will be some transformation code.
@@ -931,14 +931,14 @@ commands do not open a graphics scope and can be opened and closed
output should be suppressed. Nothing should be drawn at all, which
includes all paths, images and shadings. However, no groups (neither
\TeX\ groups nor graphic state groups) should be opened by this
- command.
+ command.
This command has a default implementation and need not be
implemented by a driver file.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
+
\begin{command}{\pgfsys@endinvisible}
Ends the invisibility section, unless invisibility blocks have been
nested. In this case, only the ``last'' one restores visibility.
@@ -946,7 +946,7 @@ commands do not open a graphics scope and can be opened and closed
This command has a default implementation and need not be
implemented by a driver file.
- This command is protocoled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
@@ -1045,9 +1045,9 @@ command may be useful:
\end{command}
Note that this command is \emph{not} a system command that can/needs
-to be overwritten by a driver.
+to be overwritten by a driver.
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex
index b02713dc849..e46a31e0247 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex
@@ -22,14 +22,14 @@ single sweep.''
When protocolling is ``switched on,'' there is a ``current protocol''
to which literal text gets appended. Once all commands that needed to
-be protocoled have been issued, the protocol can be obtained and
+be protocolled have been issued, the protocol can be obtained and
stored using |\pgfsysprotocol@getcurrentprotocol|. At any point, the
current protocol can be changed using a corresponding setting
command. Finally, |\pgfsysprotocol@invokecurrentprotocol| is used to
-insert the protocoled commands into the |.pdf| or |.dvi| file.
+insert the protocolled commands into the |.pdf| or |.dvi| file.
Only those |\pgfsys@| commands can be protocolled that use the
-command |\pgfsysprotocol@literal| interally. For example, the
+command |\pgfsysprotocol@literal| internally. For example, the
definition of |\pgfsys@moveto| in |pgfsys-common-pdf.def| is
\begin{codeexample}[code only]
\def\pgfsys@moveto#1#2{\pgfsysprotocol@literal{#1 #2 m}}
@@ -52,7 +52,7 @@ require special |\special|'s and cannot be protocolled.
\begin{command}{\pgfsysprotocol@bufferedtrue}
Turns on protocolling. All subsequent calls of
|\pgfsysprotocol@literal| will append their argument to the current
- protocol.
+ protocol.
\end{command}
\begin{command}{\pgfsysprotocol@bufferedfalse}
@@ -84,7 +84,7 @@ require special |\special|'s and cannot be protocolled.
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
index 50aa70a3af2..c80846dcd85 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
@@ -45,7 +45,7 @@ expands to the first line of the above example.
Similarly, |\fill| is an abbreviation for |\path[fill]| and
|\filldraw| is an abbreviation for the command
|\path[fill,draw]|. Since options accumulate, the following commands
-all have the same effect:
+all have the same effect:
\begin{codeexample}[code only]
\path [draw,fill] (0,0) circle (1cm);
\path [draw] [fill] (0,0) circle (1cm);
@@ -106,7 +106,7 @@ The most unspecific option for setting colors is the following:
The \meta{color name} is the name of a previously defined color. For
\LaTeX\ users, this is just a normal ``\LaTeX-color'' and the
- |xcolor| extensions are allows. Here is an example:
+ |xcolor| extensions are allowed. Here is an example:
\begin{codeexample}[]
\tikz \fill[color=red!20] (0,0) circle (1ex);
@@ -128,7 +128,7 @@ The most unspecific option for setting colors is the following:
to do the following:
\begin{itemize}
\item Specify a new color using |\definecolor|. Only the two color
- models |gray| and |rgb| are supported.
+ models |gray| and |rgb| are supported\footnote{Con\TeX t users should be aware that \texttt{\textbackslash definecolor} has a different meaning in Con\TeX t. There is a low-level equivalent named \texttt{\textbackslash pgfutil@definecolor} which can be used instead.}.%
\example |\definecolor{orange}{rgb}{1,0.5,0}|
\item Use |\colorlet| to define a new color based on an old
one. Here, the |!| mechanism is supported, though only ``once''
@@ -169,7 +169,7 @@ You can draw a path using the following option:
If the special color name |none| is given, this option causes
drawing to be ``switched off.'' This is useful if a style has
previously switched on drawing and you locally wish to undo this
- effect.
+ effect.
Although this option is normally used on paths to indicate that the
path should be drawn, it also makes sense to use the option with a
@@ -203,7 +203,7 @@ how a path is drawn. All of these options only have an effect if the
There are a number of predefined styles that provide more ``natural''
ways of setting the line width. You can also redefine these
-styles.
+styles.
\begin{stylekey}{/tikz/ultra thin}
Sets the line width to 0.1pt.
@@ -279,8 +279,8 @@ styles.
\begin{codeexample}[]
\begin{tikzpicture}[line width=10pt]
\draw[line join=round] (0,0) -- ++(.5,1) -- ++(.5,-1);
- \draw[line join=bevel] (1.25,0) -- ++(.5,1) -- ++(.5,-1);
- \draw[line join=miter] (2.5,0) -- ++(.5,1) -- ++(.5,-1);
+ \draw[line join=bevel] (1.25,0) -- ++(.5,1) -- ++(.5,-1);
+ \draw[line join=miter] (2.5,0) -- ++(.5,1) -- ++(.5,-1);
\useasboundingbox (0,1.5); % make bounding box bigger
\end{tikzpicture}
\end{codeexample}
@@ -288,9 +288,9 @@ styles.
\begin{key}{/tikz/miter limit=\meta{factor} (initially 10)}
When you use the miter join and there is a very sharp corner (a
small angle), the miter join may protrude very far over the actual
- joining point. In this case, if it were to protrude by
+ joining point. In this case, if it were to protrude by
more than \meta{factor} times the line width, the miter join is
- replaced by a bevel join.
+ replaced by a bevel join.
\begin{codeexample}[]
\begin{tikzpicture}[line width=5pt]
@@ -309,7 +309,7 @@ styles.
\textsc{metafont}. For example following pattern
|on 2pt off 3pt on 4pt off 4pt| means ``draw
2pt, then leave out 3pt, then draw 4pt once more, then leave out 4pt
- again, repeat''.
+ again, repeat''.
\begin{codeexample}[]
\begin{tikzpicture}[dash pattern=on 2pt off 3pt on 4pt off 4pt]
@@ -389,6 +389,56 @@ dashing conveniently.
\end{stylekey}
+\begin{stylekey}{/tikz/dashdotted}
+ Shorthand for setting a dashed and dotted dash pattern.
+
+\begin{codeexample}[]
+\tikz \draw[dashdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/densely dashdotted}
+ Shorthand for setting a densely dashed and dotted dash pattern.
+
+\begin{codeexample}[]
+\tikz \draw[densely dashdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/loosely dashdotted}
+ Shorthand for setting a loosely dashed and dotted dash pattern.
+
+\begin{codeexample}[]
+\tikz \draw[loosely dashdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+
+\begin{stylekey}{/tikz/dashdotdotted}
+ Shorthand for setting a dashed and dotted dash pattern with more dots.
+
+\begin{codeexample}[]
+\tikz \draw[dashdotdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/densely dashdotdotted}
+ Shorthand for setting a densely dashed and dotted dash pattern with more dots.
+
+\begin{codeexample}[]
+\tikz \draw[densely dashdotdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/loosely dashdotdotted}
+ Shorthand for setting a loosely dashed and dotted dash pattern with more dots.
+
+\begin{codeexample}[]
+\tikz \draw[loosely dashdotdotted] (0pt,0pt) -- (50pt,0pt);
+\end{codeexample}
+\end{stylekey}
+
+
\subsubsection{Graphic Parameters: Draw Opacity}
When a line is drawn, it will normally ``obscure'' everything behind
@@ -426,14 +476,14 @@ and may change in the future.
The permissible values are all predefined arrow tips, though
you can also define new arrow tip kinds as explained in
Section~\ref{section-arrows}. This is often necessary to obtain
- ``double'' arrow tips and arrow tips that have a fixed size. Since
- |pgflibraryarrows| is loaded by default, all arrow tips described in
- Section~\ref{section-library-arrows} are available.
+ ``double'' arrow tips and arrow tips that have a fixed size. You
+ need to load the |arrows| library if you need arrow tips other than
+ the default ones, see Section~\ref{section-library-arrows}.
One arrow tip kind is special: |>| (and all arrow tip kinds containing the
- arrow tip kind such as |<<| or \verb!>|!). This arrow tip type is not
+ arrow tip kind such as |<<| or \verb!>|!). This arrow tip type is not
fixed. Rather, you can redefine it using the |>=| option, see
- below.
+ below.
\example You can also combine arrow tip types as in
\begin{codeexample}[]
@@ -469,16 +519,16 @@ and may change in the future.
\begin{tikzpicture}[scale=2]
\begin{scope}[>=latex]
\draw[->] (0pt,6ex) -- (1cm,6ex);
- \draw[>->>] (0pt,5ex) -- (1cm,5ex);
+ \draw[>->>] (0pt,5ex) -- (1cm,5ex);
\draw[|<->|] (0pt,4ex) -- (1cm,4ex);
\end{scope}
\begin{scope}[>=diamond]
\draw[->] (0pt,2ex) -- (1cm,2ex);
\draw[>->>] (0pt,1ex) -- (1cm,1ex);
\draw[|<->|] (0pt,0ex) -- (1cm,0ex);
- \end{scope}
+ \end{scope}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
% <<
\end{key}
@@ -545,7 +595,7 @@ and may change in the future.
\begin{key}{/tikz/double distance=\meta{dimension} (initially 0.6pt)}
Sets the distance the ``two'' lines are spaced apart. In reality,
- this is the thickness of the line that is used
+ this is the thickness of the line that is used
to draw the path for the second time. The thickness of the
\emph{first} time the path is drawn is twice the normal line width
plus the given \meta{dimension}. As a side-effect, this option
@@ -560,8 +610,48 @@ and may change in the future.
\end{codeexample}
\end{key}
+\begin{key}{/tikz/double distance between line centers=\meta{dimension}}
+ This option works like |double distance|, only the distance is not
+ the distance between (inner) borders of the two main lines, ut
+ between their centers. Thus, the thickness the
+ \emph{first} time the path is drawn is the normal line width
+ plus the given \meta{dimension}, while the line width of the
+ \emph{second} line that is drawn is \meta{dimension} minus the
+ normal line width. As a side-effect, this option ``selects'' the
+ |double| option.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[double distance between line centers=3pt]
+ \foreach \lw in {0.5,1,1.5,2,2.5}
+ \draw[line width=\lw pt,double] (\lw,0) -- ++(4mm,0);
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}[double distance=3pt]
+ \foreach \lw in {0.5,1,1.5,2,2.5}
+ \draw[line width=\lw pt,double] (\lw,0) -- ++(4mm,0);
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+
+\begin{stylekey}{/tikz/double equal sign distance}
+ This style selects a double line distance such that it corresponds
+ to the distance of the two lines in an equal sign.
+\begin{codeexample}[]
+\Huge $=\implies$\tikz[baseline,double equal sign distance]
+ \draw[double,thick,-implies](0,0.55ex) --++(3ex,0);
+\end{codeexample}
+\begin{codeexample}[]
+\normalsize $=\implies$\tikz[baseline,double equal sign distance]
+ \draw[double,-implies](0,0.6ex) --++(3ex,0);
+\end{codeexample}
+\begin{codeexample}[]
+\tiny $=\implies$\tikz[baseline,double equal sign distance]
+ \draw[double,very thin,-implies](0,0.5ex) -- ++(3ex,0);
+\end{codeexample}
+\end{stylekey}
+
-
@@ -597,7 +687,7 @@ To fill a path, use the following option:
is used), the path is filled \emph{first}, then the path is drawn
\emph{second}. This is especially useful if different colors are
selected for drawing and for filling. Even if the same color is
- used, there is a difference between this command and a plain
+ used, there is a difference between this command and a plain
|fill|: A ``filldrawn'' area will be slightly larger than a filled
area because of the thickness of the ``pen.''
@@ -622,12 +712,12 @@ that contains a simple picture like a star. Then these tiles are
(conceptually) repeated infinitely in all directions, but clipped
against the path.
-Tiling patterns come in two variants: \emph{inherently
+Tiling patterns come in two variants: \emph{inherently
colored patterns} and \emph{form-only patterns}. An inherently colored
pattern is, say, a red star with a black border and will always look
like this. A form-only pattern may have a different color each time
it is used, only the form of the pattern will stay the same. As such,
-form-only patterhns do not have any colors of their own, but when it
+form-only patterns do not have any colors of their own, but when it
is used the current \emph{pattern color} is used as its color.
Patterns are not overly flexible. In particular, it is not possible to
@@ -646,10 +736,10 @@ pattern. For complicated case, it may be easier to use two nested
fill color will fill the path with a solid color once more.
Strangely, no \meta{name}s are permissible by default. You need to
- load for instance |pgflibrarypatterns|, see
+ load for instance the |patterns| library, see
Section~\ref{section-library-patterns}, to install predefined
- patterns.
-
+ patterns.
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[pattern=dots] (0,0) circle (1cm);
@@ -660,8 +750,8 @@ pattern. For complicated case, it may be easier to use two nested
\begin{key}{/tikz/pattern color=\meta{color}}
This option is used to set the color to be used for form-only
- patterns. This option has no effect on inherently colored patterns.
-
+ patterns. This option has no effect on inherently colored patterns.
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[pattern color=red,pattern=fivepointed stars] (0,0) circle (1cm);
@@ -718,7 +808,7 @@ should be determined:
\draw[->] (0,1) -- (.4,1);
\draw[->] (0.25,0.75) -- (0.4,.75);
-
+
\draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $1+1 = 2$};
\end{scope}
\end{tikzpicture}
@@ -736,7 +826,7 @@ should be determined:
and declare the point to be ``inside'' if the number of hits is odd.
Using the even-odd rule, it is easy to ``drill holes'' into a path.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\filldraw[fill=examplefill,even odd rule]
@@ -753,7 +843,94 @@ should be determined:
\label{section-fill-opacity}
Analogously to the |draw opacity|, you can also set the filling
opacity. Please see Section~\ref{section-tikz-transparency} for more
-details.
+details.
+
+
+\subsection{Generalized Filling: Using Arbitrary Pictures to Fill a Path}
+
+Sometimes you wish to ``fill'' a path with something even more
+complicated than a pattern, let alone a single color. For instance,
+you might wish to use an image to fill the path or some other,
+complicated drawing. In principle, this effect can be achieved
+by first using the path for clipping and then, subsequently, drawing
+the desired image or picture. However, there is an option that makes
+this process much easier:
+
+\begin{key}{/tikz/path picture=\meta{code}}
+ When this option is given on a path and when the \meta{code} is not
+ empty, the following happens: After all other ``filling'' operations
+ are done with the path, which are caused by the options |fill|,
+ |pattern| and |shade|, a local scope is opened and the path is
+ temporarily installed as a clipping path. Then, the \meta{code} is
+ executed, which can now draw something. Then, the local scope ends
+ and, possibly, the path is stroked, provided the |draw| option has
+ been given.
+
+ As with other keys like |fill| or |draw| this option needs to be
+ given on a path, setting the |path picture| outside a path has not
+ effect (the path picture is cleared at the beginning of each path).
+
+ The \meta{code} can be any normal \tikzname\ code like |\draw ...|
+ or |\node ...|. As always, when you include an external graphic you
+ need to put it inside a |\node|.
+
+ Note that no special actions are taken to transform the origin in
+ any way. This means that the coordinate |(0,0)| is still where is
+ was when the path was being constructed and not -- as one might
+ expect -- at the lower left corner of the path. However, you can use
+ the following special node to access the size of the path:
+ \begin{predefinednode}{path picture bounding box}
+ This node is of shape |rectangle|. Its size and position are those
+ of |current path bounding box| just before the \meta{code}
+ of the path picture started to be executed. The \meta{code} can
+ construct its own paths, so accessing the
+ |current path bounding box| inside the \meta{code} yields the
+ bounding box of any path that is currently being constructed
+ inside the \meta{code}.
+ \end{predefinednode}
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [help lines] (0,0) grid (3,2);
+ \filldraw [fill=blue!10,draw=blue,thick] (1.5,1) circle (1)
+ [path picture={
+ \node at (path picture bounding box.center) {
+ This is a long text.
+ };}
+ ];
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[cross/.style={path picture={
+ \draw[black]
+ (path picture bounding box.south east) --
+ (path picture bounding box.north west)
+ (path picture bounding box.south west) --
+ (path picture bounding box.north east);
+ }}]
+ \draw [help lines] (0,0) grid (3,2);
+ \filldraw [cross,fill=blue!10,draw=blue,thick] (1,1) circle (1);
+ \path [cross,top color=red,draw=red,thick] (2,0) -- (3,2) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+
+\begin{codeexample}[]
+ \begin{tikzpicture}[path image/.style={
+ path picture={
+ \node at (path picture bounding box.center) {
+ \includegraphics[height=3cm]{#1}
+ };}}]
+ \draw [help lines] (0,0) grid (3,2);
+
+ \draw [path image=brave-gnu-world-logo,draw=blue,thick]
+ (0,1) circle (1);
+ \draw [path image=brave-gnu-world-logo,draw=red,very thick,->]
+ (1,0) parabola[parabola height=2cm] (3,0);
+
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
\subsection{Shading a Path}
@@ -791,9 +968,6 @@ path is temporarily used for clipping and then the rectangular shading
is drawn, scaled and shifted such that all parts of the path are
filled.
-
-\subsubsection{Choosing a Shading Type}
-
The default shading is a smooth transition from gray
to white and from above to bottom. However, other shadings are also
possible, for example a shading that will sweep a color from the
@@ -805,44 +979,27 @@ needed, which are explained below.
\begin{key}{/tikz/shading=\meta{name}}
This selects a shading named \meta{name}. The following shadings are
- predefined:
- \begin{itemize}
- \item \declare{|axis|}
- This is the default shading in which the color changes gradually
- between three horizontal lines. The top line is at the top
- (uppermost) point of the path, the middle is in the middle, the
- bottom line is at the bottom of the path.
-
+ predefined: |axis|, |radial|, and |ball|.
\begin{codeexample}[]
\tikz \shadedraw [shading=axis] (0,0) rectangle (1,1);
-\end{codeexample}
-
- The default top color is gray, the default bottom color is white,
- the default middle is the ``middle'' of these two.
- \item \declare{|radial|}
- This shading fills the path with a gradual sweep from a certain
- color in the middle to another color at the border. If the path is
- a circle, the outer color will be reached exactly at the
- border. If the shading is not a circle, the outer color will
- continue a bit towards the corners. The default inner color is
- gray, the default outer color is white.
-
-\begin{codeexample}[]
\tikz \shadedraw [shading=radial] (0,0) rectangle (1,1);
+\tikz \shadedraw [shading=ball] (0,0) circle (.5cm);
\end{codeexample}
- \item \declare{|ball|}
- This shading fills the path with a shading that ``looks like a
- ball.'' The default ``color'' of the ball is blue (for no
- particular reason).
-\begin{codeexample}[]
-\tikz \shadedraw [shading=ball] (0,0) rectangle (1,1);
-\end{codeexample}
+ The shadings as well as additional shadings are described in more
+ detail in Section~\ref{section-library-shadings}.
+ To change the color of a shading, special options are needed like
+ |left color|, which sets the color of an axis shading from left to
+ right. These options implicitly also select the right shading type,
+ see the following example
\begin{codeexample}[]
-\tikz \shadedraw [shading=ball] (0,0) circle (.5cm);
+\tikz \shadedraw [left color=red,right color=blue]
+ (0,0) rectangle (1,1);
\end{codeexample}
- \end{itemize}
+
+ For a complete list of the possible options see
+ Section~\ref{section-library-shadings} once more.
\begin{key}{/tikz/shading angle=\meta{degrees} (initially 0)}
This option rotates the shading (not the path!) by the given
@@ -862,101 +1019,6 @@ filling paths are given in Section~\ref{section-shading-a-path}.
-\subsubsection{Choosing a Shading Color}
-
-The following options can be used to change the colors used for
-shadings. When one of these options is given, the |shade| option is
-automatically selected and also the ``right'' shading.
-
-\begin{key}{/tikz/top color=\meta{color}}
- This option prescribes the color to be used at the top in an |axis|
- shading. When this option is given, several things happen:
- \begin{enumerate}
- \item
- The |shade| option is selected.
- \item
- The |shading=axis| option is selected.
- \item
- The middle color of the axis shading is set to the average of the
- given top color \meta{color} and of whatever color is currently
- selected for the bottom.
- \item
- The rotation angle of the shading is set to 0.
- \end{enumerate}
-
-\begin{codeexample}[]
-\tikz \draw[top color=red] (0,0) rectangle (2,1);
-\end{codeexample}
-\end{key}
-
-\begin{key}{/tikz/bottom color=\meta{color}}
- This option works like |top color|, only for the bottom color.
-\end{key}
-
-\begin{key}{/tikz/middle color=\meta{color}}
- This option specifies the color for the middle of an axis
- shading. It also sets the |shade| and |shading=axis| options, but it
- does not change the rotation angle.
-
- \emph{Note:} Since both |top color| and |bottom color| change the
- middle color, this option should be given \emph{last} if all of
- these options need to be given:
-
-\begin{codeexample}[]
-\tikz \draw[top color=white,bottom color=black,middle color=red]
- (0,0) rectangle (2,1);
-\end{codeexample}
-\end{key}
-
-\begin{key}{/tikz/left color=\meta{color}}
- This option does exactly the same as |top color|, except that the
- shading angle is set to $90^\circ$.
-\end{key}
-
-\begin{key}{/tikz/right color=\meta{color}}
- Works like |left color|.
-\end{key}
-
-\begin{key}{/tikz/inner color=\meta{color}}
- This option sets the color used at the center of a |radial|
- shading. When this option is used, the |shade| and |shading=radial|
- options are set.
-
-\begin{codeexample}[]
-\tikz \draw[inner color=red] (0,0) rectangle (2,1);
-\end{codeexample}
-\end{key}
-
-\begin{key}{/tikz/outer color=\meta{color}}
- This option sets the color used at the border and outside of a
- |radial| shading.
-
-\begin{codeexample}[]
-\tikz \draw[outer color=red,inner color=white]
- (0,0) rectangle (2,1);
-\end{codeexample}
-\end{key}
-
-
-\begin{key}{/tikz/ball color=\meta{color}}
- This option sets the color used for the ball shading. It sets the
- |shade| and |shading=ball| options. Note that the ball will never
- ``completely'' have the color \meta{color}. At its ``highlight'' spot
- a certain amount of white is mixed in, at the border a certain
- amount of black. Because of this, it also makes sense to say
- |ball color=white| or |ball color=black|
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \shade[ball color=white] (0,0) circle (2ex);
- \shade[ball color=red] (1,0) circle (2ex);
- \shade[ball color=black] (2,0) circle (2ex);
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-
-
-
\subsection{Establishing a Bounding Box}
\pgfname\ is reasonably good at keeping track of the size of your picture
@@ -973,7 +1035,8 @@ a shorthand for |\path[use as bounding box]|.
the size of all \emph{subsequent} paths are
ignored. However, if there were previous path operations that have
already established a larger bounding box, it will not be made
- smaller by this operation.
+ smaller by this operation (consider the |\pgfresetboundingbox| command
+ to reset the previous bounding box).
In a sense, |use as bounding box| has the same effect as clipping
all subsequent drawing against the current path---without actually
@@ -992,7 +1055,7 @@ Left of picture\begin{tikzpicture}
In a second application this option can be used to get better
control over the white space around the picture:
-
+
\begin{codeexample}[]
Left of picture
\begin{tikzpicture}
@@ -1005,15 +1068,18 @@ right of picture.
Note: If this option is used on a path inside a \TeX\ group (scope),
the effect ``lasts'' only till the end of the scope. Again, this
behavior is the same as for clipping.
+
+
+ Consider using |\useasboundingbox| together with |\pgfresetboundingbox| in order to replace the bounding box with a new one.
\end{key}
There is a node that allows you to get the size of the current
bounding box. The |current bounding box| node has the |rectangle|
-shape and its size is always the size of the current
+shape and its size is always the size of the current
bounding box.
Similarly, the |current path bounding box| node has the |rectangle|
-hape and the size of the bounding box of the current path.
+shape and the size of the bounding box of the current path.
\begin{codeexample}[]
@@ -1032,6 +1098,72 @@ hape and the size of the bounding box of the current path.
\end{codeexample}
+Occasionally, you may want to align multiple |tikzpicture| environments horizontally and/or vertically at some prescribed position. The vertical alignment can be realized by means of the |baseline| option since \TeX\ supports the concept of box depth natively. For horizontal alignment, things are slightly more involved. The following approach is realized by means of negative |\hspace|s before and/or after the picture, thereby removing parts of the picture. However, the actual amount of negative horizontal space is provided by means of image coordinates using the |trim left| and |trim right| keys:
+
+\begin{key}{/tikz/trim left=\meta{dimension or coordinate or \texttt{default}} (default 0pt)}
+ The |trim left| key tells \pgfname\space to discard everything which is left of the provided \meta{dimension or coordinate}. Here, \meta{dimension} is a single $x$ coordinate of the picture and \meta{coordinate} is a point with $x$ and $y$ coordinates (but only its $x$ coordinate will be used). The effect is the same as if you issue |\hspace{-s}| where |s| is the difference of the picture's bounding box lower left $x$ coordinate and the $x$ coordinate specified as \meta{dimension or coordinate}:
+\begin{codeexample}[]
+Text before image.%
+ \begin{tikzpicture}[trim left]
+ \draw (-1,-1) grid (3,2);
+ \fill (0,0) circle (5pt);
+ \end{tikzpicture}%
+Text after image.
+\end{codeexample}
+ Since |trim left| uses the default |trim left=0pt|, everything left of $x=0$ is removed from the bounding box.
+
+ The following example has once the relative long label $-1$ and once the shorter label $1$. Horizontal alignment is established with |trim left|:
+\begin{codeexample}[pre={\vbox\bgroup\hsize=5cm},post=\egroup,width=8cm]
+\begin{tikzpicture}
+ \draw (0,1) -- (0,0) -- (1,1) -- cycle;
+ \fill (0,0) circle (2pt);
+ \node[left] at (0,0) {$-1$};
+\end{tikzpicture}
+\par
+\begin{tikzpicture}
+ \draw (0,1) -- (0,0) -- (1,1) -- cycle;
+ \fill (0,0) circle (2pt);
+ \node[left] at (0,0) {$1$};
+\end{tikzpicture}
+\par
+\begin{tikzpicture}[trim left]
+ \draw (0,1) -- (0,0) -- (1,1) -- cycle;
+ \fill (0,0) circle (2pt);
+ \node[left] at (0,0) {$-1$};
+\end{tikzpicture}
+\par
+\begin{tikzpicture}[trim left]
+ \draw (0,1) -- (0,0) -- (1,1) -- cycle;
+ \fill (0,0) circle (2pt);
+ \node[left] at (0,0) {$1$};
+\end{tikzpicture}
+\end{codeexample}
+
+ Use |trim left=default| to reset the value.
+\end{key}
+
+\begin{key}{/tikz/trim right=\meta{dimension or coordinate or \texttt{default}}}
+ This key is similar to |trim left|: it discards everything which is right of the provided \meta{dimension or coordinate}. As for |trim left|, \meta{dimension} denotes a single $x$ coordinate of the picture and \meta{coordinate} a coordinate with $x$ and $y$ value (although only its $x$ component will be used).
+
+ We use the same example from above and add |trim right|:
+\begin{codeexample}[]
+Text before image.%
+ \begin{tikzpicture}[trim left, trim right=2cm, baseline]
+ \draw (-1,-1) grid (3,2);
+ \fill (0,0) circle (5pt);
+ \end{tikzpicture}%
+Text after image.
+\end{codeexample}
+ In addition to |trim left=0pt|, we also discard everything which is right of $x$|=2cm|. Furthermore, the |baseline| key supports vertical alignment as well (using the $y$|=0cm| baseline).
+
+ Use |trim right=default| to reset the value.
+\end{key}
+
+Note that |baseline|, |trim left| and |trim right| are currently the \emph{only} supported way of truncated bounding boxes which are compatible with image externalization (see the |external| library for details).
+
+\begin{key}{/pgf/trim lowlevel=\mchoice{true,false} (initially false)}
+ This affects only the basic level image externalization: the initial configuration |trim lowlevel=false| stores the normal image, without trimming, and the trimming into a separate file. This allows reduced bounding boxes without clipping the rest away. The |trim lowlevel=true| information causes the image externalization to store the trimmed image, possibly resulting in clipping.
+\end{key}
\subsection{Clipping and Fading (Soft Clipping)}
@@ -1071,7 +1203,7 @@ transparency in general.
\end{codeexample}
It is usually a \emph{very} good idea to apply the |clip| option only
- to the first path command in a scope.
+ to the first path command in a scope.
If you ``only wish to clip'' and do not wish to draw anything, you can
use the |\clip| command, which is a shorthand for |\path[clip]|.
@@ -1094,7 +1226,7 @@ transparency in general.
\draw (0,0) -- (30:1cm);
\begin{scope}[fill=red]
\fill[clip] (0.2,0.2) rectangle (0.5,0.5);
-
+
\draw (0,0) -- (40:1cm);
\draw (0,0) -- (50:1cm);
\draw (0,0) -- (60:1cm);
@@ -1110,8 +1242,8 @@ transparency in general.
code we could not have moved the |fill=red| to the |\fill|
command. The reasons for this have to do with the internals of the
\pdf\ specification. You do not want to know the details. It is best
- simply not to specify any options for these
- commands.
+ simply not to specify any options for these
+ commands.
\end{key}
@@ -1187,7 +1319,7 @@ options:
In the following example, we use one |preaction| to add a shadow and
another to provide a shading, while the main action is to use a
- pattern.
+ pattern.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1262,7 +1394,7 @@ options:
\end{tikzpicture}
\end{codeexample}
- In another example, we use a postaction to ``colorzie'' a path:
+ In another example, we use a postaction to ``colorize'' a path:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1287,7 +1419,7 @@ that slightly varied. Such morphings are a special case
of the more general ``decorations'' described in detail in
Section~\ref{section-tikz-decorations}. For instance, in the following
example the path is drawn twice: Once normally and then in a morphed
-(=decorated) manner.
+(=decorated) manner.
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) rectangle (3,2);
@@ -1305,4 +1437,3 @@ pre- or postaction. It is also possible to deform shapes:
fill=blue!20,draw,thick,circle] {Hello!};
\end{tikzpicture}
\end{codeexample}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
index 448bd24a029..1847b27bc92 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
@@ -15,8 +15,8 @@
A \emph{coordinate} is a position on the canvas on which your picture
is drawn. \tikzname\ uses a special syntax for specifying
coordinates. Coordinates are always put in round brackets. The general
-syntax is
-\declare{|(|\opt{|[|\meta{options}|]|}\meta{coordinate specification}|)|}.
+syntax is
+\declare{|(|\opt{|[|\meta{options}|]|}\meta{coordinate specification}|)|}.
The \meta{coordinate specification} specified coordinates using one of
many different possible \emph{coordinate systems}. Examples are the
@@ -109,7 +109,7 @@ Let us start with the basic coordinate systems.
To specify a coordinate in the coordinate system implicitly, you use
two dimensions that are separated by a comma as in |(0cm,3pt)| or
- |(2cm,\textheight)|.
+ |(2cm,\textheight)|.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -127,11 +127,10 @@ Let us start with the basic coordinate systems.
$z$-vectors. By default, the $x$-vector points 1cm to the right,
the $y$-vector points 1cm upwards, but this can be changed
arbitrarily as explained in Section~\ref{section-xyz}. The default
- $z$-vector points to $\bigl(-\frac{1}{\sqrt2}
- \textrm{cm},-\frac{1}{\sqrt2}\textrm{cm}\bigr)$.
+ $z$-vector points to $\bigl(-3.85\textrm{mm},-3.85\textrm{mm}\bigr)$.
To specify the factors by which the vectors should be multiplied
- before being added, you use the following three options:
+ before being added, you use the following three options:
\begin{key}{/tikz/cs/x=\meta{factor} (initially 0)}
Factor by which the $x$-vector is multiplied.
\end{key}
@@ -152,7 +151,7 @@ Let us start with the basic coordinate systems.
This coordinate system can also be selected implicitly. To do so,
you just provide two or three comma-separated factors (not
- dimensions).
+ dimensions).
\begin{codeexample}[]
\begin{tikzpicture}[->]
\draw (0,0) -- (1,0);
@@ -179,7 +178,7 @@ of two coordinate |(|\meta{x}|,0)| and |(0pt,|\meta{y}|)| is used.
\meta{y} internally uses a mixture of dimensions and dimensionless
values, then all dimensionless values are ``upgraded'' to dimensions
by interpreting them as |pt|. So, |2+3cm| is the same dimension as
-|2pt+3cm|.
+|2pt+3cm|.
\begin{coordinatesystem}{canvas polar}
The |canvas polar| coordinate system allows you to specify
@@ -210,9 +209,9 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as
\tikz \draw (0,0) -- (canvas polar cs:angle=30,radius=1cm);
\end{codeexample}
- The implicit form for canvas polar coordinates is the following:
+ The implicit form for canvas polar coordinates is the following:
you specify the angle and the distance, separated by a colon as in
- |(30:1cm)|.
+ |(30:1cm)|.
\begin{codeexample}[]
\tikz \draw (0cm,0cm) -- (30:1cm) -- (60:1cm) -- (90:1cm)
@@ -284,7 +283,7 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as
\begin{coordinatesystem}{xy polar}
This is just an alias for |xyz polar|, which some people might
prefer as there is no z-coordinate involved in the |xyz polar|
- coordinates.
+ coordinates.
\end{coordinatesystem}
@@ -308,7 +307,7 @@ The |barycentric cs| allows you to specify such coordinates easily.
should be a comma-separated list of expressions of the form
\meta{node name}|=|\meta{number}. Note that (currently) the list
should not contain any spaces before or after the \meta{node name}
- (unlike normal key-value pairs).
+ (unlike normal key-value pairs).
The specified coordinate is now computed as follows: Each pair
provides one vector and a number. The vector is the |center| anchor
@@ -323,7 +322,7 @@ The |barycentric cs| allows you to specify such coordinates easily.
\coordinate (content) at (90:3cm);
\coordinate (structure) at (210:3cm);
\coordinate (form) at (-30:3cm);
-
+
\node [above] at (content) {content oriented};
\node [below left] at (structure) {structure oriented};
\node [below right] at (form) {form oriented};
@@ -361,12 +360,12 @@ you use the following coordinate system:
You can use three options to specify which coordinate you mean:
\begin{key}{/tikz/cs/name=\meta{node name}}
Specifies the node in which you which to specify a coordinate. The
- \meta{node name} is
+ \meta{node name} is
the name that was previously used to name the node using the
|name=|\meta{node name} option or the special node name syntax.
\end{key}
\begin{key}{/tikz/anchor=\meta{anchor}}
- Specifies an anchor of the node. Here is an example:
+ Specifies an anchor of the node. Here is an example:
\begin{codeexample}[]
\begin{tikzpicture}
\node (shape) at (0,2) [draw] {|class Shape|};
@@ -398,7 +397,7 @@ you use the following coordinate system:
It is possible to provide \emph{neither} the |anchor=| option nor
the |angle=| option. In this case, \tikzname\ will calculate an
- appropriate border position for you. Here is an example:
+ appropriate border position for you. Here is an example:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -418,12 +417,12 @@ you use the following coordinate system:
with the curve-to operation |..|. For other path commands, such as
|parabola| or |plot|, the center will be used. If this is not desired,
you should give a named anchor or an angle anchor.
-
+
Note that if you use an automatic coordinate for both the start and
the end of a line-to, as in |--(node cs:name=b)--|, then \emph{two}
border coordinates are computed with a move-to between them. This
is usually exactly what you want.
-
+
If you use relative coordinates together with automatic anchor
coordinates, the relative coordinates are computed relative to
the node's center, not relative to the border point. Here is an
@@ -458,159 +457,117 @@ Similarly, in the following examples both control points are $(1,1)$:
(2,2) node(c) [rectangle,rotate=20,draw,fill] {A rectangle}
(5,2) node(d) [rectangle,rotate=-30,draw,fill] {Another rectangle};
\draw[thick] (a.south) -- (b) -- (c) -- (d);
- \draw[thick,red,->] (a) |- +(1,3) -| (c) |- (b);
- \draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d);
+ \draw[thick,red,->] (a) |- +(1,3) -| (c) |- (b);
+ \draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d);
\end{tikzpicture}
\end{codeexample}
\end{coordinatesystem}
-
-\subsubsection{Intersection Coordinate Systems}
-
-Often you wish to specify a point that is on the
-intersection of two lines or shapes. For this, the following
-coordinate system is useful:
-
-\begin{coordinatesystem}{intersection}
- First, you must specify two objects that should be
- intersected. These ``objects'' can either be lines or the shapes of
- nodes. There are two option to specify the first object:
- \begin{key}{/tikz/cs/first line={\ttfamily\char`\{}|(|\meta{first
- coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}}
- Specifies that the first object is a line that goes from
- \meta{first coordinate} to meta{second coordinate}.
- \end{key}
- Note that you have to write |--| between the coordinate, but this
- does not mean that anything is added to the path. This is simply a
- special syntax.
- \begin{key}{/tikz/cs/first node=\meta{node}}
- Specifies that the first object is a previously defined node named
- \meta{node}.
- \end{key}
-
- To specify the second object, you use one of the following keys:
- \begin{key}{/tikz/cs/second line={\ttfamily\char`\{}|(|\meta{first
- coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}}
- As above.
- \end{key}
- \begin{key}{/tikz/cs/second node=\meta{node}}
- Specifies that the second object is a previously defined node
- named \meta{node}.
- \end{key}
-
- Since it is possible that two objects have multiple intersections,
- you may need to specify which solution you want:
- \begin{key}{/tikz/cs/solution=\meta{number} (initially 1)}
- Specifies which solution should be used. Numbering starts with 1.
- \end{key}
- The coordinate specified in this way is the \meta{number}th
- intersection of the two objects. If the objects do not intersect,
- an error may occur.
+% Deprecated:
+
+% \subsubsection{Intersection Coordinate Systems}
+
+% Often you wish to specify a point that is on the
+% intersection of two lines or shapes. For this, the following
+% coordinate system is useful:
+
+% \begin{coordinatesystem}{intersection}
+% First, you must specify two objects that should be
+% intersected. These ``objects'' can either be lines or the shapes of
+% nodes. There are two option to specify the first object:
+% \begin{key}{/tikz/cs/first line={\ttfamily\char`\{}|(|\meta{first
+% coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}}
+% Specifies that the first object is a line that goes from
+% \meta{first coordinate} to meta{second coordinate}.
+% \end{key}
+% Note that you have to write |--| between the coordinate, but this
+% does not mean that anything is added to the path. This is simply a
+% special syntax.
+% \begin{key}{/tikz/cs/first node=\meta{node}}
+% Specifies that the first object is a previously defined node named
+% \meta{node}.
+% \end{key}
+
+% To specify the second object, you use one of the following keys:
+% \begin{key}{/tikz/cs/second line={\ttfamily\char`\{}|(|\meta{first
+% coordinate}|)--(|\meta{second coordinate}|)|{\ttfamily\char`\}}}
+% As above.
+% \end{key}
+% \begin{key}{/tikz/cs/second node=\meta{node}}
+% Specifies that the second object is a previously defined node
+% named \meta{node}.
+% \end{key}
+
+% Since it is possible that two objects have multiple intersections,
+% you may need to specify which solution you want:
+% \begin{key}{/tikz/cs/solution=\meta{number} (initially 1)}
+% Specifies which solution should be used. Numbering starts with 1.
+% \end{key}
+% The coordinate specified in this way is the \meta{number}th
+% intersection of the two objects. If the objects do not intersect,
+% an error may occur.
+
+% \begin{codeexample}[]
+% \begin{tikzpicture}
+% \draw[help lines] (0,0) grid (3,2);
+% \draw (0,0) coordinate (A) -- (3,2) coordinate (B)
+% (1,2) -- (3,0);
+
+% \fill[red] (intersection cs:
+% first line={(A)--(B)},
+% second line={(1,2)--(3,0)}) circle (2pt);
+% \end{tikzpicture}
+% \end{codeexample}
+
+% The implicit way of specifying this coordinate system is to write
+% \declare{|(intersection |\opt{\meta{number}}| of |\meta{first
+% object}%
+% | and |\meta{second object}|)|}. Here, \meta{first object} either
+% has the form \meta{$p_1$}|--|\meta{$p_2$} or it is just a node
+% name. Likewise for \meta{second object}. Note that there are \emph{no}
+% parentheses around the $p_i$. Thus, you would write
+% |(intersection of A--B and 1,2--3,0)| for the intersection of the
+% line through the coordinates |A| and |B| and the line through the
+% points $(1,2)$ and $(3,0)$. You would write
+% |(intersection 2 of c_1 and c_2)| for the second
+% intersection of the node named |c_1| and the node named
+% |c_2|.
+
+% \tikzname\ needs an explicit algorithm for computing the
+% intersection of two shapes and such an algorithm is available only
+% for few shapes. Currently, the following intersection will be
+% computed correctly:
+% \begin{itemize}
+% \item a line and a line
+% \item a |circle| node and a line (in any order)
+% \item a |circle| and a |circle|
+% \end{itemize}
+% \begin{codeexample}[]
+% \begin{tikzpicture}[scale=.25]
+% \coordinate [label=-135:$a$] (a) at ($ (0,0) + (rand,rand) $);
+% \coordinate [label=45:$b$] (b) at ($ (3,2) + (rand,rand) $);
+
+% \coordinate [label=-135:$u$] (u) at (-1,1);
+% \coordinate [label=45:$v$] (v) at (6,0);
+
+% \draw (a) -- (b)
+% (u) -- (v);
+
+% \node (c1) at (a) [draw,circle through=(b)] {};
+% \node (c2) at (b) [draw,circle through=(a)] {};
+
+% \coordinate [label=135:$c$] (c) at (intersection 2 of c1 and c2);
+% \coordinate [label=-45:$d$] (d) at (intersection of u--v and c2);
+% \coordinate [label=135:$e$] (e) at (intersection of u--v and a--b);
+
+% \foreach \p in {a,b,c,d,e,u,v}
+% \fill [opacity=.5] (\p) circle (8pt);
+% \end{tikzpicture}
+% \end{codeexample}
+% \end{coordinatesystem}
-\begin{codeexample}[]
-\begin{tikzpicture}
- \draw[help lines] (0,0) grid (3,2);
- \draw (0,0) coordinate (A) -- (3,2) coordinate (B)
- (1,2) -- (3,0);
-
- \fill[red] (intersection cs:
- first line={(A)--(B)},
- second line={(1,2)--(3,0)}) circle (2pt);
-\end{tikzpicture}
-\end{codeexample}
-
- The implicit way of specifying this coordinate system is to write
- \declare{|(intersection |\opt{\meta{number}}| of |\meta{first
- object}%
- | and |\meta{second object}|)|}. Here, \meta{first obejct} either
- has the form \meta{$p_1$}|--|\meta{$p_2$} or it is just a node
- name. Likewise for \meta{second object}. Note that there are \emph{no}
- parentheses around the $p_i$. Thus, you would write
- |(intersection of A--B and 1,2--3,0)| for the intersection of the
- line through the coordinates |A| and |B| and the line through the
- points $(1,2)$ and $(3,0)$. You would write
- |(intersection 2 of c_1 and c_2)| for the second
- intersection of the node named |c_1| and the node named
- |c_2|.
-
- \tikzname\ needs an explicit algorithm for computing the
- intersection of two shapes and such an algorithm is available only
- for few shapes. Currently, the following intersection will be
- computed correctly:
- \begin{itemize}
- \item a line and a line
- \item a |circle| node and a line (in any order)
- \item a |circle| and a |circle|
- \end{itemize}
-\begin{codeexample}[]
-\begin{tikzpicture}[scale=.25]
- \coordinate [label=-135:$a$] (a) at ($ (0,0) + (rand,rand) $);
- \coordinate [label=45:$b$] (b) at ($ (3,2) + (rand,rand) $);
- \coordinate [label=-135:$u$] (u) at (-1,1);
- \coordinate [label=45:$v$] (v) at (6,0);
-
- \draw (a) -- (b)
- (u) -- (v);
-
- \node (c1) at (a) [draw,circle through=(b)] {};
- \node (c2) at (b) [draw,circle through=(a)] {};
-
- \coordinate [label=135:$c$] (c) at (intersection 2 of c1 and c2);
- \coordinate [label=-45:$d$] (d) at (intersection of u--v and c2);
- \coordinate [label=135:$e$] (e) at (intersection of u--v and a--b);
-
- \foreach \p in {a,b,c,d,e,u,v}
- \fill [opacity=.5] (\p) circle (8pt);
-\end{tikzpicture}
-\end{codeexample}
-\end{coordinatesystem}
-
-A frequent special case of intersections is the intersection of a
-vertical line going through a point $p$ and a horizontal line going
-through some other point $q$. For this situation there is another
-coordinate system.
-
-\begin{coordinatesystem}{perpendicular}
- This coordinate system works the same way as |intersection|, only
- the lines are specified differently:
-
- \begin{key}{/tikz/cs/horizontal line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}}
- Specifies that one line is a horizontal line that goes through the
- given coordinate.
- \end{key}
- \begin{key}{/tikz/cs/vertical line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}}
- Specifies that the other line is vertical and goes through the
- given coordinate.
- \end{key}
-
- The implicit syntax is to write \declare{|(|\meta{p}\verb! |- !\meta{q}|)|} or
- \declare{|(|\meta{q}\verb! -| !\meta{p}|)|}.
-
- For example, \verb!(2,1 |- 3,4)! and \verb!(3,4 -| 2,1)! both yield
- the same as \verb!(2,4)! (provided the $xy$-coordinate system has not
- been modified).
-
- The most useful application of the syntax is to draw a line up to some
- point on a vertical or horizontal line. Here is an example:
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \path (30:1cm) node(p1) {$p_1$} (75:1cm) node(p2) {$p_2$};
-
- \draw (-0.2,0) -- (1.2,0) node(xline)[right] {$q_1$};
- \draw (2,-0.2) -- (2,1.2) node(yline)[above] {$q_2$};
-
- \draw[->] (p1) -- (p1 |- xline);
- \draw[->] (p2) -- (p2 |- xline);
- \draw[->] (p1) -- (p1 -| yline);
- \draw[->] (p2) -- (p2 -| yline);
-\end{tikzpicture}
-\end{codeexample}
-\end{coordinatesystem}
-
-
\subsubsection{Tangent Coordinate Systems}
\begin{coordinatesystem}{tangent}
@@ -626,19 +583,18 @@ coordinate system.
The following options may be given:
\begin{key}{/tikz/cs/node=\meta{node}}
This key specifies the node on whose border the tangent should
- lie.
+ lie.
\end{key}
\begin{key}{/tikz/cs/point=\meta{point}}
- This key speicifes the point through which the tangent should go.
+ This key specifies the point through which the tangent should go.
\end{key}
\begin{key}{/tikz/cs/solution=\meta{number}}
Specifies which solution should be used if there are more than one.
\end{key}
- As for intersection coordinate system, a special algorithm is needed
- in order to compute the tangent for a given shape. Currently,
- tangents can be computed for nodes whose shape is one of the
- following:
+ A special algorithm is needed in order to compute the tangent for a
+ given shape. Currently, tangents can be computed for nodes whose
+ shape is one of the following:
\begin{itemize}
\item |coordinate|
\item |circle|
@@ -651,7 +607,7 @@ coordinate system.
\coordinate (a) at (3,2);
\node [circle,draw] (c) at (1,1) [minimum size=40pt] {$c$};
-
+
\draw[red] (a) -- (tangent cs:node=c,point={(a)},solution=1) --
(c.center) -- (tangent cs:node=c,point={(a)},solution=2) -- cycle;
\end{tikzpicture}
@@ -660,6 +616,8 @@ coordinate system.
There is no implicit syntax for this coordinate system.
\end{coordinatesystem}
+
+
\subsubsection{Defining New Coordinate Systems}
While the set of coordinate systems that \tikzname\ can parse via
@@ -687,8 +645,8 @@ commands are used:
defined.
\begin{codeexample}[]
\makeatletter
-\define@key{cylindricalkeys}{angle}{\def\myangle{#1}}
-\define@key{cylindricalkeys}{radius}{\def\myradius{#1}}
+\define@key{cylindricalkeys}{angle}{\def\myangle{#1}}
+\define@key{cylindricalkeys}{radius}{\def\myradius{#1}}
\define@key{cylindricalkeys}{z}{\def\myz{#1}}
\tikzdeclarecoordinatesystem{cylindrical}%
{%
@@ -704,11 +662,217 @@ commands are used:
\end{command}
\begin{command}{\tikzaliascoordinatesystem\marg{new name}\marg{old name}}
- Creates an alias of \meta{old name}.
+ Creates an alias of \meta{old name}.
\end{command}
+\subsection{Coordinates at Intersections}
+\label{section-intersection-coordinates}
+
+You will wish to compute the intersection of two paths. For the
+special and frequent case of two perpendicular lines, a special
+coordinate system called |perpendicular| is available. For more
+general cases, the |intersection| library can be used.
+
+
+\subsubsection{Intersections of Perpendicular Lines}
+
+A frequent special case of path intersections is the intersection of a
+vertical line going through a point $p$ and a horizontal line going
+through some other point $q$. For this situation there is a useful
+coordinate system.
+
+\begin{coordinatesystem}{perpendicular}
+ You can specify the two lines using the following keys:
+
+ \begin{key}{/tikz/cs/horizontal line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}}
+ Specifies that one line is a horizontal line that goes through the
+ given coordinate.
+ \end{key}
+ \begin{key}{/tikz/cs/vertical line through={\ttfamily\char`\{}|(|\meta{coordinate}|)|{\ttfamily\char`\}}}
+ Specifies that the other line is vertical and goes through the
+ given coordinate.
+ \end{key}
+
+ However, in almost all cases you should, instead, use the implicit
+ syntax. Here, you write \declare{|(|\meta{p}\verb! |- !\meta{q}|)|} or
+ \declare{|(|\meta{q}\verb! -| !\meta{p}|)|}.
+
+ For example, \verb!(2,1 |- 3,4)! and \verb!(3,4 -| 2,1)! both yield
+ the same as \verb!(2,4)! (provided the $xy$-coordinate system has not
+ been modified).
+
+ The most useful application of the syntax is to draw a line up to some
+ point on a vertical or horizontal line. Here is an example:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \path (30:1cm) node(p1) {$p_1$} (75:1cm) node(p2) {$p_2$};
+
+ \draw (-0.2,0) -- (1.2,0) node(xline)[right] {$q_1$};
+ \draw (2,-0.2) -- (2,1.2) node(yline)[above] {$q_2$};
+
+ \draw[->] (p1) -- (p1 |- xline);
+ \draw[->] (p2) -- (p2 |- xline);
+ \draw[->] (p1) -- (p1 -| yline);
+ \draw[->] (p2) -- (p2 -| yline);
+\end{tikzpicture}
+\end{codeexample}
+\end{coordinatesystem}
+
+
+\subsubsection{Intersections of Arbitrary Paths}
+
+\begin{tikzlibrary}{intersections}
+ This library enables the calculation of intersections of
+ two arbitrary paths. However, due to the low accuracy of
+ \TeX, the paths should not be ``too complicated''.
+ In particular, you should not try to intersect paths consisting
+ lots of very small segments such as plots or decorated paths.
+\end{tikzlibrary}
+
+To find the intersections of two paths in \tikzname, they must be
+``named''. A ``named path'' is, quite simply, a path that has been
+named using the following key:
+
+\begin{keylist}{%
+ /tikz/name path=\meta{name},
+ /tikz/name path global=\meta{name}}
+ The effect of this key is that, after the path has been constructed,
+ just before it is used, it is associated with \meta{name}. For |name path|,
+ this association survives beyond the final semi-colon of the path
+ but not the end of the surrounding scope. For |name path global|, the association
+ will survive beyond any scope as well. Handle with care.
+
+ Any paths created by nodes on the (main) path are ignored, unless
+ this key is explicitly used. If the same \meta{name} is used for the
+ main path and the node path(s), then the paths will be added
+ together and then associated with \meta{name}.
+\end{keylist}
+
+To find the intersection of named paths, the following key is used:
+
+\begin{key}{/tikz/name intersections=\marg{options}}
+ This key changes the key path to |/tikz/intersection| and processes
+ \meta{options}. These options determine, among other things,
+ which paths to use for the intersection. Having processed the
+ options, any intersections are then found. A coordinate is created
+ at each intersection, which by default, will be named
+ |intersection-1|, |intersection-2|, and so on.
+ Optionally, the prefix |intersection| can be changed, and the
+ total number of intersections stored in a \TeX-macro.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[every node/.style={opacity=1, black, above left}]
+ \draw [help lines] grid (3,2);
+ \draw [name path=ellipse] (2,0.5) ellipse (0.75cm and 1cm);
+ \draw [name path=rectangle, rotate=10] (0.5,0.5) rectangle +(2,1);
+ \fill [red, opacity=0.5, name intersections={of=ellipse and rectangle}]
+ (intersection-1) circle (2pt) node {1}
+ (intersection-2) circle (2pt) node {2};
+\end{tikzpicture}
+\end{codeexample}
+
+The following keys can be used in \meta{options}:
+
+\begin{key}{/tikz/intersection/of=\meta{name path 1}| and |\meta{name path 2}}
+ This key is used to specify the names of the paths to use for
+ the intersection.
+\end{key}
+
+\begin{key}{/tikz/intersection/name=\meta{prefix} (initially intersection)}
+ This key specifies the prefix name for the coordinate nodes placed
+ at each intersection.
+\end{key}
+
+\begin{key}{/tikz/intersection/total=\meta{macro}}
+ This key will mean than the total number of intersections found
+ will be stored in \meta{macro}.
+\end{key}
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \clip (-2,-2) rectangle (2,2);
+ \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
+ \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
+
+ \fill [name intersections={of=curve 1 and curve 2, name=i, total=\t}]
+ [red, opacity=0.5, every node/.style={above left, black, opacity=1}]
+ \foreach \s in {1,...,\t}{(i-\s) circle (2pt) node {\footnotesize\s}};
+\end{tikzpicture}
+\end{codeexample}
+
+
+ \begin{key}{/tikz/intersection/by=\meta{comma-separated list}}
+ This key allows you to specify a list of names for the intersection
+ coordinates. The intersection coordinates will still be named
+ \meta{prefix}|-|\meta{number}, but additionally the first
+ coordinate will also be named by the first element of the
+ \meta{comma-separated list}. What happens is that the
+ \meta{comma-separated list} is passed to the |\foreach| statement
+ and for \meta{list member} a coordinate is created at the
+ already-named intersection.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \clip (-2,-2) rectangle (2,2);
+ \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
+ \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
+
+ \fill [name intersections={of=curve 1 and curve 2, by={a,b}}]
+ (a) circle (2pt)
+ (b) circle (2pt);
+\end{tikzpicture}
+\end{codeexample}
+
+ You can also use the |...| notation of the |\foreach| statement
+ inside the \meta{comma-separated list}.
+
+ In case an element of the \meta{comma-separated list} starts with
+ options in square brackets, these options are used when the
+ coordinate is created. A coordinate name can still, but need not,
+ follow the options. This
+ makes it easy to add labels to intersections:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \clip (-2,-2) rectangle (2,2);
+ \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
+ \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
+
+ \fill [name intersections={
+ of=curve 1 and curve 2,
+ by={[label=center:a],[label=center:...],[label=center:i]}}];
+\end{tikzpicture}
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/intersection/sort by=\meta{path name}}
+By default, the intersections are simply returned in the order that
+the intersection algorithm finds them. Unfortunately, this is not
+necessarily a ``helpful'' ordering. This key can be used to sort
+the intersections along the path specified by \meta{path name},
+which should be one of the paths mentioned in the
+|/tikz/intersection/of| key.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+\clip (-0.5,-0.75) rectangle (3.25,2.25);
+\foreach \pathname/\shift in {line/0cm, curve/2cm}{
+ \tikzset{xshift=\shift}
+ \draw [->, name path=curve] (1,1.5) .. controls (-1,1) and (2,0.5) .. (0,0);
+ \draw [->, name path=line] (0,-.5) -- (1,2) ;
+ \fill [name intersections={of=line and curve,sort by=\pathname, name=i}]
+ [red, opacity=0.5, every node/.style={left=.25cm, black, opacity=1}]
+ \foreach \s in {1,2,3}{(i-\s) circle (2pt) node {\footnotesize\s}};
+}
+\end{tikzpicture}
+\end{codeexample}
+
+ \end{key}
+\end{key}
+
+
+
\subsection{Relative and Incremental Coordinates}
@@ -753,7 +917,7 @@ relative to the start of the curve.
This special behavior makes it easy to specify that a curve should
``leave or arrives from a certain direction'' at the start or end. In
the following example, the curve ``leaves'' at $30^\circ$ and
-``arrives'' at $60^\circ$:
+``arrives'' at $60^\circ$:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -802,13 +966,14 @@ decide which you need.
\draw[red] (2,0) -- ++(1,0)
{ [current point is local] -- ++(0,1) } -- ++(-1,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
In the above example, we could also have given the option outside
the scope, for instance as a parameter to the whole scope.
\end{key}
\subsection{Coordinate Calculations}
+\label{tikz-lib-calc}
\begin{tikzlibrary}{calc}
You need to load this library in order to use the coordinate
@@ -837,7 +1002,7 @@ of the point |a|:
The general syntax is the following:
\begin{quote}
- \declare{|(|\opt{|[|\meta{options}|]|}|$|\meta{coordinate computation}|$)|}.
+ \declare{|(|\opt{|[|\meta{options}|]|}|$|\meta{coordinate computation}|$)|}.
\end{quote}
As you can see, the syntax uses the \TeX\ math symbol |$| to %$
@@ -849,12 +1014,12 @@ The \meta{coordinate computation} has the following structure:
\item
It starts with
\begin{quote}
- \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}}
+ \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}}
\end{quote}
\item
This is optionally followed by |+| or |-| and then another
\begin{quote}
- \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}}
+ \opt{\meta{factor}|*|}\meta{coordinate}\opt{\meta{modifiers}}
\end{quote}
\item
This is once more followed by |+| or |-| and another of the above
@@ -886,7 +1051,7 @@ everything up to the next occurrence of |*(|. Note that there is no
space between the asterisk and the parenthesis.
It is permissible to put the \meta{factor} is curly braces. This can
-be used whenever it is unclear where the \meta{factor} would end.
+be used whenever it is unclear where the \meta{factor} would end.
Here are some examples of coordinate specifications that consist of
exactly one \meta{factor} and one \meta{coordinate}:
@@ -927,14 +1092,14 @@ factor between $0$ and $1$, not a percentage, and, second, as the
the first. It is permissible to use \meta{numbers} that are smaller
than $0$ or larger than $1$. The \meta{number} is evaluated using the
|\pgfmathparse| command and, thus, it can involve complicated
-computations.
+computations.
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
\draw (1,0) -- (3,2);
-
+
\foreach \i in {0,0.2,0.5,0.9,1}
\node at ($(1,0)!\i!(3,2)$) {\i};
\end{tikzpicture}
@@ -1009,7 +1174,7 @@ following: Use the point that is distanced \meta{dimension} from
\draw [help lines] (0,0) grid (3,2);
\draw (1,0) -- (3,2);
-
+
\foreach \i in {0cm,1cm,15mm}
\node at ($(1,0)!\i!(3,2)$) {\i};
\end{tikzpicture}
@@ -1060,7 +1225,7 @@ Here is an example:
The effect is the following: We project the \meta{projection
coordinate} orthogonally onto to the line from \meta{coordinate} to
\meta{second coordinate}. This makes it easy to compute projected
-points:
+points:
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
index 3baa481990f..a00c1df01ad 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
@@ -43,7 +43,7 @@ look at some examples:
\filldraw[fill=blue!20] (0,3)
decorate [decoration=saw] { -- (3,3) }
decorate [decoration={coil,aspect=0}] { -- (2,1) }
- decorate [decoration=bumps] { -| (0,3) };
+ decorate [decoration=bumps] { -| (0,3) };
\end{tikzpicture}
\end{codeexample}
@@ -97,12 +97,12 @@ morphing; rather there are three kinds of decorations.
path in the sense that what used to be a straight line might
afterwards be a squiggly line or might have bumps. However, a line
is still and a line and path deforming decorations do not change
- the number of subpaths.
+ the number of subpaths.
Examples of such decorations are the |snake| or the |zigzag|
decoration. Many such decorations are defined in the library
|decorations.pathmorphing|.
-
+
\item \emph{Path replacing} decorations completely replace the
path by a different path that is only ``loosely based'' on the
original path. For instance, the |crosses| decoration replaces a path
@@ -117,7 +117,7 @@ morphing; rather there are three kinds of decorations.
Examples of path replacing decorations are |crosses| or |ticks| or
|shape backgrounds|. Such decorations are defined in the library
|decorations.pathreplacing|, but also in |decorations.shapes|.
-
+
\item \emph{Path removing} decorations completely remove the
to-be-decorated path. Thus, they have no effect on the main path
that is being constructed. Instead, they typically have numerous
@@ -156,7 +156,7 @@ it once, and then decorate the decorated path once more.
\tikz \fill [fill=blue!20,draw=blue,thick]
decorate[decoration={crosses,segment length=2mm}] {
decorate[decoration={zigzag,segment length=10mm,amplitude=2.5mm}] {
- (0,0) rectangle (3,2)
+ (0,0) rectangle (3,2)
}
};
\end{codeexample}
@@ -204,9 +204,9 @@ command.
paths (that is, you can nest applications of the |decorate| path
command, see below).
- Due to the limits on the precision in \TeX, some inaccuraces in
+ Due to the limits on the precision in \TeX, some inaccuracies in
positioning when crossing input segment boundaries may occasionally be
- found.
+ found.
You can use nodes normally inside the \meta{subpath}.
\begin{codeexample}[]
@@ -218,7 +218,7 @@ command.
\draw [blue] decorate [decoration={crosses}] {(3,0) -- (hi)};
\end{tikzpicture}
\end{codeexample}
-
+
The following key is used to select the decoration and also to
select further ``rendering options'' for the decoration.
@@ -240,21 +240,21 @@ command.
\draw [red] decorate [decoration=crosses] {(0,2) -- (3,0)};
\end{tikzpicture}
\end{codeexample}
-
+
The \meta{decoration options} are special options
(which have the path prefix |/pgf/decoration/|) that determine the
properties of the decoration. Which options are appropriate for a
decoration depend strongly on the decoration, you will have to look
up the appropriate options in the documentation of the decoration,
see Section~\ref{section-library-decorations}.
-
+
There is one option (available only in \tikzname) that is special:
\begin{key}{/pgf/decoration/name=\meta{name} (initially none)}
Use this key to set which decoration is to be used. The
\meta{name} can both be a decoration or a meta-decoration (you
need to worry about the difference only if you wish to define
your own decorations).
-
+
If you set \meta{name} to |none|, no decorations are added.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -265,7 +265,7 @@ command.
\end{codeexample}
Since this option is used so often, you can also leave out the
|name=| part. Thus, the above example can be rewritten more
- succinctly:
+ succinctly:
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -287,7 +287,7 @@ command.
Recall that some decorations actually completely remove the
to-be-decorated path. In such cases, the construction of the main
path is resumed after the |decorate| path command ends.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text along path,text=
around and around and around and around we go}]
@@ -303,7 +303,7 @@ command.
decoration replaces a straight line like \tikz\draw (0,0) -- (1,0);
by \tikz[decoration=Koch snowflake] \draw decorate{(0,0) --
(1,0)};. Repeatedly applying this transformation to a triangle
- yields a fractal that looks a bit like a snowflake, hence the name.
+ yields a fractal that looks a bit like a snowflake, hence the name.
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Koch snowflake,draw=blue,fill=blue!20,thick]
\filldraw (0,0) -- ++(60:1) -- ++(-60:1) -- cycle ;
@@ -342,7 +342,7 @@ you to decorate a path ``after the fact.''
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\draw [help lines] (0,0) grid (3,5);
-
+
\draw [fill=blue!20,decorate] (1.5,4) circle (1cm);
\node at (1.5,2.5) [fill=red!20,decorate,ellipse] {Ellipse};
@@ -357,7 +357,7 @@ you to decorate a path ``after the fact.''
cause the decoration to be applied only before or after the main
path has been used. Incidentally, this is another application of the
|decorate| option that you cannot achieve with the decorate path
- command.
+ command.
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\node at (1.5,1) [inner sep=6mm,fill=red!20,ellipse,
@@ -373,10 +373,10 @@ you to decorate a path ``after the fact.''
\draw [help lines] grid (3,2);
\fill [draw=red,fill=red!20,
postaction={decorate,decoration={raise=2pt,text along path,
- text=around and around and around and around we go}}]
+ text=around and around and around and around we go}}]
(0,1) arc (180:-180:1.5cm and 1cm);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{key}
@@ -488,7 +488,7 @@ not with meta-decorations.
Note that the default |pre| option is |lineto|, not |curveto|. This
means that the default |pre| decoration will not follow curves (for
efficiency reasons). Change the |pre| key to |curveto| if you have a
- curved path.
+ curved path.
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre length=3cm}]
@@ -512,12 +512,12 @@ not with meta-decorations.
\begin{key}{/pgf/decorations/post=\meta{decoration} (initially
lineto)}
- Works like |pre|, only for the end of the decoration.
+ Works like |pre|, only for the end of the decoration.
\end{key}
\begin{key}{/pgf/decorations/post length=\meta{dimension} (initially
0pt)}
- Works like |pre length|, only for the end of the decoration.
+ Works like |pre length|, only for the end of the decoration.
\end{key}
Here is a typical example that shows how these keys can be used:
@@ -535,4 +535,4 @@ Here is a typical example that shows how these keys can be used:
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
index 1ecb8efa5f3..b3e19fdefd6 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
@@ -15,7 +15,7 @@ Zeichenprogramm.'' To use \tikzname, as a \LaTeX\ user say
|\usepackage{tikz}| somewhere in the preamble, as a plain \TeX\ user
say |\input tikz.tex|. \tikzname's job is to make your life easier by
providing an easy-to-learn and easy-to-use syntax for describing
-graphics.
+graphics.
The commands and syntax of \tikzname\ were influenced by several
sources. The basic command names and the notion of path operations is
@@ -23,7 +23,7 @@ taken from \textsc{metafont}, the option mechanism comes from
\textsc{pstricks}, the notion of styles is reminiscent of
\textsc{svg}. To make it all work together, some compromises were
necessary. I also added some ideas of my own, like coordinate
-transformations.
+transformations.
The following basic design principles underlie \tikzname:
\begin{enumerate}
@@ -47,7 +47,7 @@ separated by commas, in round brackets as in |(1cm,2pt)|.
You can also specify a point in polar coordinates by using a colon
instead of a comma as in |(30:1cm)|, which means ``1cm in a 30
-degrees direction.''
+degrees direction.''
If you do not provide a unit, as in |(2,1)|, you specify a point in
\pgfname's $xy$-coordinate system. By default, the unit $x$-vector
@@ -105,12 +105,12 @@ command, which is an abbreviation for |\path[fill]|. The
|\filldraw| command is an abbreviation for
|\path[fill,draw]|. Shading is caused by the |shade| option (there
are |\shade| and |\shadedraw| abbreviations) and clipping by the
-|clip| option. There is is also a |\clip| command, which does the
+|clip| option. There is also a |\clip| command, which does the
same as |\path[clip]|, but not commands like |\drawclip|. Use, say,
|\draw[clip]| or |\path[draw,clip]| instead.
All of these commands can only be used inside |{tikzpicture}|
-environments.
+environments.
\tikzname\ allows you to use different colors for filling and
stroking.
@@ -126,7 +126,7 @@ passed as optional parameters to the path drawing and filling
commands. This usage is similar to \textsc{pstricks}. For
example, the following will draw a thick, red triangle;
\begin{codeexample}[]
-\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (1,0) -- cycle;
+\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (0,1) -- cycle;
\end{codeexample}
\subsection{Special Syntax for Specifying Nodes}
@@ -139,9 +139,9 @@ in the following example:
Nodes are inserted at the current position of
the path, but only \emph{after} the path has been rendered. When
special options are given, as in
-|\draw (1,1) node[circle,draw] {text};|, the text is not just put
+|\draw (1,1) node[circle,draw] {text};|, the text is not just put
at the current position. Rather, it is surrounded by a circle and
-this circle is ``drawn.''
+this circle is ``drawn.''
You can add a name to a node for later reference either by using the
option |name=|\meta{node name} or by stating the node name in
@@ -153,8 +153,8 @@ it is possible (though a bit challenging) to define new shapes.
\subsection{Special Syntax for Specifying Trees}
In addition to the ``node syntax,'' \tikzname\ also introduces a
-special syntax for drawing trees. The syntax is intergrated with the
-special node syntax and only few new commands need to be remebered.
+special syntax for drawing trees. The syntax is intergraded with the
+special node syntax and only few new commands need to be remembered.
In essence, a |node| can be followed by any number of children, each
introduced by the keyword |child|. The children are nodes themselves,
each of which may have children in turn.
@@ -191,7 +191,7 @@ redrawn with different options:
\begin{codeexample}[]
\begin{tikzpicture}
[parent anchor=east,child anchor=west,grow=east,
- every node/.style={ball color=red,circle,text=white}
+ every node/.style={ball color=red,circle,text=white},
edge from parent/.style={draw,dashed,thick,red}]
\node {root}
child {node {left}}
@@ -240,9 +240,9 @@ the picture.
\tikzname\ supports both \pgfname's \emph{coordinate} transformation
system to perform transformations as well as \emph{canvas}
-transformations, a more low-level transformation system. (For
+transformations, a more low-level transformation system. (For
details on the difference between coordinate transformations and
-canvas transformations see Section~\ref{section-design-transformations}.)
+canvas transformations see Section~\ref{section-design-transformations}.)
The syntax is setup in such a way that is harder to use canvas
transformations than coordinate transformations. There are two reasons
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
index 856d918c540..265880d2b6e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
@@ -21,7 +21,7 @@ a vertical lines. There are different ways of solving such
problems. For example, by making clever use of anchors, nearly all
such alignment problems can be solved. However, this often leads to
complicated code. An often simpler way is to use \emph{matrices},
-the use of which is explaied in the current section.
+the use of which is explained in the current section.
A \tikzname\ matrix is similar to \LaTeX's |{tabular}| or
|{array}| environment, only instead of text each cell contains a
@@ -49,7 +49,7 @@ matrix. Instead of the usual \TeX-box that makes up the |text| part of
the node's shape, the matrix is used. Thus, in particular, a matrix
can have a shape, this shape can be drawn or filled, it can be used in
a tree, and so on. Also, you can refer to the different anchors of a
-matrix.
+matrix.
\begin{key}{/tikz/matrix=\meta{true or false} (default true)}
This option can be passed to a |node| path command. It signals that
@@ -88,7 +88,7 @@ effect as for normal nodes:
normally). Before the matrix is typeset, the rotational and scaling
part of the transformation matrix is reset.
\item For multi-part shapes you can only set the |text| part of the
- node.
+ node.
\item All options starting with |text| such as |text width| have no
effect.
\end{enumerate}
@@ -180,7 +180,7 @@ left end of the second column (unless |column sep| is used). The right
end of the second column touches the left end of the third column, and
so on. (Internally, two columns are actually used to achieve the
desired horizontal alignment, but that is only and implementation
-detail.)
+detail.)
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
@@ -215,7 +215,7 @@ columns. Second, you can add options to the |&| character and the |\\|
command to adjust the spacing between two specific columns or
rows. Additionally, you can specify whether the space between two
columns or rows should be considered between the origins of cells in
-the column or row or between their borders.
+the column or row or between their borders.
\begin{key}{/tikz/column sep=\meta{spacing list}}
This option sets a default space that is added between every two
@@ -244,7 +244,7 @@ the column or row or between their borders.
concerning the two keywords, the last occurrence of one of the keywords is
important. If the last occurrence is |between borders| or if neither
occurs, then the space is inserted between the two columns
- normally. However, if the last occurs is |between origins|, then the
+ normally. However, if the last occurs is |between origins|, then the
following happens: The distance between the columns is adjusted such
that the difference between the origins of all the cells in the
first column (remember that they all lie on straight line) and the
@@ -254,7 +254,7 @@ the column or row or between their borders.
\emph{The |between origins| option can only be used for columns
mentioned in the first row, that is, you cannot specify this
option for columns introduced only in later rows.}
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,column sep={1cm,between origins},nodes=draw]
@@ -326,7 +326,7 @@ the |\\| command for rows.
This optional spacing list can only be given the first time
a new column is started (usually in the first row), subsequent usages
-of this option in later rows have no effect.
+of this option in later rows have no effect.
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,nodes=draw,column sep=1mm]
@@ -378,7 +378,7 @@ of the all cell pictures:
Inside this style (and inside all cells), the current \meta{row} and
\meta{column} number are also accessible via the counters
- |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|.
+ |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|.
\end{stylekey}
\begin{key}{/tikz/cells=\meta{options}}
@@ -393,7 +393,7 @@ of the all cell pictures:
The main use of this option is the install some options for the
nodes \emph{inside} the matrix that should not apply to the matrix
- \emph{itself}.
+ \emph{itself}.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -446,7 +446,7 @@ executed before all of the below).
[row 1/.style={red},
column 2/.style={green!50!black},
row 3 column 3/.style={blue}]
-
+
\matrix
{
\node {8}; & \node{1}; & \node {6}; \\
@@ -593,7 +593,7 @@ uses a different command to separate cells, namely the command
|\pgfmatrixnextcell| and using a normal |&| character will normally
fail. What happens is that, \tikzname\ makes |&| an active character
and then defines this character to be equal to
-|\pgfmatrixnextcell|. In most situations this will work
+|\pgfmatrixnextcell|. In most situations this will work
nicely, but sometimes |&| cannot be made active; for
instance because the matrix is used in an argument of some macro or
the matrix contains nodes that contain normal |{tabular}|
@@ -619,55 +619,55 @@ having to type |\pgfmatrixnextcell| each time:
\subsection{Examples}
The following examples are adapted from code by Mark Wibrow. The first
-two redraw pictures from Timothy van Zandt's PSTricks documentation:
+two redraw pictures from Timothy van Zandt's PStricks documentation:
{\catcode`\|=12
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\matrix [matrix of math nodes,row sep=1cm]
- {
- |(U)| U &[2mm] &[8mm] \\
- & |(XZY)| X \times_Z Y & |(X)| X \\
+ {
+ |(U)| U &[2mm] &[8mm] \\
+ & |(XZY)| X \times_Z Y & |(X)| X \\
& |(Y)| Y & |(Z)| Z \\
- };
- \begin{scope}[every node/.style={midway,auto,font=\scriptsize}]
- \draw [double, dashed] (U) -- node {$x$} (X);
+ };
+ \begin{scope}[every node/.style={midway,auto,font=\scriptsize}]
+ \draw [double, dashed] (U) -- node {$x$} (X);
\draw (X) -- node {$p$} (X -| XZY.east)
(X) -- node {$f$} (Z)
-- node {$g$} (Y)
-- node {$q$} (XZY)
-- node {$y$} (U);
\end{scope}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[]
-\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto]
+\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto]
\matrix [matrix of math nodes,
column sep={2cm,between origins},
row sep={3cm,between origins},
nodes={circle, draw, minimum size=7.5mm}]
- {
- & |(A)| A & \\
- |(B)| B & |(E)| E & |(C)| C \\
+ {
+ & |(A)| A & \\
+ |(B)| B & |(E)| E & |(C)| C \\
& |(D)| D \\
- };
+ };
\begin{scope}[every node/.style={font=\small\itshape}]
- \draw (A) to [bend left] (B) node [midway] {g};
- \draw (B) to [bend left] (A) node [midway] {f};
- \draw (D) -- (B) node [midway] {c};
- \draw (E) -- (B) node [midway] {b};
- \draw (E) -- (C) node [near end] {a};
- \draw [-,line width=8pt,draw=graphicbackground]
- (D) to [bend right, looseness=1] (A);
- \draw (D) to [bend right, looseness=1] (A)
- node [near start] {b} node [near end] {e};
+ \draw (A) to [bend left] node [midway] {g} (B);
+ \draw (B) to [bend left] node [midway] {f} (A);
+ \draw (D) -- node [midway] {c} (B);
+ \draw (E) -- node [midway] {b} (B);
+ \draw (E) -- node [near end] {a} (C);
+ \draw [-,line width=8pt,draw=graphicbackground]
+ (D) to [bend right, looseness=1] (A);
+ \draw (D) to [bend right, looseness=1]
+ node [near start] {b} node [near end] {e} (A);
\end{scope}
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\matrix (network)
[matrix of nodes,%
nodes in empty cells,
@@ -675,72 +675,72 @@ two redraw pictures from Timothy van Zandt's PSTricks documentation:
column sep={1cm,between origins},
row sep={1cm,between origins}]
{
- & & & \\
- & & & \\
+ & & & \\
+ & & & \\
|[draw=none]| & |[xshift=1mm]| & |[xshift=-1mm]| \\
- };
- \foreach \a in {1,...,4}{
- \draw (network-3-2) -- (network-2-\a);
- \draw (network-3-3) -- (network-2-\a);
- \draw [-stealth] ([yshift=5mm]network-1-\a.north) -- (network-1-\a);
- \foreach \b in {1,...,4}
- \draw (network-1-\a) -- (network-2-\b);
- }
- \draw [stealth-] ([yshift=-5mm]network-3-2.south) -- (network-3-2);
- \draw [stealth-] ([yshift=-5mm]network-3-3.south) -- (network-3-3);
-\end{tikzpicture}
+ };
+ \foreach \a in {1,...,4}{
+ \draw (network-3-2) -- (network-2-\a);
+ \draw (network-3-3) -- (network-2-\a);
+ \draw [-stealth] ([yshift=5mm]network-1-\a.north) -- (network-1-\a);
+ \foreach \b in {1,...,4}
+ \draw (network-1-\a) -- (network-2-\b);
+ }
+ \draw [stealth-] ([yshift=-5mm]network-3-2.south) -- (network-3-2);
+ \draw [stealth-] ([yshift=-5mm]network-3-3.south) -- (network-3-3);
+\end{tikzpicture}
\end{codeexample}
The following example is adapted from code written by Kjell Magne
-Fauske, which is based on the following paper: K.~Bossley, M.~Brown,
+Fauske, which is based on the following paper: K.~Bossley, M.~Brown,
and C.~Harris, Neurofuzzy identification of an autonomous underwater
vehicle, \emph{International Journal of Systems Science}, 1999, 30, 901--913.
\begin{codeexample}[]
\begin{tikzpicture}
- [auto,
- decision/.style={diamond, draw=blue, thick, fill=blue!20,
- text width=4.5em, text badly centered,
- inner sep=1pt},
- block/.style ={rectangle, draw=blue, thick, fill=blue!20,
- text width=5em, text centered, rounded corners,
+ [auto,
+ decision/.style={diamond, draw=blue, thick, fill=blue!20,
+ text width=4.5em,align=flush center,
+ inner sep=1pt},
+ block/.style ={rectangle, draw=blue, thick, fill=blue!20,
+ text width=5em,align=center, rounded corners,
minimum height=4em},
line/.style ={draw, thick, -latex',shorten >=2pt},
cloud/.style ={draw=red, thick, ellipse,fill=red!20,
minimum height=2em}]
-
+
\matrix [column sep=5mm,row sep=7mm]
{
% row 1
- \node [cloud] (expert) {expert}; &
- \node [block] (init) {initialize model}; &
+ \node [cloud] (expert) {expert}; &
+ \node [block] (init) {initialize model}; &
\node [cloud] (system) {system}; \\
% row 2
- & \node [block] (identify) {identify candidate model}; & \\
+ & \node [block] (identify) {identify candidate model}; & \\
% row 3
- \node [block] (update) {update model}; &
- \node [block] (evaluate) {evaluate candidate models}; & \\
+ \node [block] (update) {update model}; &
+ \node [block] (evaluate) {evaluate candidate models}; & \\
% row 4
- & \node [decision] (decide) {is best candidate}; & \\
+ & \node [decision] (decide) {is best candidate}; & \\
% row 5
& \node [block] (stop) {stop}; & \\
- };
+ };
\begin{scope}[every path/.style=line]
- \path (init) -- (identify);
- \path (identify) -- (evaluate);
- \path (evaluate) -- (decide);
- \path (update) |- (identify);
- \path (decide) -| node [near start] {yes} (update);
- \path (decide) -- node [midway] {no} (stop);
- \path [dashed] (expert) -- (init);
- \path [dashed] (system) -- (init);
- \path [dashed] (system) |- (evaluate);
+ \path (init) -- (identify);
+ \path (identify) -- (evaluate);
+ \path (evaluate) -- (decide);
+ \path (update) |- (identify);
+ \path (decide) -| node [near start] {yes} (update);
+ \path (decide) -- node [midway] {no} (stop);
+ \path [dashed] (expert) -- (init);
+ \path [dashed] (system) -- (init);
+ \path [dashed] (system) |- (evaluate);
\end{scope}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
index 700d15208e2..77726100290 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
@@ -8,6 +8,7 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
\section{Syntax for Path Specifications}
+\label{section-paths}
A \emph{path} is a series of straight and curved line segments. It is
specified following a |\path| command and the specification must
@@ -59,7 +60,7 @@ present section.
the path always applies to all parts of the path. If several
different colors are given for different parts of the path, only
the last one (on the outermost scope) ``wins'':
-
+
\begin{codeexample}[]
\tikz \draw (0,0) -- (1,1)
[color=red] -- (2,0) -- (3,1)
@@ -77,13 +78,13 @@ present section.
By default, the |\path| command does ``nothing'' with the
path, it just ``throws it away.'' Thus, if you write
- |\path(0,0)--(1,1);|, nothing is drawn
+ |\path(0,0)--(1,1);|, nothing is drawn
in your picture. The only effect is that the area occupied by the
picture is (possibly) enlarged so that the path fits inside the
area. To actually ``do'' something with the path, an option like
|draw| or |fill| must be given somewhere on the path. Commands like
|\draw| do this implicitly.
-
+
Finally, it is also possible to give \emph{node specifications} on a
path. Such specifications can come at different locations, but they
are always allowed when a normal path operation could follow. A node
@@ -97,8 +98,8 @@ present section.
specified by the path options (like filling and drawing the path due
to a |fill| and a |draw| option somewhere in the
\meta{specification}), the nodes are added in a post-processing
- step.
-
+ step.
+
The following style influences scopes:
\begin{stylekey}{/tikz/every path (initially \normalfont empty)}
This style is installed at the beginning of every path. This can
@@ -117,6 +118,44 @@ present section.
\end{command}
+\begin{key}{/tikz/insert path=\meta{path}}
+ This key can be used inside an option to add something to the
+ current path. This is mostly useful for defining styles that create
+ graphic contents. This option should be used with care, for instance
+ it should not be used as an argument of, say, a |node|. In the
+ following example, we use a style to add little circles to a path.
+\begin{codeexample}[]
+\tikz [c/.style={insert path={circle[radius=2pt]}}]
+ \draw (0,0) -- (1,1) [c] -- (3,2) [c];
+\end{codeexample}
+ The effect is the same as of
+ |(0,0) -- (1,1) circle[radius=2pt] -- (3,2) circle[radius=2pt]|.
+\end{key}
+
+The following options are for experts only:
+
+\begin{key}{/tikz/append after command=\meta{path}}
+ Some of the path commands described in the following sections take
+ optional arguments. For these commands, when you use this key inside
+ these options, the \meta{path} will be inserted \emph{after} the
+ path command is done. For instance, when you give this command in
+ the option list of a node, the \meta{path} will be added after the
+ node. This is used by, for instance, the |label| option to allow you
+ to specify a label in the option list of a node, but have this
+ |label| cause a node to be added after another node.
+\begin{codeexample}[]
+\tikz \draw node [append after command={(foo)--(1,1)},draw] (foo){foo};
+\end{codeexample}
+ If this key is called multiple times, the effects accumulate, that
+ is, all of the paths are added in the order to keys were found.
+\end{key}
+
+\begin{key}{/tikz/prefix after command=\meta{path}}
+ Works like |append after command|, only the accumulation order is
+ inverse: The \meta{path} is added before any earlier paths added
+ using either |append after command| or |prefix after command|.
+\end{key}
+
\subsection{The Move-To Operation}
@@ -129,7 +168,7 @@ expected.
\index{empty@\protect\meta{empty} path operation}%
\index{Path operations!empty@\protect\texttt{\meta{empty}}}%
The move-to operation normally starts a path at a certain
- point. This does not cause a line segment to be created, but it
+ point. This does not cause a line segment to be created, but it
specifies the starting point of the next segment. If a path is
already under construction, that is, if several segments have
already been created, a move-to operation will start a new part of the
@@ -191,6 +230,7 @@ construction operations.
\begin{pathoperation}[noindex]{-|}{\meta{coordinate}}
\index{--1@\protect\texttt{-\protect\pgfmanualbar} path operation}%
\index{Path operations!--1@\protect\texttt{-\protect\pgfmanualbar}}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{-|}{}%
This operation means ``first horizontal, then vertical.''
\begin{codeexample}[]
@@ -204,6 +244,7 @@ construction operations.
\begin{pathoperation}[noindex]{|-}{\meta{coordinate}}
\index{--2@\protect\texttt{\protect\pgfmanualbar-} path operation}%
\index{Path operations!--2@\protect\texttt{\protect\pgfmanualbar-}}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{|-}{}%
This operations means ``first vertical, then horizontal.''
\end{pathoperation}
}
@@ -217,7 +258,7 @@ curve.
\begin{pathoperation}{..}{\declare{|controls|}\meta{c}\opt{|and|\meta{d}}\declare{|..|\meta{y}}}
This operation extends the current path from the current
point, let us call it $x$, via a curve to a the current point~$y$.
- The curve is a cubic Bézier curve. For such a curve,
+ The curve is a cubic Bézier curve. For such a curve,
apart from $y$, you also specify two control points $c$ and $d$. The
idea is that the curve starts at $x$, ``heading'' in the direction
of~$c$. Mathematically spoken, the tangent of the curve at $x$ goes
@@ -301,7 +342,7 @@ influenced by the following option:
\begin{key}{/tikz/rounded corners=\meta{inset} (default 4pt)}
When this option is in force, all corners (places where a line is
continued either via line-to or a curve-to operation) are replaced by
- little arcs so that the corner becomes smooth.
+ little arcs so that the corner becomes smooth.
\begin{codeexample}[]
\tikz \draw [rounded corners] (0,0) -- (1,1)
@@ -310,11 +351,11 @@ influenced by the following option:
The \meta{inset} describes how big the corner is. Note that the
\meta{inset} is \emph{not} scaled along if you use a scaling option
- like |scale=2|.
+ like |scale=2|.
\begin{codeexample}[]
\begin{tikzpicture}
- \draw[color=gray,very thin] (10pt,15pt) circle (10pt);
+ \draw[color=gray,very thin] (10pt,15pt) circle[radius=10pt];
\draw[rounded corners=10pt] (0,0) -- (0pt,25pt) -- (40pt,25pt);
\end{tikzpicture}
\end{codeexample}
@@ -342,80 +383,175 @@ Here is a rectangle with rounded corners:
corner will still be round, but ``not as nice.''
Second, if there are very short line segments in a path, the
- ``rounding'' may cause inadverted effects. In such case it may be
+ ``rounding'' may cause inadvertent effects. In such case it may be
necessary to temporarily switch off the rounding using
- |sharp corners|.
+ |sharp corners|.
\end{key}
\begin{key}{/tikz/sharp corners}
This options switches off any rounding on subsequent corners of the
- path.
+ path.
\end{key}
\subsection{The Circle and Ellipse Operations}
-A circle can be approximated well using four Bézier curves. However,
-it is difficult to do so correctly. For this reason, a special syntax
-is available for adding such an approximation of a circle to the
-current path.
+Circles and ellipses are common path elements for which there is a
+special path operation.
+
+\begin{pathoperation}{circle}{\opt{|[|\meta{options}|]|}}
+ This command adds a circle to the current path where the center of
+ the circle is the current point by default, but you can use the |at|
+ option to change this. The new current point of the path
+ will be (typically just remain) the center of the circle.
+
+ The radius of the circle is specified using the following options:
+ \begin{key}{/tikz/x radius=\meta{value}}
+ Sets the horizontal radius of the circle (which, when this value
+ is different form the vertical radius, is actually an
+ ellipse). The \meta{value} may either be a dimension or a
+ dimensionless number. In the latter case, the number is
+ interpreted in the $xy$-coordinate system (if the $x$-unit is set
+ to, say, |2cm|, then |x radius=3| will have the same effect as
+ |x radius=6cm|).
+ \end{key}
+ \begin{key}{/tikz/y radius=\meta{value}}
+ Works like the |x radius|.
+ \end{key}
+ \begin{key}{/tikz/radius=\meta{value}}
+ Sets the |x radius| and |y radius| simultaneously.
+ \end{key}
+ \begin{key}{/tikz/at=\meta{coordinate}}
+ If this option is explicitly set inside the \meta{options} (or
+ indirectly via the |every circle| style), the \meta{coordinate} is
+ used as the center of the circle instead of the current
+ point. Setting |at| to some value in an enclosing scope has no
+ effect.
+ \end{key}
+ The \meta{options} may also contain additional options like, say, a
+ |rotate| or |scale|, that will only have an effect on the circle.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw (1,0) circle [radius=1.5];
+ \fill (1,0) circle [x radius=1cm, y radius=5mm, rotate=30];
+\end{tikzpicture}
+\end{codeexample}
+
+ It is possible to set the |radius| also in some enclosing scope, in
+ this case the options can be left out (but see the note below on
+ what may follow:
+\begin{codeexample}[]
+\begin{tikzpicture}[radius=2pt]
+ \draw (0,0) circle -- (1,1) circle -- ++(0,1) circle;
+\end{tikzpicture}
+\end{codeexample}
-\begin{pathoperation}{circle}{|(|\meta{radius}|)|}
- The center of the circle is given by the current point. The new
- current point of the path will remain to be the center of the
- circle.
-\end{pathoperation}
+ The following style is used with every circle:
+ \begin{stylekey}{/tikz/every circle}
+ You can use this key to setup, say, a default radius for every
+ circle. The key will also be used with the |ellipse| operation.
+ \end{stylekey}
-\begin{pathoperation}{ellipse}{|(|\meta{half width}| and |\meta{half height}|)|}
- Note that you can add spaces after |ellipse|, but you have to place
- spaces around |and|.
+ In case you feel that the names |radius| and |x radius| are too long
+ for your taste, you can easily created shorter aliases:
+\begin{codeexample}[code only]
+\tikzset{r/.style={radius=#1},rx/.style={x radius=#1},ry/.style={y radius=#1}}
+\end{codeexample}
+ You can then say |circle [r=1cm]| or |circle [rx=1,ry=1.5]|. The
+ reason \tikzname\ uses the longer names by default is that it
+ encourages people to write more readable code.
+
+ \emph{Note:} There also exists an older syntax for circles, where
+ the radius of the circle is given in parentheses right after the
+ |circle| command as in |circle (1pt)|. Although this syntax is a bit
+ more succinct, it is harder to understand for readers of the code
+ and the use of parentheses for something other than a coordinate is
+ ill-chosen.
+
+ \tikzname\ will use the following rule to determine whether the old
+ or the normal syntax is used: If |circle| is directly followed by
+ something that (expands to) an opening parenthesis, then the old
+ syntax is used and inside these following parentheses there must be
+ a single number or dimension representing a radius. In all other
+ cases the new syntax is used.
+\end{pathoperation}
+\begin{pathoperation}{ellipse}{|[|\meta{options}|]|}
+ This command has exactly the same effect as |circle|. The older
+ syntax for this command is |ellipse (|\meta{x radius} |and| \meta{y
+ radius}|)|. As for the |circle| command, this syntax is not as
+ good as the standard syntax.
\begin{codeexample}[]
\begin{tikzpicture}
- \draw (1,0) circle (.5cm);
- \draw (3,0) ellipse (1cm and .5cm) -- ++(3,0) circle (.5cm)
- -- ++(2,-.5) circle (.25cm);
+ \draw [help lines] (0,0) grid (3,2);
+ \draw (1,1) ellipse [x radius=1cm,y radius=.5cm];
\end{tikzpicture}
\end{codeexample}
\end{pathoperation}
+
\subsection{The Arc Operation}
The \emph{arc operation} allows you to add an arc to the current
path.
-\begin{pathoperation}{arc}{|(|\meta{start angle}|:|\meta{end
- angle}|:|\meta{radius}\opt{| and |\meta{half height}}|)|}
- The arc operation adds a part of a circle of the given radius
- between the given angles. The arc will start at the current point
- and will end at the end of the arc.
+\begin{pathoperation}{arc}{\oarg{options}}
+ The |arc| operation adds a part of an ellipse to the current
+ path. The radii of the ellipse are given by the values of |x radius|
+ and |y radius|, which should be set in the \meta{options}. The arc
+ will start at the current point and will end at the end of the
+ arc. The arc will start and end at angles computed from the three
+ keys |start angle|, |end angle|, and |delta angle|. Normally, the
+ first two keys specify the start and end angle. However, in case one
+ of them is empty, it is computed from the other key plus or minus
+ the |delta angle|. In detail, if |end angle| is empty, it is set to
+ the start angle plus the delta angle. If the start angle is missing,
+ it is set to the end angle minus the delta angle. If all three keys
+ are set, the delta angle is ignored.
+ \begin{key}{/tikz/start angle=\meta{degrees}}
+ Sets the start angle.
+ \end{key}
+ \begin{key}{/tikz/end angle=\meta{degrees}}
+ Sets the end angle.
+ \end{key}
+ \begin{key}{/tikz/delta angle=\meta{degrees}}
+ Sets the delta angle.
+ \end{key}
\begin{codeexample}[]
-\begin{tikzpicture}
- \draw (0,0) arc (180:90:1cm) -- (2,.5) arc (90:0:1cm);
- \draw (4,0) -- +(30:1cm) arc (30:60:1cm) -- cycle;
- \draw (8,0) arc (0:270:1cm and .5cm) -- cycle;
+\begin{tikzpicture}[radius=1cm]
+ \draw (0,0) arc[start angle=180, end angle=90]
+ -- (2,.5) arc[start angle=90, delta angle=-90];
+ \draw (4,0) -- +(30:1cm)
+ arc [start angle=30, delta angle=30] -- cycle;
+ \draw (8,0) arc [start angle=0, end angle=270,
+ x radius=1cm, y radius=5mm] -- cycle;
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}[radius=1cm,delta angle=30]
\draw (-1,0) -- +(3.5,0);
\draw (1,0) ++(210:2cm) -- +(30:4cm);
- \draw (1,0) +(0:1cm) arc (0:30:1cm);
- \draw (1,0) +(180:1cm) arc (180:210:1cm);
+ \draw (1,0) +(0:1cm) arc [start angle=0];
+ \draw (1,0) +(180:1cm) arc [start angle=180];
\path (1,0) ++(15:.75cm) node{$\alpha$};
\path (1,0) ++(15:-.75cm) node{$\beta$};
\end{tikzpicture}
\end{codeexample}
+
+ There also exists a shorter syntax for the arc operation, namely
+ |arc| begin directly followed by |(|\meta{start angle}|:|\meta{end
+ angle}|:|\meta{radius}). However, this syntax is harder to read,
+ so the normal syntax should be preferred in general.
\end{pathoperation}
\subsection{The Grid Operation}
You can add a grid to the current path using the |grid| path
-operation.
+operation.
\begin{pathoperation}{grid}{\opt{\oarg{options}}\meta{corner}}
This operations adds a grid filling a rectangle whose two corners
@@ -431,7 +567,7 @@ operation.
The \meta{options}, which are local to the |grid| operation, can be
used to influence the appearance of the grid. The stepping of the
- grid is governed by the following options:
+ grid is governed by the following options:
\begin{key}{/tikz/step=\meta{number or dimension or coordinate}
(initially 1cm)}
@@ -451,10 +587,10 @@ operation.
\draw[red] (0,0) grid [step=.75cm] (3,2);
\end{tikzpicture}
\begin{tikzpicture}
- \draw (0,0) circle (1);
+ \draw (0,0) circle [radius=1];
\draw[blue] (0,0) grid [step=(45:1)] (3,2);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
A complication arises when the $x$- and/or $y$-vector do not point
along the axes. Because of this, the actual rule for computing the
@@ -463,18 +599,18 @@ operation.
vectors: The first vector is either $(\meta{x-grid-step-number},0)$
or $(\meta{x-grid-step-dimension},0\mathrm{pt})$, the second vector
is $(0,\meta{y-grid-step-number})$ or
- $(0\mathrm{pt},\meta{x-grid-step-dimension})$.
-\end{key}
+ $(0\mathrm{pt},\meta{x-grid-step-dimension})$.
+\end{key}
\begin{key}{/tikz/xstep=\meta{dimension or number} (initially 1cm)}
- Sets the stepping in the $x$-direction.
+ Sets the stepping in the $x$-direction.
\begin{codeexample}[]
\tikz \draw (0,0) grid [xstep=.5,ystep=.75] (3,2);
\end{codeexample}
\end{key}
\begin{key}{/tikz/ystep=\meta{dimension or number} (initially 1cm)}
- Sets the stepping in the $y$-direction.
+ Sets the stepping in the $y$-direction.
\end{key}
It is important to note that the grid is always ``phased'' such that
@@ -511,7 +647,7 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);.
This operation adds a parabola through the current point and the
given \meta{coordinate}. If the |bend| is given, it specifies where
the bend should go; the \meta{options} can also be used to specify
- where the bend is. By default, the bend is at the old current point.
+ where the bend is. By default, the bend is at the old current point.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -567,7 +703,7 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);.
option:
\begin{key}{/tikz/parabola height=\meta{dimension}}
This option has the same effect as
- |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|.
+ |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -627,6 +763,43 @@ Note that there is no way to (conveniently) draw an interval on a sine
or cosine curve whose end points are not multiples of $\pi/2$.
+\subsection{The SVG Operation}
+
+The |svg| operation can be used to extend the current path by a path
+given in the \textsc{svg} path data syntax. This syntax is described
+in detail in Section 8.3 of the \textsc{svg 1.1} specification, please
+consult this specification for details.
+
+\begin{pathoperation}{svg}{\opt{\oarg{options}}|"|\meta{path data}|"|}
+ This operation adds the path specified in the \meta{path data} in
+ \textsc{svg 1.1 path data} syntax to the current path. Unlike the
+ \textsc{svg}-specification, it \emph{is} permissible that the path
+ data does not start with a moveto command (|m| or |M|), in which
+ case the last point of the current path is used as start point.
+ The optional \meta{options} apply locally to this path operation,
+ typically you will use them to setup, say, some transformations.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \filldraw [fill=red!20] (0,1) svg[scale=2] "h 10 v 10 h -10"
+ node [above left] {upper left} -- cycle;
+
+ \draw svg "M 0 0 L 20 20 h 10 a 10 10 0 0 0 -20 0";
+\end{tikzpicture}
+\end{codeexample}
+
+ An \textsc{svg} coordinate like |10 20| is always interpreted as
+ |(10pt,20pt)|, so the basic unit is always points (|pt|). The
+ $xy$-coordinate system is not used. However, you can use scaling to
+ (locally) change the basic unit. For instance, |svg[scale=1cm]|
+ (yes, this works, although some rather evil magic is involved) will
+ cause 1cm to be the basic unit.
+
+ \emph{Warning:} The arc operations (|a| and |A|) are not numerically
+ stable. This means that they will be quite imprecise, except when
+ the angle is a multiple of $90^\circ$ (as is, fortunately, most
+ often the case).
+\end{pathoperation}
\subsection{The Plot Operation}
@@ -647,7 +820,7 @@ to |b|, exactly as if you had written |(a) -- (b)|. However, if you
write |(a) to [out=135,in=45] (b)| a curve is added to the path,
which leaves at an angle of 135$^\circ$ at |a| and arrives at an angle
of 45$^\circ$ at |b|. This is because the options |in| and |out|
-trigger a special path to be used instead of the straight line.
+trigger a special path to be used instead of the straight line.
\begin{pathoperation}{to}{\opt{|[|\meta{options}|]|}
\opt{\meta{nodes}} |(|\meta{coordinate}|)|}
@@ -655,15 +828,15 @@ trigger a special path to be used instead of the straight line.
This path operation inserts the path current set via the |to path|
option at the current position. The \meta{options} can be used to
modify (perhaps implicitly) the |to path| and to setup how the path
- will be rendered.
+ will be rendered.
Before the |to path| is inserted, a number of macros are setup that
can ``help'' the |to path|. These are |\tikztostart|,
|\tikztotarget|, and |\tikztonodes|; they are explained in the
- following.
-
+ following.
+
\medskip
- \textbf{Start and Target Coordinates.}\ \
+ \textbf{Start and Target Coordinates.}\ \
The |to| operation is always followed by a \meta{coordinate}, called
the target coordinate. The macro |\tikztotarget| is set to this
coordinate (without the parentheses). There is also a \emph{start
@@ -673,11 +846,11 @@ trigger a special path to be used instead of the straight line.
macro |\tikztostart| is |0pt,0pt| and the |\tikztotarget| is
|0,2|. For the second |to|, the macro |\tikztostart| is |10pt,10pt|
and |\tikztotarget| is |a|.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
-
+
\draw (0,0) to (0,2);
\node (a) at (2,2) {a};
\draw[red] (10pt,10pt) to (a);
@@ -690,11 +863,11 @@ trigger a special path to be used instead of the straight line.
It is possible to add nodes to the paths constructed by a |to|
operation. To do so, you specify the nodes between the |to|
keyword and the coordinate (if there are options to the |to|
- operation, these come first). The effect of |(a) to node {x} (b)|
+ operation, these come first). The effect of |(a) to node {x} (b)|
(typically) is the same as if you had written
|(a) -- node {x} (b)|, namely that the node is placed on the
- to. This can be used to add labels to tos:
-
+ to. This can be used to add labels to tos:
+
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) to node [sloped,above] {x} (3,2);
@@ -704,23 +877,22 @@ trigger a special path to be used instead of the straight line.
\end{codeexample}
\medskip
- \textbf{Styles for nodes.}\ \
+ \textbf{Styles for to-paths.}\ \
In addition to the \meta{options} given after the |to| operation,
the following style is also set at the beginning of the to path:
\begin{stylekey}{/tikz/every to (initially \normalfont empty)}
- This style is installed at the beginning of every to. By
- default, it is set to |draw|.
+ This style is installed at the beginning of every to.
\begin{codeexample}[]
-\tikz[every to/.style={draw,dashed}]
- \path (0,0) to (3,2);
+\tikz[every to/.style={bend left}]
+ \draw (0,0) to (3,2);
\end{codeexample}
\end{stylekey}
\medskip
- \textbf{Options.}\ \
+ \textbf{Options.}\ \
The \meta{options} given with the |to| allow you to influence the
appearance of the |to path|. Mostly, these options are used to
- change the |to path|. This can be used to change the path from a
+ change the |to path|. This can be used to change the path from a
straight line to, say, a curve.
The path used is set using the following option:
@@ -729,9 +901,9 @@ trigger a special path to be used instead of the straight line.
inserted. More precisely, the following path is added:
\begin{quote}
- |[every to,|\meta{options}|] |\meta{path}
+ |{[every to,|\meta{options}|] |\meta{path} |}|
\end{quote}
-
+
The \meta{options} are the options given to the |to| operation,
the \meta{path} is the path set by this option |to path|.
@@ -743,7 +915,7 @@ trigger a special path to be used instead of the straight line.
\item \declare{|\tikztotarget|} will expand to the to-coordinate.
\item \declare{|\tikztonodes|} will expand to the nodes between
the |to| operation and the coordinate. Furthermore, these
- nodes will have the |pos| option set implicitly.
+ nodes will have the |pos| option set implicitly.
\end{itemize}
Let us have a look at a simple example. The standard straight line
@@ -772,7 +944,7 @@ trigger a special path to be used instead of the straight line.
Now let us have a look at how we can modify the \meta{path}
sensibly. The simplest way is to use a curve.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[to path={
.. controls +(1,0) and +(1,0) .. (\tikztotarget) \tikztonodes}]
@@ -780,7 +952,7 @@ trigger a special path to be used instead of the straight line.
\node (a) at (0,0) {a};
\node (b) at (2,1) {b};
\node (c) at (1,2) {c};
-
+
\draw (a) to node {x} (b)
(a) to (c);
\end{tikzpicture}
@@ -790,16 +962,16 @@ trigger a special path to be used instead of the straight line.
\begin{codeexample}[]
\tikzset{
- my loop/.style={->,to path={
+ my loop/.style={to path={
.. controls +(80:1) and +(100:1) .. (\tikztotarget) \tikztonodes}},
my state/.style={circle,draw}}
-
+
\begin{tikzpicture}[shorten >=2pt]
\node [my state] (a) at (210:1) {$q_a$};
\node [my state] (b) at (330:1) {$q_b$};
-
- \draw (a) to node[below] {1} (b)
- to [my loop] node[above right] {0} (b);
+
+ \draw[->] (a) to node[below] {1} (b)
+ to [my loop] node[above right] {0} (b);
\end{tikzpicture}
\end{codeexample}
@@ -809,9 +981,10 @@ trigger a special path to be used instead of the straight line.
computations.
\end{key}
- \begin{key}{/tikz/executed at end to=\meta{code}}
+ \begin{key}{/tikz/execute at end to=\meta{code}}
Works like the previous option, only this code is executed after
the to path has been added.
+ % FIXME : provide examples...
\end{key}
@@ -834,7 +1007,7 @@ local, effects.
\begin{pathoperation}{let}{\meta{assignment}
\opt{|,|\meta{assignment}}%
\opt{|,|\meta{assignment}\dots}\declare{| in |}}
- When this path operation is encountered, the \meta{assignment}s are
+ When this path operation is encountered, the \meta{assignment}s are
evaluated, one by one. This will store coordinate and number in
special \emph{registers} (which are local to \tikzname, they have
nothing to do with \TeX\ registers). Subsequently, one can access the
@@ -853,7 +1026,7 @@ local, effects.
the resulting dimension with a trailing |pt|. A \meta{number register} can
be named arbitrarily and is a normal \TeX\ parameter to the |\n|
macro. Possible names are |{left corner}|, but also just a single
- digit like~|5|.
+ digit like~|5|.
Let us call the path that follows a let operation its
\emph{body}. Inside the body, the |\n| macro can be used to access
@@ -871,7 +1044,7 @@ local, effects.
|\n2| expands to |3|.
\end{command}
- The second kind of \meta{assignements} have the following form:
+ The second kind of \meta{assignments} have the following form:
\begin{quote}
|\p|\meta{point register}|={|\meta{formula}|}|
\end{quote}
@@ -895,7 +1068,7 @@ local, effects.
|=|-sign or in the body of the let operation, then it expands to
the $x$-part (measured in \TeX\ points) of the coordinate stored
in the \meta{register}, followed, by a comma, followed by the
- $y$-part.
+ $y$-part.
For instance, if we say |let \p1=(1pt,1pt+2pt) in ...|, then
inside the |...| part the macro |\p1| will expand to exactly the
@@ -913,7 +1086,7 @@ local, effects.
Works like |\x|, only for the $y$-part.
\end{command}
Note that the above macros are available only inside a let
- operation.
+ operation.
Here is an example where let clauses are used to assemble a coordinate
from the $x$-coordinate of a first point and the $y$-coordinate of a
@@ -928,7 +1101,7 @@ local, effects.
\fill[red] let \p1 = (first point),
\p2 = (second point) in
- (\x1,\y2) circle (2pt);
+ (\x1,\y2) circle [radius=2pt];
\end{tikzpicture}
\end{codeexample}
@@ -948,9 +1121,9 @@ local, effects.
coordinate (p1) at (\p1)
coordinate (p2) at (\p2)
coordinate (center) at (\p{center});
-
+
\draw (p1) -- (p2);
- \fill[red] (center) circle (2pt);
+ \fill[red] (center) circle [radius=2pt];
\end{tikzpicture}
\end{codeexample}
@@ -968,7 +1141,7 @@ local, effects.
\draw let \p1 = ($ (a)!(c)!(b) - (c) $),
\n1 = {veclen(\x1,\y1)}
- in (c) circle (\n1);
+ in circle [at=(c), radius=\n1];
\end{tikzpicture}
\end{codeexample}
\end{pathoperation}
@@ -993,8 +1166,8 @@ please see Section~\ref{section-scopes-relative}.
There are two more operations that can be found in paths:
|node| and |edge|. The first is used to add a so-called node to a
-path. This operation is special in the following sense: It does not
-change the current path in any way. In other words, this operation
+path. This operation is special in the following sense: It does not
+change the current path in any way. In other words, this operation
is not really a path operation, but has an effect that is
``external'' to the path. The |edge| operation has similar effect in
that it adds something \emph{after} the main path has been
@@ -1002,7 +1175,7 @@ drawn. However, it works like the |to| operation, that is, it adds a
|to| path to the picture after the main path has been drawn.
Since these operations are quite complex, they are described in the
-separate Section~\ref{section-nodes}.
+separate Section~\ref{section-nodes}.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
index b8fa8ed3588..00f8d874b6c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
@@ -49,7 +49,7 @@ and energy into mastering the \pgfname\ commands for creating plots:
in the plot and sizes in the text.
\item
The automatic grid generated by most programs is mostly
- distracting.
+ distracting.
\item
The automatic ticks generated by most programs are cryptic
numerics. (Try adding a tick reading ``$\pi$'' at the right point.)
@@ -156,8 +156,7 @@ The file |plots/pgfmanual-sine.table| reads:
\end{codeexample}
It was produced from the following source, using |gnuplot|:
\begin{codeexample}[code only]
-set terminal table
-set output "../plots/pgfmanual-sine.table"
+set table "../plots/pgfmanual-sine.table"
set format "%.5f"
set samples 20
plot [x=0:10] sin(x)
@@ -189,7 +188,7 @@ option. The \meta{coordinate expression} is then evaluated for
different values for |\x| and the resulting coordinates are plotted.
Note that you will often have to put the $x$- or $y$-coordinate inside
-braces, namely whenever you use an expression involving a paranthesis.
+braces, namely whenever you use an expression involving a parenthesis.
The following options influence how the \meta{coordinate expression}
is evaluated:
@@ -221,10 +220,10 @@ is evaluated:
\begin{codeexample}[]
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
-
+
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
-
+
\draw[color=red] plot (\x,\x) node[right] {$f(x) =x$};
\draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$};
\draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
@@ -254,17 +253,20 @@ easily produce the necessary points. Currently, \tikzname\ knows how to
call \textsc{gnuplot}.
When \tikzname\ encounters your operation
-|plot[id=|\meta{id}|] function{x*sin(x)}| for
+|plot[id=|\meta{id}|] function{x*sin(x)}| for
the first time, it will create a file called
\meta{prefix}\meta{id}|.gnuplot|, where \meta{prefix} is |\jobname.| by
default, that is, the name of you main |.tex| file. If no \meta{id} is
given, it will be empty, which is alright, but it is better when each
plot has a unique \meta{id} for reasons explained in a moment. Next,
\tikzname\ writes some initialization code into this file followed by
-|plot x*sin(x)|. The initialization code sets up things
+|plot x*sin(x)|. The initialization code sets up things
such that the |plot| operation will write the coordinates into another
file called \meta{prefix}\meta{id}|.table|. Finally, this table file
-is read as if you had said |plot file{|\meta{prefix}\meta{id}|.table}|.
+is read as if you had said |plot file{|\meta{prefix}\meta{id}|.table}|. However,
+there is just one difference: |gnuplot| supports a ``type'' field following
+the coordinates. If this type field contains `|u|' which means unbounded, \tikzname\ will
+ignore the complete coordinate\footnote{Thanks to Andy Schlaikjer for this patch.}.
For the plotting mechanism to work, two conditions must be met:
\begin{enumerate}
@@ -293,7 +295,7 @@ graphic for the second time: If upon reaching
already exists \emph{and} if the \meta{prefix}\meta{id}|.gnuplot| file
contains what \tikzname\ thinks that it ``should'' contain, the |.table|
file is immediately read without trying to call a |gnuplot|
-program. This approach has the following advantages:
+program. This approach has the following advantages:
\begin{enumerate}
\item
If you pass a bundle of your |.tex| file and all |.gnuplot| and
@@ -329,10 +331,10 @@ plots, use |t| as the variable for parametric plots. Here are some examples:
\begin{codeexample}[]
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
-
+
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
-
+
\draw[color=red] plot[id=x] function{x} node[right] {$f(x) =x$};
\draw[color=blue] plot[id=sin] function{sin(x)} node[right] {$f(x) = \sin x$};
\draw[color=orange] plot[id=exp] function{0.05*exp(x)} node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
@@ -344,7 +346,7 @@ The plot in influenced by the following options: First, the options
|samples| and |domain| explained earlier. Second, there are some more
specialized options.
-\begin{key}{/tikz/parametric=\meta{boolena} (default true)}
+\begin{key}{/tikz/parametric=\meta{boolean} (default true)}
Sets whether the plot is a parametric plot. If true, then |t| must
be used instead of |x| as the parameter and two comma-separated
functions must be given in the \meta{gnuplot formula}. An example is
@@ -365,7 +367,7 @@ specialized options.
\begin{key}{/tikz/prefix=\meta{prefix}}
The \meta{prefix} is put before each plot file name. The default is
- |\jobname.|, but
+ |\jobname.|, but
if you have many plots, it might be better to use, say |plots/| and
have all plots placed in a directory. You have to create the
directory yourself.
@@ -378,7 +380,7 @@ specialized options.
\begin{codeexample}[code only]
plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)}
\end{codeexample}
- This can be
+ This can be
useful for complicated things that need to be passed to
\textsc{gnuplot}. However, for really complicated situations you
should create a special external generating \textsc{gnuplot} file
@@ -386,7 +388,7 @@ plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)}
\end{key}
The following styles influence the plot:
-\begin{stylekey}{/tikz/every plot (initially \normalfont empyt)}
+\begin{stylekey}{/tikz/every plot (initially \normalfont empty)}
This style is installed in each plot, that is, as if you always said
\begin{codeexample}[code only]
plot[every plot,...]
@@ -405,14 +407,14 @@ As we saw already, it is possible to add \emph{marks} to a plot using
the |mark| option. When this option is used, a copy of the plot
mark is placed on each point of the plot. Note that the marks are
placed \emph{after} the whole path has been drawn/filled/shaded. In
-this respect, they are handled like text nodes.
+this respect, they are handled like text nodes.
In detail, the following options govern how marks are drawn:
\begin{key}{/tikz/mark=\meta{mark mnemonic}}
Sets the mark to a mnemonic that has previously been defined using
the |\pgfdeclareplotmark|. By default, |*|, |+|, and |x| are available,
which draw a filled circle, a plus, and a cross as marks. Many more
- marks become available when the library |pgflibraryplotmarks| is
+ marks become available when the library |plotmarks| is
loaded. Section~\ref{section-plot-marks} lists the available plot
marks.
@@ -420,7 +422,7 @@ In detail, the following options govern how marks are drawn:
it \tikzname. The |ball color| determines the balls's color. Do not use
this option with a large number of marks since it will take very long
to render in PostScript.
-
+
\begin{tabular}{lc}
Option & Effect \\\hline \vrule height14pt width0pt
\plotmarkentrytikz{ball}
@@ -430,7 +432,7 @@ In detail, the following options govern how marks are drawn:
\begin{key}{/tikz/mark repeat=\meta{r}}
This option tells \tikzname\ that only every $r$th mark should be
drawn.
-
+
\begin{codeexample}[]
\tikz \draw plot[mark=x,mark repeat=3,smooth] file {plots/pgfmanual-sine.table};
\end{codeexample}
@@ -440,7 +442,7 @@ In detail, the following options govern how marks are drawn:
This option tells \tikzname\ that the first mark to be draw should
be the $p$th, followed by the $(p+r)$th, then the $(p+2r)$th, and so
on.
-
+
\begin{codeexample}[]
\tikz \draw plot[mark=x,mark repeat=3,mark phase=6,smooth] file {plots/pgfmanual-sine.table};
\end{codeexample}
@@ -450,7 +452,7 @@ In detail, the following options govern how marks are drawn:
This option allows you to specify explicitly the indices at which a
mark should be placed. Counting starts with 1. You can use the
|\foreach| syntax, that is, |...| can be used.
-
+
\begin{codeexample}[]
\tikz \draw plot[mark=x,mark indices={1,4,...,10,11,12,...,16,20},smooth]
file {plots/pgfmanual-sine.table};
@@ -465,23 +467,34 @@ In detail, the following options govern how marks are drawn:
This option is not really necessary, since you achieve the same
effect by specifying |scale=|\meta{factor} as a local option, where
\meta{factor} is the quotient of the desired size and the default
- size. However, using |mark size| is a bit faster and more natural.
+ size. However, using |mark size| is a bit faster and more natural.
\end{key}
-\begin{key}{/tikz/mark options=\meta{options}}
- These options are applied to marks when they are drawn. For example,
+\begin{stylekey}{/tikz/every mark}
+ This style is installed before drawing plot marks. For example,
you can scale (or otherwise transform) the plot mark or set its
- color.
+ color.
+\end{stylekey}
+
+\begin{key}{/tikz/mark options=\meta{options}}
+ Redefines |every mark| such that it sets \marg{options}.
\begin{codeexample}[]
\tikz \fill[fill=blue!20]
plot[mark=triangle*,mark options={color=blue,rotate=180}]
file{plots/pgfmanual-sine.table} |- (0,0);
\end{codeexample}
\end{key}
+
+\begin{stylekey}{/tikz/no marks}
+ Disables markers (the same as |mark=none|).
+\end{stylekey}
+\begin{stylekey}{/tikz/no markers}
+ Disables markers (the same as |mark=none|).
+\end{stylekey}
-\subsection{Smooth Plots, Sharp Plots, and Comb Plots}
+\subsection{Smooth Plots, Sharp Plots, Jump Plots, Comb Plots and Bar Plots}
There are different things the |plot| operation can do with the points
it reads from a file or from the inlined list of points. By default,
@@ -514,7 +527,7 @@ use options to change the behavior of |plot|.
curves. A value of $1$ results in a circle if four points at
quarter-positions on a circle are given. The default is $0.55$. The
``correct'' value depends on the details of plot.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[smooth cycle]
\draw plot[tension=0.2]
@@ -529,7 +542,7 @@ use options to change the behavior of |plot|.
\begin{key}{/tikz/smooth cycle}
This option causes the points on the path to be connected using a
- closed smooth curve.
+ closed smooth curve.
\begin{codeexample}[]
\tikz[scale=0.5]
@@ -538,6 +551,45 @@ use options to change the behavior of |plot|.
\end{codeexample}
\end{key}
+\begin{key}{/tikz/const plot}
+ This option causes the points on the path to be connected using piecewise constant series of lines:
+
+\begin{codeexample}[]
+\tikz\draw plot[const plot] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/const plot mark left}
+ Just an alias for |/tikz/const plot|.
+\begin{codeexample}[]
+\tikz\draw plot[const plot mark left,mark=*] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/const plot mark right}
+ A variant of |/tikz/const plot| which places its mark on the right ends:
+\begin{codeexample}[]
+\tikz\draw plot[const plot mark right,mark=*] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+\end{key}
+
+
+\begin{key}{/tikz/jump mark left}
+ This option causes the points on the path to be drawn using piecewise constant, non-connected series of lines. If there are any marks, they will be placed on left open ends:
+
+\begin{codeexample}[]
+\tikz\draw plot[jump mark left, mark=*] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/jump mark right}
+ This option causes the points on the path to be drawn using piecewise constant, non-connected series of lines. If there are any marks, they will be placed on right open ends:
+
+\begin{codeexample}[]
+\tikz\draw plot[jump mark right, mark=*] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+\end{key}
+
\begin{key}{/tikz/ycomb}
This option causes the |plot| operation to interpret the plotting
points differently. Instead of connecting them, for each point of
@@ -560,7 +612,7 @@ use options to change the behavior of |plot|.
\begin{key}{/tikz/xcomb}
- This option works like |ycomb| except that the bars are horizontal.
+ This option works like |ycomb| except that the bars are horizontal.
\begin{codeexample}[]
\tikz \draw plot[xcomb,mark=x] coordinates{(1,0) (0.8,0.2) (0.6,0.4) (0.2,1)};
@@ -579,6 +631,57 @@ use options to change the behavior of |plot|.
\end{codeexample}
\end{key}
+\begin{key}{/tikz/ybar}
+ This option produces fillable bar plots. It is thus very similar to |ycomb|, but it employs rectangular shapes instead of line-to operations. It thus allows to use any fill- or pattern style.
+
+\begin{codeexample}[]
+\tikz\draw[draw=blue,fill=blue!60!black] plot[ybar] file{plots/pgfmanual-sine.table};
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[ybar]
+ \draw[color=red,fill=red!80,bar width=6pt]
+ plot coordinates{(0,1) (.5,1.2) (1,.6) (1.5,.7) (2,.9)};
+ \draw[color=red!50,fill=red!20,bar width=4pt,bar shift=3pt]
+ plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)};
+\end{tikzpicture}
+\end{codeexample}
+ The use of |bar width| and |bar shift| is explained in the plot handler library documentation, section~\ref{section-plotlib-bar-handlers}. Please refer to page~\pageref{key-bar-width}.
+\end{key}
+
+\begin{key}{/tikz/xbar}
+ This option works like |ybar| except that the bars are horizontal.
+
+\begin{codeexample}[]
+\tikz \draw[pattern=north west lines] plot[xbar]
+ coordinates{(1,0) (0.4,1) (1.7,2) (1.6,3)};
+\end{codeexample}
+\end{key}
+
+\begin{key}{/tikz/ybar interval}
+ As |/tikz/ybar|, this options produces vertical bars. However, bars are centered at coordinate \emph{intervals} instead of interval edges, and the bar's width is also determined relatively to the interval's length:
+
+\begin{codeexample}[]
+\begin{tikzpicture}[ybar interval,x=10pt]
+ \draw[color=red,fill=red!80]
+ plot coordinates{(0,2) (2,1.2) (3,.3) (5,1.7) (8,.9) (9,.9)};
+\end{tikzpicture}
+\end{codeexample}
+ Since there are $N$ intervals $[x_i,x_{i+1}]$ for given $N+1$ coordinates, you will always have one coordinate more than bars. The last $y$ value will be ignored.
+
+ You can configure relative shifts and relative bar width, which is explained in the plot handler library documentation, section~\ref{section-plotlib-bar-handlers}. Please refer to page~\pageref{key-bar-interval-width}.
+\end{key}
+
+\begin{key}{/tikz/xbar interval}
+ Works like |ybar interval|, but for horizontal bar plots.
+
+\begin{codeexample}[]
+\begin{tikzpicture}[xbar interval,x=0.5cm,y=0.5cm]
+ \draw[color=red,fill=red!80]
+ plot coordinates {(3,0) (2,1) (4,1.5) (1,4) (2,6) (2,7)};
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
\begin{key}{/tikz/only marks}
This option causes only marks to be shown; no path segments are
@@ -590,4 +693,3 @@ use options to change the behavior of |plot|.
plot[only marks,mark=x] coordinates{(0,0) (1,1) (2,0) (3,-1)};
\end{codeexample}
\end{key}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
index 85891e6d9de..063b4570a7e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
@@ -26,7 +26,7 @@ apply to everything within the environment.
\begin{package}{tikz}
This package does not have any options.
-
+
This will automatically load the \pgfname\ and the |pgffor| package.
\pgfname\ needs to know what \TeX\ driver you are intending to use. In
@@ -35,7 +35,7 @@ apply to everything within the environment.
situation where \pgfname\ cannot know the driver ``by itself'' is when
you use plain \TeX\ or Con\TeX t together with |dvipdfm|. In this case,
you have to write |\def\pgfsysdriver{pgfsys-dvipdfm.def}|
- \emph{before} you input |tikz.tex|.
+ \emph{before} you input |tikz.tex|.
\end{package}
@@ -45,7 +45,7 @@ apply to everything within the environment.
libraries separated by commas. Instead of curly braces, you can also
use square brackets, which is something Con\TeX t users will
like. If you try to load a library a second time, nothing will
- happen.
+ happen.
\example |\usetikzlibrary{arrows}|
@@ -66,7 +66,7 @@ apply to everything within the environment.
\subsubsection{Creating a Picture Using an Environment}
-The ``outermost'' scope of \tikzname\ is the |{tikzpicture}|
+The ``outermost'' scope of \tikzname\ is the |{tikzpicture}|
environment. You may give drawing commands only inside this
environment, giving them outside (as is possible in many other
packages) will result in chaos.
@@ -79,7 +79,7 @@ filenames of temporary files written while plotting functions using an
external program. The graphic options are specified in \emph{key
lists}, see Section~\ref{section-graphic-options} below for
details. All graphic options are local to the |{tikzpicture}| to which
-they apply.
+they apply.
\begin{environment}{{tikzpicture}\opt{\oarg{options}}}
All \tikzname\ commands should be given inside this
@@ -87,7 +87,7 @@ they apply.
packages, it is not possible to use, say, |\pgfpathmoveto| outside
this environment and doing so will result in chaos. For \tikzname,
commands like |\path| are only defined inside this environment, so
- there is little chance that you will do something wrong here.
+ there is little chance that you will do something wrong here.
When this environment is encountered, the \meta{options} are
parsed, see Section~\ref{section-graphic-options}. All options given
@@ -108,7 +108,7 @@ they apply.
then resizes the picture box such that the box has this size. To ``make its
guess,'' everytime \pgfname\ encounters a coordinate, it updates the
bounding box's size such that it encompasses all these
- coordinates. This will usually give a good
+ coordinates. This will usually give a good
approximation of the bounding box, but will not always be
accurate. First, the line thickness of diagonal lines is not taken
into account correctly. Second, controls points of a curve often lie far
@@ -117,7 +117,7 @@ they apply.
The following key influences the baseline of the resulting
picture:
- \begin{key}{/tikz/baseline=\meta{dimension or coordinate} (default 0pt)}
+ \begin{key}{/tikz/baseline=\meta{dimension or coordinate or \texttt{default}} (default 0pt)}
Normally, the lower end of the picture is put on the baseline of
the surrounding text. For example, when you give the code
|\tikz\draw(0,0)circle(.5ex);|, \pgfname\ will find out that the
@@ -137,7 +137,7 @@ $A \mathbin{\tikz[baseline] \draw[->>] (0pt,.5ex) -- (3ex,.5ex);} B$
\end{codeexample}
Instead of a \meta{dimension} you can also provide a coordinate in
- parantheses. Then the effect is to put the baseline on the
+ parentheses. Then the effect is to put the baseline on the
$y$-coordinate that the give \meta{coordinate} has \emph{at the
end of the picture}. This means that, at the end of the picture,
the \meta{coordinate} is evaluated and then the baseline is set
@@ -154,6 +154,8 @@ Top align:
\tikz[baseline=(current bounding box.north)]
\draw (0,0) rectangle (1cm,1ex);
\end{codeexample}
+
+ Use |baseline=default| to reset the |baseline| option to its initial configuration.
\end{key}
\begin{key}{/tikz/execute at begin picture=\meta{code}}
@@ -222,25 +224,23 @@ In other \TeX\ format, you should use instead the following commands:
\subsubsection{Creating a Picture Using a Command}
-The following two commands are used for ``small'' graphics.
-
-\begin{command}{\tikz\opt{\oarg{options}}\marg{commands}}
- This command places the \meta{commands} inside a
- |{tikzpicture}| environment and adds a semicolon at the end. This is
- just a convenience.
+The following command is an alternative to |{tikzpicture}| that is
+particular useful for graphics consisting of a single or few
+commands.
- The \meta{commands} may not contain a paragraph (an empty
- line). This is a precaution to ensure that users really use this
- command only for small graphics.
-
- \example |\tikz{\draw (0,0) rectangle (2ex,1ex)}| yields
- \tikz{\draw (0,0) rectangle (2ex,1ex);}
-\end{command}
+\begin{command}{\tikz\opt{\oarg{options}}\marg{path commands}}
+ This command places the \meta{path commands} inside a
+ |{tikzpicture}| environment. The \meta{path commands} may
+ contain paragraphs and fragile material (like verbatim text).
+ If there is only one path command, it need not be surrounded by
+ curly braces, if there are several, you need to add them (this is
+ similar to the |\foreach| statement and also to the rules in
+ programming languages like Java or C concerning the placement of
+ curly braces).
-\begin{command}{\tikz\opt{\oarg{options}}\meta{text}|;|}
- If the \meta{text} does not start with an opening brace, the end of
- the \meta{text} is the next semicolon that is encountered.
+ \example |\tikz{\draw (0,0) rectangle (2ex,1ex);}| yields
+ \tikz{\draw (0,0) rectangle (2ex,1ex);}
\example |\tikz \draw (0,0) rectangle (2ex,1ex);| yields
\tikz \draw (0,0) rectangle (2ex,1ex);
@@ -259,7 +259,7 @@ some other kind of decoration.
Since backgrounds are often not needed at all, the definition of
styles for adding backgrounds has been put in the library package
|backgrounds|. This package is documented in
-Section~\ref{section-tikz-backgrounds}.
+Section~\ref{section-tikz-backgrounds}.
\subsection{Using Scopes to Structure a Picture}
@@ -291,7 +291,7 @@ chance of doing anything wrong.
\end{scope}
\end{tikzpicture}
\end{codeexample}
-
+
The following style influences scopes:
\begin{stylekey}{/tikz/every scope (initially \normalfont empty)}
This style is installed at the beginning of every scope.
@@ -309,7 +309,7 @@ chance of doing anything wrong.
This option installs some code that will be executed
at the end of the current scope. Using this option multiple times
will cause the code to accumulate. This option must also be given
- in the optional argument of the |{scope}| environment.
+ in the optional argument of the |{scope}| environment.
Again, the effect applies only to the current scope, not to subscopes.
\end{key}
@@ -329,7 +329,7 @@ chance of doing anything wrong.
There is a small library that makes using scopes a bit easier:
\begin{tikzlibrary}{scopes}
This library defines a shorthand for starting and ending |{scope}|
- environments.
+ environments.
\end{tikzlibrary}
When this library is loaded, the following happens: At certain places
inside a \tikzname\ picture, it is allowed to start a scope just using
@@ -353,7 +353,7 @@ square brackets:
\end{tikzpicture}
\end{codeexample}
-In the above example, |{ [thick]| actually causes a
+In the above example, |{ [thick]| actually causes a
|\begin{scope}[thick]| to be inserted, and the corresponding closing
|}| causes an |\end{scope}| to be inserted.
@@ -481,7 +481,7 @@ used in different pictures. In this case, we have to use the
|\tikzset| command somewhere at the beginning.
\begin{codeexample}[]
\tikzset{help lines/.style={blue!50,very thin}}
-% ...
+% ...
\begin{tikzpicture}
\draw (0,0) grid +(2,2);
\draw[help lines] (2,0) grid +(2,2);
@@ -504,7 +504,7 @@ In the above example, the option |blue!50| is appended to the style
last one will ``win.'' There also exists a handler called
|/.prefix style| that adds something at the beginning of the style.
-Just as normal keys, styles can be parametrized. This means that you
+Just as normal keys, styles can be parameterized. This means that you
write \meta{style}|=|\meta{value} when you use the style instead of
just \meta{style}. In this case, all occurrences of |#1| in
\meta{style} are replaced by \meta{value}. Here is an example that
@@ -517,7 +517,7 @@ shows how this can be used.
\end{tikzpicture}
\end{codeexample}
-For parametrized styles you can also set a \emph{default} value using
+For parameterized styles you can also set a \emph{default} value using
the |/.default| handler:
\begin{codeexample}[]
@@ -529,6 +529,4 @@ the |/.default| handler:
\end{codeexample}
For more details on using and setting styles, see also
-Section~\ref{section-keys}.
-
-
+Section~\ref{section-keys}.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
index 950dbe71a28..5cd58695209 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
@@ -15,12 +15,12 @@
In the present section, the usage of \emph{nodes} in
\tikzname\ is explained. A node is typically a rectangle or circle or
-another simple shape with some text on it.
+another simple shape with some text on it.
Nodes are added to paths using the special path
operation |node|. Nodes \emph{are not part of the path
itself}. Rather, they are added to the picture after the path has
-been drawn.
+been drawn.
In Section~\ref{section-nodes-basic} the basic syntax of the node
operation is explained, followed in Section~\ref{section-nodes-multi}
@@ -38,8 +38,7 @@ Section~\ref{section-nodes-connecting} it is explained how a node can
be used as a ``pseudo-coordinate.'' Section~\ref{section-nodes-edges}
introduces the |edge| operation, which
works similar to the |to| operation and also similar to the |node|
-operation. Finally, Section~\ref{section-nodes-executing} explains the
-special |after node path| options.
+operation.
\subsection{Nodes and Their Shapes}
@@ -71,7 +70,7 @@ current position of the path \emph{after the path has been
drawn}. Thus, all nodes are drawn ``on top'' of the path and
retained until the path is complete. If there are several nodes on a
path, they are drawn on top of the path in the order they are
-encountered.
+encountered.
\begin{codeexample}[]
\tikz \fill[fill=examplefill]
@@ -87,7 +86,7 @@ The syntax for specifying nodes is the following:
after |at| and not, as would normally be the case, at the last
position. The |at| syntax is not available when a node is given
inside a path operation (it would not make any sense, there).
-
+
The |(|\meta{name}|)| is a name for later reference and it is
optional. You may also add the option |name=|\meta{name} to the
\meta{option} list; it has the same effect.
@@ -99,7 +98,7 @@ The syntax for specifying nodes is the following:
can name a node just |1| or perhaps |start of chart| or even
|y_1|. Your node name should \emph{not} contain any punctuation like
a dot, a comma, or a colon since these are used to detect what kind
- of coordinate you mean when you reference a node.
+ of coordinate you mean when you reference a node.
\end{key}
\begin{key}{/tikz/alias=\meta{another node name}}
@@ -110,7 +109,7 @@ The syntax for specifying nodes is the following:
\end{key}
\begin{key}{/tikz/at=\meta{coordinate}}
- This is another way of specifying ath |at| coordinate. Note that,
+ This is another way of specifying the |at| coordinate. Note that,
typically, you will have to enclose the \meta{coordinate} in curly
braces so that a comma inside the \meta{coordinate} does not
confuse \TeX.
@@ -125,7 +124,7 @@ The syntax for specifying nodes is the following:
node (unless some special other options are used, deep sigh).
As mentioned before, we can add a border and even a background to a
- node:
+ node:
\begin{codeexample}[]
\tikz \fill[fill=examplefill]
(0,0) node {first node}
@@ -136,8 +135,8 @@ The syntax for specifying nodes is the following:
The ``border'' is actually just a special case of a much more general
mechanism. Each node has a certain \emph{shape} which, by default, is
a rectangle. However, we can also ask \tikzname\ to use a circle shape
- instead or an ellipse shape (you have to include |pgflibraryshapes| for
- the latter shape):
+ instead or an ellipse shape (you have to include one of the
+ |shapes.geometric| library for the latter shape):
\begin{codeexample}[]
\tikz \fill[fill=examplefill]
@@ -164,15 +163,15 @@ The syntax for specifying nodes is the following:
check whether this option is the name of some shape. If so, that
shape is selected as if you had said |shape=|\meta{shape name}.
- By default, the following shapes are available: |rectangle|,
+ By default, the following shapes are available: |rectangle|, % this par has to be adapted: no more shapes library available, only several sublibraries
|circle|, |coordinate|, and, when the package |pgflibraryshapes| is
loaded, also |ellipse|. Details of these shapes, like their anchors
and size options, are discussed in Section~\ref{section-the-shapes}.
\end{key}
-
+
The following styles influences how nodes are rendered:
\begin{stylekey}{/tikz/every node (initially \normalfont empty)}
- This style is installed at the beginning of every node.
+ This style is installed at the beginning of every node.
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\draw (0,0) node {A} -- (1,1) node {B};
@@ -185,7 +184,7 @@ The syntax for specifying nodes is the following:
rectangle nodes, and so on.
\begin{codeexample}[]
\begin{tikzpicture}
- [every rectangle node/.style={draw},
+ [every rectangle node/.style={draw},
every circle node/.style={draw,double}]
\draw (0,0) node[rectangle] {A} -- (1,1) node[circle] {B};
\end{tikzpicture}
@@ -199,7 +198,7 @@ There is a special syntax for specifying ``light-weighed'' nodes:
This has the same effect as
|node[shape=coordinate][|\meta{options}|](|\meta{name}|)at(|\meta{coordinate}|){}|,
-
+
where the |at| part might be missing.
\end{pathoperation}
@@ -232,7 +231,7 @@ special commands for creating paths containing only a node:
\end{itemize}
By loading library packages, you can define more shapes like ellipses
or diamonds; see Section~\ref{section-libs-shapes} for the complete
-list of shapes.
+list of shapes.
\label{section-tikz-coordinate-shape}
The |coordinate| shape is handled in a special way by \tikzname. When
@@ -241,14 +240,14 @@ this has the same effect as if you had said |(x.center)|. None of the
special ``line shortening rules'' apply in this case. This can be
useful since, normally, the line shortening causes paths to be
segmented and they cannot be used for filling. Here is an example that
-demonstrates the difference:
+demonstrates the difference:
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\path[yshift=1.5cm,shape=rectangle]
(0,0) node(a1){} (1,0) node(a2){}
(1,1) node(a3){} (0,1) node(a4){};
\filldraw[fill=examplefill] (a1) -- (a2) -- (a3) -- (a4);
-
+
\path[shape=coordinate]
(0,0) coordinate(b1) (1,0) coordinate(b2)
(1,1) coordinate(b3) (0,1) coordinate(b4);
@@ -278,7 +277,7 @@ shapes:
to make it a bit ``larger.''
For those familiar with \textsc{css}, this is the same as
- \emph{padding}.
+ \emph{padding}.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -297,7 +296,7 @@ shapes:
\begin{key}{/pgf/inner ysep=\meta{dimension} (initially .3333em)}
\keyalias{tikz}
Specifies the inner separation in the $y$-direction, only.
-\end{key}
+\end{key}
\begin{key}{/pgf/outer sep=\meta{dimension} (initially .5\string\pgflinewidth)}
\keyalias{tikz}
@@ -313,7 +312,7 @@ shapes:
exactly on the ``outside border'' of the path (not on the path
itself). When the shape is filled, but not drawn, this may not be
desirable. In this case, the |outer sep| should be set to zero
- point.
+ point.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[line width=5pt]
@@ -321,7 +320,7 @@ shapes:
(2,0) node[inner sep=.5\pgflinewidth+2pt,draw] (d) {drawn};
\draw[->] (1,-1) -- (f);
- \draw[->] (1,-1) -- (d);
+ \draw[->] (1,-1) -- (d);
\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -341,7 +340,7 @@ shapes:
This option ensures that the height of the shape (including the
inner, but ignoring the outer separation) will be at least
\meta{dimension}. Thus, if the text plus the inner separation is not
- at least as large as \meta{dimension}, the shape will be enlarged
+ at least as large as \meta{dimension}, the shape will be enlarged
appropriately. However, if the text is already larger than
\meta{dimension}, the shape will not be shrunk.
\begin{codeexample}[]
@@ -387,12 +386,12 @@ shapes:
\label{section-rotating-shape-borders}
-Some shapes (but not all), support a special kind of rotation. This
-rotation affects only the border of a shape and is independent of the
+Some shapes (but not all), support a special kind of rotation. This
+rotation affects only the border of a shape and is independent of the
node contents, but \emph{in addition} to any other transformations.
\begin{codeexample}[]
-\tikzstyle{every node}=[dart, shape border uses incircle,
+\tikzstyle{every node}=[dart, shape border uses incircle,
inner sep=1pt, draw]
\begin{tikzpicture}
\foreach \a/\b/\c in {A/0/0, B/45/0, C/0/45, D/45/45}
@@ -400,22 +399,22 @@ node contents, but \emph{in addition} to any other transformations.
\end{tikzpicture}
\end{codeexample}
-There are two types of rotation: restricted and unrestricted. Which
-type of rotation is applied is determined by on how the shape border
-is constructed. If the shape border is contructed using an incircle,
-that is, a circle that tightly fits the node contents (including
+There are two types of rotation: restricted and unrestricted. Which
+type of rotation is applied is determined by on how the shape border
+is constructed. If the shape border is constructed using an incircle,
+that is, a circle that tightly fits the node contents (including
the |inner sep|), then the rotation can be unrestricted. If, however,
the border is constructed using the natural dimensions of the node
-contents, the rotation is restricted to integer multiples of 90
+contents, the rotation is restricted to integer multiples of 90
degrees.
Why should there be two kinds of rotation and border construction?
Borders constructed using the natural dimensions of the node contents
-provide a much tighter fit to the node contents, but to maintain
-this tight fit, the border rotation must be restricted to integer
+provide a much tighter fit to the node contents, but to maintain
+this tight fit, the border rotation must be restricted to integer
multiples of 90 degrees. By using an incircle, unrestricted rotation
is possible, but the border will not make a very tight fit to the
-node contents.
+node contents.
\begin{codeexample}[]
\tikzstyle{every node}=[isosceles triangle, draw]
@@ -425,16 +424,16 @@ node contents.
\end{tikzpicture}
\end{codeexample}
-There are \pgfname{} keys determine how a shape border is
-contructed, and to specify its rotation.
-It should be noted that not all shapes support these keys, so
-reference should be made to the documentation for individual
-shapes.
+There are \pgfname{} keys determine how a shape border is
+constructed, and to specify its rotation.
+It should be noted that not all shapes support these keys, so
+reference should be made to the documentation for individual
+shapes.
\begin{key}{/pgf/shape border uses incircle=\opt{\meta{boolean}}
(default true)}
\keyalias{tikz}
- Determines if the border of a shape is constructed using the
+ Determines if the border of a shape is constructed using the
incircle. If no value is given \meta{boolean} will take the default
value |true|.
\end{key}
@@ -443,15 +442,15 @@ shapes.
\begin{key}{/pgf/shape border rotate=\meta{angle} (initially 0)}
\keyalias{tikz}
Rotates the border of a shape independently of the node contents,
- but in addition to any other transformations. If the shape
+ but in addition to any other transformations. If the shape
border is not constructed using the incircle, the rotation will be
rounded to the nearest integer multiple of 90 degrees when the
- shape is drawn.
+ shape is drawn.
\end{key}
-Note that if the border of the shape is rotated,
-the compass point anchors, and `text box' anchors (including
-|mid east|, |base west|, and so on), \emph{do not rotate}, but the
+Note that if the border of the shape is rotated,
+the compass point anchors, and `text box' anchors (including
+|mid east|, |base west|, and so on), \emph{do not rotate}, but the
other anchors do:
\begin{codeexample}[]
@@ -459,7 +458,7 @@ other anchors do:
\begin{tikzpicture}
\node at (0,0) (A) {A};
\node [shape border rotate=30] at (1.5,0) (B) {B};
- \foreach \s/\t in
+ \foreach \s/\t in
{left side/base east, bottom side/north, bottom left corner/base}{
\fill[red] (A.\s) circle(1.5pt) (B.\s) circle(1.5pt);
\fill[blue] (A.\t) circle(1.5pt) (B.\t) circle(1.5pt);
@@ -467,10 +466,10 @@ other anchors do:
\end{tikzpicture}
\end{codeexample}
-Finally, a somewhat unfortunate side-effect of rotating shape borders
-is that the supporting shapes do not distinguish between
-|outer xsep| and |outer ysep|, and typically, the larger of the
-two values will be used.
+Finally, a somewhat unfortunate side-effect of rotating shape borders
+is that the supporting shapes do not distinguish between
+|outer xsep| and |outer ysep|, and typically, the larger of the
+two values will be used.
@@ -494,13 +493,14 @@ lower level, \pgfname\ provides a system for specifying that a shape
consists of several parts. On the \tikzname\ level, you specify the
different node parts by using the following command:
-\begin{command}{\nodepart\marg{part name}}
+\begin{command}{\nodepart\opt{|[|\meta{options}|]|}\marg{part name}}
This command can only be used inside the \meta{text} argument of a
|node| path operation. It works a little bit like a |\part| command
in \LaTeX. It will stop the typesetting of whatever node part was
typeset until now and then start putting all following text into the
node part named \meta{part name}---until another |\partname| is
- encountered or until the node \meta{text} ends.
+ encountered or until the node \meta{text} ends. The \meta{options}
+ will be local to this part.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -508,7 +508,7 @@ different node parts by using the following command:
{
% No \nodepart has been used, yet. So, the following is put in the
% ``text'' node part by default.
- $q_1$
+ $q_1$
\nodepart{lower} % Ok, end ``text'' part, start ``output'' part
$00$
}; % output part ended.
@@ -521,7 +521,7 @@ different node parts by using the following command:
\begin{stylekey}{/tikz/every \meta{part name} node part (initially
\normalfont empty)}
This style is installed at the beginning of every node part named
- \meta{part name}.
+ \meta{part name}.
\begin{codeexample}[]
\tikz [every lower node part/.style={red}]
\node [circle split,draw] {$q_1$ \nodepart{lower} $00$};
@@ -531,13 +531,15 @@ different node parts by using the following command:
-\subsection{Options for the Text in Nodes}
+\subsection{The Node Text}
\label{section-nodes-options}
+\subsubsection{Text Parameters: Color and Opacity}
+
The simplest option for the text in nodes is its color. Normally, this
color is just the last color installed using |color=|, possibly
-inherited from another scope. However, it is possible to specificly
+inherited from another scope. However, it is possible to specifically
set the color used for text using the following option:
\begin{key}{/tikz/text=\meta{color}}
@@ -556,10 +558,12 @@ Just like the color itself, you may also wish to set the opacity of
the text only. For this, use the option |text opacity| option, which
is detailed in Section~\ref{section-tikz-transparency}.
+\subsubsection{Text Parameters: Font}
+
Next, you may wish to adjust the font used for the text. Use the
following option for this:
\begin{key}{/tikz/font=\meta{font commands}}
- Sets the font used for text labels.
+ Sets the font used for text labels.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[font=\itshape] (1,0) -- +(1,1) node[above] {italic};
@@ -568,92 +572,244 @@ following option for this:
A perhaps more useful example is the following:
\begin{codeexample}[]
-\tikz [every text node part/.style={font=\itshape},
+\tikz [every text node part/.style={font=\itshape},
every lower node part/.style={font=\footnotesize}]
\node [circle split,draw] {state \nodepart{lower} output};
\end{codeexample}
\end{key}
+
+\subsubsection{Text Parameters: Alignment and Width for Multi-Line Text}
+
Normally, when a node is typeset, all the text you give in the braces
-is but in one long line (in an |\hbox|, to be precise) and the node
+is put in one long line (in an |\hbox|, to be precise) and the node
will become as wide as necessary.
-You can change this behaviour using the following options. They allow
-you to limit the width of a node (naturally, at the expense of its
-height).
+From time to time you may wish to create nodes that contain multiple
+lines of text. There are three different ways of achieving this:
+\begin{enumerate}
+\item Inside the node, you can put some standard environment that
+ produces multi-line, aligned text. For instance, you can use a
+ |{tabular}| inside a node:
+\begin{codeexample}[]
+\tikz \node [draw] {
+ \begin{tabular}{cc}
+ upper left & upper right\\
+ lower left & lower right
+ \end{tabular}
+};
+\end{codeexample}
+ This approach offers the most flexibility in the sense that it
+ allows you to use all of the alignment commands offered by your
+ format of choice.
+\item You use |\\| inside your node to mark the end of lines and then
+ request \tikzname\ to arrange these lines in some manner. This will
+ only be done, however, if the |align| option has been given.
+\begin{codeexample}[]
+\tikz[align=left] \node[draw] {This is a\\demonstration.};
+\end{codeexample}
+\begin{codeexample}[]
+\tikz[align=center] \node[draw] {This is a\\demonstration.};
+\end{codeexample}
+ The |\\| command takes an optional extra space as an argument in square
+ brackets.
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,align=right]
+ {This is a\\[-2pt] demonstration text for\\[1ex] alignments.};
+\end{codeexample}
+\item You can request that \tikzname\ does an automatic line-breaking
+ for you inside the node by specifying a fixed |text width| for the
+ node. In this case, you can still use |\\| to enforce a
+ line-break. Note that when you specify a text width, the node will
+ have this width, independently of whether the text actually
+ ``reaches the end'' of the node.
+\end{enumerate}
+Let us now first have a look at the |text width| command.
\begin{key}{/tikz/text width=\meta{dimension}}
This option will put the text of a node in a box of the given width
- (more precisely, in a |{minipage}| of this width; for plain \TeX\ a
- rudimentary ``minipage emulation'' is used).
-
- If the node text is not as wide as \meta{dimension}, it will
- nevertheless be put in a box of this width. If it is larger, line
- breaking will be done.
+ (something akin to a |{minipage}| of this width, only portable
+ across formats). If the node text is not as wide as
+ \meta{dimension}, it will nevertheless be put in a box of this
+ width. If it is larger, line breaking will be done.
By default, when this option is given, a ragged right border will be
- used. This is sensible since, typically, these boxes are narrow and
- justifying the text looks ugly.
+ used (|align=left|). This is sensible since, typically, these boxes
+ are narrow and justifying the text looks ugly. You can, however,
+ change the alignment using |align| or directly using commands line
+ |\centering|.
\begin{codeexample}[]
\tikz \draw (0,0) node[fill=examplefill,text width=3cm]
- {This is a demonstration text for showing how line breaking works.};
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
+ Setting \meta{dimension} to an empty string causes the automatic
+ line breaking to be disabled.
\end{key}
-\begin{key}{/tikz/text justified}
- Causes the text to be justified instead of (right)ragged. Use this
- only with pretty broad nodes.
-{%
-\hbadness=10000
+\begin{key}{/tikz/align=\meta{how}}
+ This key is used to setup an alignment for multi-line text inside a
+ node. If |text width| is set to some width (let us call this
+ \emph{alignment with line breaking}), the |align| key will
+ setup the |\leftskip| and the |\rightskip| in such a way that the
+ text is broken and aligned according to \meta{how}. If |text width|
+ is not set (that is, set to the empty string; let us call this
+ \emph{alignment without line breaking}), then a different
+ mechanism is used internally, namely the key |node halign header|, is
+ set to an appropriate value. While this key, which is documented
+ below, is not to be used by beginners, the net effect is simple:
+ When |text width| is not set, you can use |\\| to break lines and
+ align them according to \meta{how} and the resulting node's width
+ will be minimal to encompass the resulting lines.
+
+ In detail, you can set \meta{how} to one of the following values:
+ \begin{description}
+ \item[|align=|\declare{|left|}]
+ For alignment without line breaking, the different lines are simply
+ aligned such that their left borders are below one another.
\begin{codeexample}[]
-\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text justified]
- {This is a demonstration text for showing how line breaking works.};
+\tikz \node[fill=examplefill,align=left]
+ {This is a\\ demonstration text for\\ alignments.};
+\end{codeexample}
+ For alignment with line breaking, the same will happen only
+ the lines will now, additionally, be broken automatically:
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,text width=3cm,align=left]
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-}
- In the above example, \TeX\ complains (rightfully) about three very
- badly typeset lines. (For this manual I asked \TeX\ to stop
- complaining by using |\hbadness=10000|, but this is a foul deed,
- indeed.)
-\end{key}
-\begin{key}{/tikz/text ragged}
- Causes the text to be typeset with a ragged right. This uses the
- original plain \TeX\ definition of a ragged right border, in which
- \TeX\ will try to balance the right border as well as possible. This
- is the default.
+ \item[|align=|\declare{|flush left|}]
+ For alignment without line breaking this option has exactly the
+ same effect as |left|. However, for alignment with line breaking,
+ there is a difference: While |left| uses the
+ original plain \TeX\ definition of a ragged right border, in which
+ \TeX\ will try to balance the right border as well as possible,
+ |flush left| causes the right border to be ragged in the
+ \LaTeX-style, in which no balancing occurs. This looks ugly, but
+ it may be useful for very narrow boxes and when you wish to avoid
+ hyphenations.
\begin{codeexample}[]
-\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text ragged]
- {This is a demonstration text for showing how line breaking works.};
+\tikz \node[fill=examplefill,text width=3cm,align=flush left]
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-\end{key}
-\begin{key}{/tikz/text badly ragged}
- Causes the right border to be ragged in the \LaTeX-style, in which
- no balancing occurs. This looks ugly, but it may be useful for very
- narrow boxes and when you wish to avoid hyphenations.
+ \item[|align=|\declare{|right|}]
+ Works like |left|, only for right alignment.
\begin{codeexample}[]
-\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text badly ragged]
- {This is a demonstration text for showing how line breaking works.};
+\tikz \node[fill=examplefill,align=right]
+ {This is a\\ demonstration text for\\ alignments.};
+\end{codeexample}
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,text width=3cm,align=right]
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-\end{key}
-\begin{key}{/tikz/text centered}
- Centers the text, but tries to balance the lines.
+ \item[|align=|\declare{|flush right|}]
+ Works like |flush left|, only for right alignment.
\begin{codeexample}[]
-\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text centered]
- {This is a demonstration text for showing how line breaking works.};
+\tikz \node[fill=examplefill,text width=3cm,align=flush right]
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-\end{key}
-\begin{key}{/tikz/text badly centered}
- Centers the text, without balancing the lines.
+ \item[|align=|\declare{|center|}]
+ Works like |left| or |right|, only for centered alignment.
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,align=center]
+ {This is a\\ demonstration text for\\ alignments.};
+\end{codeexample}
\begin{codeexample}[]
-\tikz \draw (0,0) node[fill=examplefill,text width=3cm,text badly centered]
- {This is a demonstration text for showing how line breaking works.};
+\tikz \node[fill=examplefill,text width=3cm,align=center]
+ {This is a demonstration text for showing how line breaking works.};
\end{codeexample}
+
+ \item[|align=|\declare{|flush center|}]
+ Works like |flush left| or |flush right|, only for center alignment.
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,text width=3cm,align=flush center]
+ {This is a demonstration text for showing how line breaking works.};
+\end{codeexample}
+
+ \item[|align=|\declare{|justify|}]
+ For alignment without line breaking, this has the same effect as
+ |left|. For alignment with line breaking, this causes the text to
+ be ``justified.'' Use this
+ only with pretty broad nodes.
+{%
+\hbadness=10000
+\begin{codeexample}[]
+\tikz \node[fill=examplefill,text width=3cm,align=justify]
+ {This is a demonstration text for showing how line breaking works.};
+\end{codeexample}
+}
+ In the above example, \TeX\ complains (rightfully) about three very
+ badly typeset lines. (For this manual I asked \TeX\ to stop
+ complaining by using |\hbadness=10000|, but this is a foul deed,
+ indeed.)
+
+ \item[|align=|\declare{|none|}]
+ Disables all alignments and |\\| will not be redefined.
+ \end{description}
\end{key}
+
+\begin{key}{/tikz/node halign header=\meta{macro storing a header} (initially
+ \normalfont empty)}
+ This is the key that is used by |align| internally for alignment
+ without line breaking. Read the following only if you are familiar
+ with the |\halign| command.
+
+ This key only has an effect if |text width|
+ is empty, otherwise it is ignored. Furthermore, if \meta{header} is
+ empty, then this key also has no effect. So, suppose |text width| is
+ empty, but \meta{header} is not. In this case the following happens:
+
+ When the node text is parsed, the command |\\| is redefined
+ internally. This redefinition is done in such a way that the text
+ from the start of the node to the first occurrence of |\\| is put in
+ an |\hbox|. Then the text following |\\| up to the next |\\| is put
+ in another |\hbox|. This goes on until the text between the last
+ |\\| and the closing |}| is also put in an |\hbox|.
+
+ The \meta{macro storing a header} should be a macro that contains
+ some text suitable for use as a header for the |\halign|
+ command. For instance, you might define
+\begin{codeexample}[code only]
+\def\myheader{\hfil\hfil##\hfil\cr}
+\tikz [node halign header=\myheader] ...
+\end{codeexample}
+ You cannot just say |node halign header=\hfil\hfil#\hfil\cr| because
+ this confuses \TeX\ inside matrices, so this detour via a macro is
+ needed.
+
+ Next, conceptually, all these boxes are recursively put inside an
+ |\halign| command. Assuming that \meta{first} is the first of the
+ above boxes, the command |\halign{|\meta{header} |\box|\meta{first}
+ |\cr}| is used to create a new box, which we will call the
+ \meta{previous box}. Then, the following box is created, where
+ \meta{second} is the second input box:
+ |\halign{|\meta{header} |\box|\meta{previous box} |\cr|
+ |\box|\meta{second}|\cr}|. Let us call the resulting box the
+ \meta{previous box} once more. Then the next box that is created is
+ |\halign{|\meta{header} |\box|\meta{previous box} |\cr|
+ |\box|\meta{third}|\cr}|.
+
+ All of this means that if \meta{header} is an |\halign| header
+ like |\hfil#\hfil\cr|, then all boxes will be centered relative to
+ one another. Similarly, a \meta{header} of |\hfil#\cr| causes the
+ text to be flushed right.
+
+ Note that this mechanism is not flexible enough to all multiple
+ columns inside \meta{header}. You will have to use a |tabular| or a
+ |matrix| in such cases.
+
+ One further note: Since the text of each line is placed in a box,
+ settings will be local to each ``line.'' This is very similar to the
+ way a cell in a |tabular| or a |matrix| behaves.
+\end{key}
+
+
+\subsubsection{Text Parameters: Height and Depth of Text}
+
In addition to changing the width of nodes, you can also change the
height of nodes. This can be done in two ways: First, you can use the
option |minimum height|, which ensures that the height of the whole
@@ -677,20 +833,19 @@ special situations.
write |text height=| without specifying anything, the ``natural''
size of the text box remains unchanged.
\begin{codeexample}[]
-\tikz \node[draw] {y};
-\tikz \node[draw,text height=10pt] {y};
+\tikz \node[draw] {y};
+\tikz \node[draw,text height=10pt] {y};
\end{codeexample}
\end{key}
\begin{key}{/tikz/text depth=\meta{dimension}}
This option works like |text height|, only for the depth of the text
box. This option is mostly useful when you need to ensure a uniform
- depth of text boxes that need to be aligned.
+ depth of text boxes that need to be aligned.
\end{key}
-
\subsection{Positioning Nodes}
\label{section-nodes-anchors}
@@ -747,7 +902,7 @@ position.
directions.'' Furthermore, the standard shapes also define a |base|
anchor, as well as |base west| and |base east|, for placing things on
the baseline of the text.
-
+
The standard shapes also define a |mid| anchor (and |mid west| and
|mid east|). This anchor is half the height of the character ``x''
above the base line. This anchor is useful for vertically centering
@@ -778,7 +933,7 @@ more intuitively:
\begin{key}{/tikz/above=\meta{offset} (default 0pt)}
Does the same as |anchor=south|. If the \meta{offset} is specified,
the node is additionally shifted upwards by the given
- \meta{offset}.
+ \meta{offset}.
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above] {above};
\end{codeexample}
@@ -806,7 +961,7 @@ more intuitively:
takes an \meta{offset} parameter, but using this parameter without
using the |positioning| library is deprecated. (The |positioning|
library changes the meaning of this parameter to something more
- sensible.)
+ sensible.)
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above left] {above left};
\end{codeexample}
@@ -831,7 +986,7 @@ more intuitively:
% as the options without |of|, however, their parameter is different:
% You must provide the name of another node. The current node will then
% be placed, say, above this specified node at a distance given by the
-% option |node distance|.
+% option |node distance|.
% \begin{key}{/tikz/above of=\meta{node}}
% This option causes the node to be placed at the distance
% |node distance| above of \meta{node}. The anchor is |center|.
@@ -874,7 +1029,7 @@ more intuitively:
% \begin{key}{/tikz/node distance=\meta{dimension}}
% Sets the distance between nodes that are placed using the
% |... of| options. Note that this distance is the distance between
-% the centers of the nodes, not the distance between their borders.
+% the centers of the nodes, not the distance between their borders.
% \end{key}
@@ -895,7 +1050,7 @@ differently.
\begin{key}{/tikz/above=\opt{\meta{specification}} (default 0pt)}
With the |positioning| library loaded, the |above| option does not
- take a simple \meta{dimension} as its paramter. Rather, it can
+ take a simple \meta{dimension} as its parameter. Rather, it can
(also) take a more elaborate \meta{specification} as parameter. This
\meta{specification} has the following general form: It starts with
an optional \meta{shifting part} and is followed by an optional
@@ -957,14 +1112,14 @@ differently.
|of somenode.north| or |of 2,3|. In this case, the
following happens: First, the node's |at| parameter is set to the
\meta{coordinate}. Second, the node is shifted according to the
- \meta{shift-part}. Third, the anchor is set to |south|.
+ \meta{shift-part}. Third, the anchor is set to |south|.
Here is a basic example:
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,2);
\node (somenode) at (1,1) {some node};
-
+
\node [above=5mm of somenode.north east] {\tiny 5mm of somenode.north east};
\node [above=1cm of somenode.north] {\tiny 1cm of somenode.north};
\end{tikzpicture}
@@ -978,13 +1133,13 @@ differently.
rather the value of the |node distance| key is used, see below.
\item The \meta{of-part} can have be |of |\meta{node name}. An
example would be |of somenode|. In this case, the following
- usually happens:
+ usually happens:
\begin{itemize}
\item The anchor is set to |south|.
\item The node is shifted according to the \meta{shifting part}
or, if it is missing, according to the value of |node distance|.
\item The node's |at| parameter is set to \meta{node
- name}|.north|.
+ name}|.north|.
\end{itemize}
The net effect of all this is that the new node will be placed in
such a way that the distance between is south border and
@@ -993,7 +1148,7 @@ differently.
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,2);
\node (some node) at (1,1) {some node};
-
+
\node (other node) [above=1cm of some node] {\tiny above=1cm of some node};
\draw [<->] (some node.north) -- (other node.south)
@@ -1013,7 +1168,7 @@ differently.
will be placed in such a way that its center is 1cm above the
center of |somenode|. Repeatedly placing nodes in this way will
result in nodes that are centered on ``grid coordinate,'' hence
- the name of the option.
+ the name of the option.
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,3);
@@ -1035,7 +1190,7 @@ differently.
\begin{key}{/tikz/node distance=\meta{shifting part} (initially 1cm and 1cm)}
The value of this key is used as \meta{shifting part} is used if
and only if a \meta{of-part} is present, but no \meta{shifting
- part}.
+ part}.
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw,node distance=5mm]
\draw[help lines] (0,0) grid (2,3);
@@ -1095,7 +1250,7 @@ differently.
left. A more mathematical way of phrasing this is the following: A
plain \meta{dimension} is measured in the $l_2$-norm, while a
\meta{dimension}| and |\meta{dimension} is measured in the
- $l_1$-norm.
+ $l_1$-norm.
\end{enumerate}
The following example should help to illustrate the difference:
\begin{codeexample}[]
@@ -1116,7 +1271,7 @@ differently.
\node [below left=of b] {7}; \node [below right=of b] {8};
\end{scope}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw,rectangle}]
\draw[help lines] (0,0) grid (2,5);
@@ -1135,7 +1290,7 @@ differently.
\node [below left=of b] {7}; \node [below right=of b] {8};
\end{scope}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw,rectangle},on grid]
\draw[help lines] (0,0) grid (4,4);
@@ -1154,7 +1309,7 @@ differently.
\node [below left=of b] {7}; \node [below right=of b] {8};
\end{scope}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{key}
\begin{key}{/tikz/below left=\opt{\meta{specification}}}
@@ -1183,12 +1338,12 @@ keys:
\node (X) at (0,1) {X};
\node (a) [right=of X] {a};
\node (y) [right=of a] {y};
-
+
\node (X) at (0,0) {X};
\node (a) [base right=of X] {a};
\node (y) [base right=of a] {y};
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{key}
\begin{key}{/tikz/base right=\opt{\meta{specification}}}
Works like |base left|.
@@ -1213,7 +1368,7 @@ library and the |matrix| library. The first is mostly useful for
creating ``chains of nodes'' and, more generally, ``flows.'' The
second allows you to arrange multiple nodes in rows and columns. These
methods for positioning nodes are described in two separate
-Sections~\ref{section-matrices} and~\ref{section-chains}.
+Sections~\ref{section-matrices} and~\ref{section-chains}.
\subsection{Fitting Nodes to a Set of Coordinates}
@@ -1225,7 +1380,7 @@ given using anchors and size parameters, rather one would sometimes
have a box be placed and be sized such that it ``is just large enough
to contain this, that, and that point.'' This situation typically
arises when a picture has been drawn an, afterwards, parts of the
-picture are supposed to be encircled or hilighted.
+picture are supposed to be encircled or highlighted.
In this situation the |fit| option from the |fit| library is useful,
see Section~\ref{section-library-fit} for a the details. The idea is
@@ -1295,7 +1450,7 @@ example, it certainly sometimes makes sense to rotate a node by
You can give transformation option \emph{inside} the option list of
the node. \emph{These} transformations always apply to the node.
\begin{codeexample}[]
-\begin{tikzpicture}[every node/.style={draw}]
+\begin{tikzpicture}[every node/.style={draw}]
\draw[help lines](0,0) grid (3,2);
\draw (1,0) node{A}
(2,0) node[rotate=90,scale=1.5] {B};
@@ -1332,7 +1487,7 @@ ways are described in the following.
dictates how ``far'' on the line the point should be. A
\meta{fraction} or 0 is the previous coordinate, 1 is the current
one, everything else is in between. In particular, 0.5 is the
- middle.
+ middle.
Now, what is ``the previous line''? This depends on the previous
path construction operation.
@@ -1354,7 +1509,7 @@ ways are described in the following.
connect the start and end points to the control points). The exact
math is a bit complicated (depending on your point of view, of
course); you may wish to consult a good book on computer graphics
- and Bézier curves if you are intrigued.
+ and Bézier curves if you are intrigued.
\begin{codeexample}[]
\tikz \draw (0,0) .. controls +(right:3.5cm) and +(right:3.5cm) .. (0,3)
\foreach \p in {0,0.125,...,1} {node[pos=\p]{\p}};
@@ -1376,7 +1531,7 @@ ways are described in the following.
For all other path construction operations, \emph{the position
placement does not work}, currently. This will hopefully change in
- the future (especially for the arc operation).
+ the future (especially for the arc operation).
\end{key}
\begin{key}{/tikz/auto=\meta{left or right} (default \normalfont is scope's setting)}
@@ -1392,7 +1547,7 @@ ways are described in the following.
|anchor| option or by one of the |above|, |below|, etc.\ options.
This option only has an effect for nodes that are placed on lines or
- curves.
+ curves.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1419,7 +1574,7 @@ ways are described in the following.
|right| is set instead and the other way round.
\begin{codeexample}[]
\begin{tikzpicture}[auto]
- \draw[help lines,use as bounding box] (0,-.5) grid (4,5);
+ \draw[help lines,use as bounding box] (0,-.5) grid (4,5);
\draw (0.5,0) .. controls (9,6) and (-5,6) .. (3.5,0)
\foreach \pos in {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
@@ -1449,7 +1604,7 @@ ways are described in the following.
\begin{key}{/tikz/sloped}
This option causes the node to be rotated such that a horizontal
- line becomes a tangent to the curve. The rotation is normally
+ line becomes a tangent to the curve. The rotation is normally
done in such a way that text is never ``upside down.'' To get
upside-down text, use can use |[rotate=180]| or
|[allow upside down]|, see below.
@@ -1467,7 +1622,7 @@ ways are described in the following.
\begin{key}{/tikz/allow upside down=\meta{boolean} (default true, initially false)}
- If set to |true|, \tikzname\ will not ``righten'' upside down text.
+ If set to |true|, \tikzname\ will not ``righten'' upside down text.
\begin{codeexample}[]
\tikz [allow upside down]
\draw (0,0) .. controls +(up:2cm) and +(left:2cm) .. (1,3)
@@ -1536,7 +1691,7 @@ What happens is the following: The syntax of the line-to path
operation is actually |--|
\opt{|node|\meta{node specification}}\meta{coordinate}. (It is even
possible to give multiple nodes in this way.) When the optional
-|node| is encountered, that is,
+|node| is encountered, that is,
when the |--| is directly followed by |node|, then the
specification(s) are read and ``stored away.'' Then, after the
\meta{coordinate} has finally been reached, they are inserted again,
@@ -1559,7 +1714,7 @@ should make this clearer:
\begin{codeexample}[]
\begin{tikzpicture}[near end]
- \draw (0cm,4em) -- (3cm,4em) node{A};
+ \draw (0cm,4em) -- (3cm,4em) node{A};
\draw (0cm,3em) -- node{B} (3cm,3em);
\draw (0cm,2em) -- node[midway] {C} (3cm,2em);
\draw (0cm,1em) -- (3cm,1em) node[midway] {D} ;
@@ -1577,30 +1732,79 @@ the operation with the |pos| option set.
In addition to the |node| path operation, nodes can also be added
using the |label| and the |pin| option. This is mostly useful
-for simple nodes.
+for simple nodes.
-\begin{key}{/tikz/label=\opt{|[|\meta{options}|]|}\meta{angle}|:|\meta{text}}
+\begin{key}{/tikz/label=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
+ \label{label-option}%
When this option is given to a |node| operation, it causes
\emph{another} node to be added to the path after the current node
has been finished. This extra node will have the text
- \meta{text}. It is placed according to the following rule: Suppose
- the |node| currently under construction is called |main node| and let us
- call the label node |label node|. Then the anchor of |label node| is
- placed at |main node.|\meta{angle}. The anchor that is chosen
- depends on the \meta{angle}. If the \meta{angle} lies between
- $-3^\circ$ and $+3^\circ$, then the anchor |west| is chosen, which
- causes |label node| to be placed right of the right end
- |main node|. If \meta{angle} lies between $4^\circ$ and $86^\circ$,
- the anchor |south west| is chosen, causing the |label node| to be
- placed above and right of the |main node|; and so on.
+ \meta{text}. It is placed, in principle, in the direction
+ \meta{angle} relative to the main node, but the exact rules are a
+ bit complex. Suppose the |node| currently under construction is called
+ |main node| and let us call the label node |label node|. Then the
+ following happens:
+ \begin{enumerate}
+ \item The \meta{angle} is used to determine a position on the border
+ of the |main node|. If the \meta{angle} is missing, the value of
+ the following key is used instead:
+ \begin{key}{/tikz/label position=\meta{angle} (initially above)}
+ Sets the default position for labels.
+ \end{key}
+ The \meta{angle} determines the position on the border of the
+ shape in two different ways. Normally, the border position is
+ given by |main node.|\meta{angle}. This means that the
+ \meta{angle} can either be a number like |0| or |-340|, but it can
+ also be an anchor like |north|. Additionally, the special angles
+ |above|, |below|, |left|, |right|, |above left|, and so on are
+ automatically replaced by the corresponding angles |90|, |270|,
+ |180|, |0|, |135|, and so on.
+
+ A special case arises when the following key is set:
+ \begin{key}{/tikz/absolute=\meta{true or false} (default true)}
+ When this key is set, the \meta{angle} is interpreted
+ differently: We still use a point on the border of the
+ |main node|, but the angle is measured ``absolutely,'' that is,
+ an angle of |0| refers to the point on the border that lies on a
+ straight line from the |main node|'s center to the right
+ (relative to the paper, not relative to the local coordinate
+ system or either the node or the scope).
+
+ The difference can be seen in the following example:
+\begin{codeexample}[]
+\tikz [rotate=-80,every label/.style={draw,red}]
+ \node [transform shape,rectangle,draw,label=right:label] {main node};
+\end{codeexample}
+\begin{codeexample}[]
+\tikz [rotate=-80,every label/.style={draw,red},absolute]
+ \node [transform shape,rectangle,draw,label=right:label] {main node};
+\end{codeexample}
+ \end{key}
+ \item Then, an anchor point for the |label node|. It is determined
+ in such a way that the |labe node| will ``face away'' from the
+ border of the |main node|. The anchor that is chosen depends on
+ the position of the border point that is chosen and its position
+ relative to the center of the |main node| and on whether the
+ |transform shape| option is set. In general, the choice should be
+ what you would expect, but you may have to set the anchor yourself
+ in difficult situations.
\begin{codeexample}[]
\tikz
- \node [circle,draw,label=60:$60^\circ$,label=below:$-90^\circ$] {my circle};
+ \node [circle,draw,
+ label=default,
+ label=60:$60^\circ$,
+ label=below:$-90^\circ$] {my circle};
\end{codeexample}
-
- As can be seen in the above example, instead of specifying
- \meta{angle} as a number, it is also possible to use |left|,
- |right|, |above|, |above left|, and so on.
+ \item
+ One \meta{angle} is special: If you set the \meta{angle} to
+ |center|, then the label will be placed on the center of the main
+ node. This is mainly useful for adding a label text to an existing
+ node, especially if it has been rotated.
+\begin{codeexample}[]
+\tikz \node [transform shape,rotate=90,
+ rectangle,draw,label={[red]center:R}] {main node};
+\end{codeexample}
+ \end{enumerate}
You can pass \meta{options} to the node |label node|. For this, you
provide the options in square brackets before the \meta{angle}. If you
@@ -1640,9 +1844,9 @@ for simple nodes.
\begin{key}{/tikz/pin=\opt{|[|\meta{options}|]|}\meta{angle}|:|\meta{text}}
This is option is quite similar to the |label| option, but there is
- one difference: In addition to adding a extra node to the picture,
+ one difference: In addition to adding a extra node to the picture,
it also adds an edge from this node to the main node. This causes
- the node to look like a pin that has been added to the main node:
+ the node to look like a pin that has been added to the main node:
\begin{codeexample}[]
\tikz \node [circle,fill=blue!50,minimum size=1cm,pin=60:$q_0$] {};
\end{codeexample}
@@ -1660,12 +1864,15 @@ for simple nodes.
pin=above:Z] {my circle};
\end{codeexample}
\end{key}
- \begin{stylekey}{/tikz/every pin (initially \normalfont draw=none,fill=none)}
+ \begin{stylekey}{/tikz/every pin (initially {draw=none,fill=none})}
This style is used in every node created by the |pin|
option.
\end{stylekey}
+ \begin{key}{/tikz/pin position=\meta{angle} (initially above)}
+ The default pin position. Works like |label position|.
+ \end{key}
\begin{stylekey}{/tikz/every pin edge (initially help lines)}
- This style is used in every edge created by the |pin| optins.
+ This style is used in every edge created by the |pin| options.
\begin{codeexample}[]
\tikz [pin distance=15mm,
every pin edge/.style={<-,shorten <=1pt,decorate,
@@ -1678,7 +1885,7 @@ for simple nodes.
\begin{key}{/tikz/pin edge=\meta{options} (initially \normalfont empty)}
This option can be used to set the options that are to be used
- in the edge created by the |pin| option.
+ in the edge created by the |pin| option.
\begin{codeexample}[]
\tikz[pin distance=10mm]
\node [circle,draw,pin={[pin edge={blue,thick}]right:X},
@@ -1701,7 +1908,7 @@ for simple nodes.
Once you have defined a node and given it a name, you can use this
name to reference it. This can be done in two ways, see also
Section~\ref{section-node-coordinates}. Suppose you have said
-|\path(0,0) node(x) {Hello World!};| in order to define a node named |x|.
+|\path(0,0) node(x) {Hello World!};| in order to define a node named |x|.
\begin{enumerate}
\item
Once the node |x| has been defined, you can use
@@ -1752,7 +1959,7 @@ The |edge| operation works like a |to| operation that is added after
the main path has been drawn, much like a node is added after the main
path has been drawn. This allows you to have each |edge| to have a
different appearance. As the |node| operation, an |edge| temporarily
-suspends the construction of the current path and a new path $p$ is
+suspends the construction of the current path and a new path $p$ is
constructed. This new path $p$ will be drawn after the main path has
been drawn. Note that $p$ can be totally different from the main
path with respect to its options. Also note that if there are
@@ -1773,22 +1980,22 @@ are encountered on the path.
coordinate is already part of the main path).
The |\tikztostart| is the last coordinate on the path just before
- the |edge| operation, just as for the |node| or |to| operations.
+ the |edge| operation, just as for the |node| or |to| operations.
However, there is one exception to this rule: If the |edge|
operation is directly preceded by a |node| operation, then this
just-declared node is the start coordinate (and not, as would
normally be the case, the coordinate where this just-declared node
is placed -- a small, but subtle difference). In this regard, |edge|
differs from both |node| and |to|.
-
+
If there are several |edge| operations in a row, the start coordinate
- is the same for all of them as their target coordiantes are not,
+ is the same for all of them as their target coordinates are not,
after all, part of the main path. The start coordinate is, thus, the
coordinate preceding the first |edge| operation. This is
similar to nodes insofar as the |edge| operation does not modify the
current path at all. In particular, it does not change the last
coordinate visited, see the following example:
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node (a) at (0:1) {$a$};
@@ -1797,12 +2004,12 @@ are encountered on the path.
edge [<-] (b);
\node (d) at (270:1) {$d$} edge [->] (a)
edge [dotted] (b)
- edge [<-] (c);
+ edge [<-] (c);
\end{tikzpicture}
\end{codeexample}
A different way of specifying the above graph using the |edge|
- operation is the following:
+ operation is the following:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1831,14 +2038,14 @@ are encountered on the path.
edge [-,dotted] node[below,sloped] {missing} (d)
(c) edge (a)
edge (d)
- (d) edge [red] node[above,sloped] {very}
+ (d) edge [red] node[above,sloped] {very}
node[below,sloped] {bad} (a);
\end{tikzpicture}
\end{codeexample}
Instead of |every to|, the style |every edge| is installed at the
beginning of the main path.
- \begin{stylekey}{/tikz/every edge (inititially draw)}
+ \begin{stylekey}{/tikz/every edge (inititially draw)} % inititially --> initially? (ff) (this is the definition of the key, so please have a look)
Executed for each |edge|.
\begin{codeexample}[]
\begin{tikzpicture}[every to/.style={draw,dashed}]
@@ -1858,7 +2065,7 @@ are encountered on the path.
It is possible (but not quite trivial) to reference nodes in pictures
other than the current one. This means that you can create a picture
and a node therein and, later, you can draw a line from some other
-position to this node.
+position to this node.
To reference nodes in different pictures, proceed as follows:
\begin{enumerate}
@@ -1883,9 +2090,9 @@ Let us have a look at the effect of these options.
depending on which backend driver is used. Also, even if remembering
works, the position may only be available on a second run of \TeX.
- Provided that remebering works, you may consider saying
+ Provided that remembering works, you may consider saying
\begin{codeexample}[code only]
-\tikzsytle{every picture}+=[remember picture]
+\tikzstyle{every picture}+=[remember picture]
\end{codeexample}
to make \tikzname\ remember all pictures. This will add one line in
the |.aux| file for each picture in your document -- which typically
@@ -1943,7 +2150,7 @@ that we do not wish to count as part of the picture.
\begin{codeexample}[]
\begin{tikzpicture}[remember picture]
\node (c) [circle,draw] {Big circle};
-
+
\draw [overlay,->,very thick,red,opacity=.5]
(c) to[bend left] (n1) (n1) -| (n2);
\end{tikzpicture}
@@ -1996,55 +2203,22 @@ page).
-\subsection{Late Code and Options}
+\subsection{Late Code and Late Options}
All options given to a node only locally affect this one node. While
this is a blessing in most cases, you may sometimes want to cause
options to have effects ``later'' on. The other way round, you may
sometimes note ``only later'' that some options should be added to the
-options of a node. The present section describes ways of achieving
-these effects.
-
-
-\subsubsection{Executing Code After Nodes}
-
-\label{section-nodes-executing}
-
-It is possible to add a path right after a node using the option
-|after node path|. The idea is that a style might use this option to
-add some additional stuff to the node that has just been
-typeset. Examples of such styles include the |label| option and the
-|pin| option.
-
-\begin{key}{/tikz/after node path=\meta{path}}
- The \meta{path} is added to the main path right after the node, as
- if you had given the path thereafter. This option can only be given
- inside the option list of a node and multiple calls of this option
- accumulate.
-
- Inside the \meta{path} you have access to the node that has just
- been created via the macro \declare{|\tikzlastnode|}.
-\begin{codeexample}[]
-\tikz
- \draw node [draw,after node path={(\tikzlastnode) circle (2cm)}]
- {hello};
-\end{codeexample}
-
- Note that in the above example, if we had written |\path| instead of
- |\draw|, the circle would not have been drawn since the circle is
- part of the main path, not part of the node itself.
-\end{key}
-
-\begin{command}{\tikzaddafternodepathoption\marg{code}}
- This command allows you to specify that the \meta{code} should be
- executed at the beginning of the |after node path| of the current
- node. The code will also be executed immediately, but also again at
- the beginning of an |after node path|.
+options of a node.
+
+As explained in Section~\ref{section-paths}, you
+can use the options |append after command| and
+|prefix after command| to add a path after a node. The following macro may be
+useful there:
+\begin{command}{\tikzlastnode}
+ Expands to the last node on the path.
\end{command}
-
-\subsection{Late Options}
-
A \emph{late option} for a node is an option that is given a long time
after the node has already been constructed.
@@ -2055,10 +2229,11 @@ after the node has already been constructed.
and, then, the \meta{options} are executed in a local scope. Most of
these options will have no effect since you \emph{cannot change the
appearance of the node,} that is, you cannot change a red node
- into a green node using late options. However, giving the
- the |after node path| option inside the \meta{options} (directly or
- indirectly) does have the desired effect: The after node path gets
- executed with the |\tikzlastnode| set to the determined node.
+ into a green node using late options. However, giving
+ the |append after command| and |prefix after command| options inside
+ the \meta{options} (directly or indirectly) does have the desired
+ effect: The given path gets executed with the |\tikzlastnode|
+ set to the determined node.
The net effect of all this is that you can provide, say, the |label|
option inside the \meta{options} to a add a label to a node that has
@@ -2077,11 +2252,12 @@ after the node has already been constructed.
\node (a) [draw,circle] {Hello};
\path (a) [late options={label=above:world}];
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
+
\end{key}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
index f4d9bedfcfa..27ba94e4cf4 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
@@ -21,7 +21,7 @@ $(1\mathrm{cm},5\mathrm{pt})$, to the position a point is finally
placed on the display or paper. In order to find out where the point
should go, it is constantly ``transformed,'' which means that it is
mostly shifted around and possibly rotated, slanted, scaled, and
-otherwise mutilated.
+otherwise mutilated.
In detail, (at least) the following transformations are applied to a
coordinate like $(1,2)$ before a point on the screen is chosen:
@@ -32,7 +32,7 @@ coordinate like $(1,2)$ before a point on the screen is chosen:
current $y$-vector twice to obtain the new point.''
\item
\pgfname\ applies its coordinate transformation matrix to the
- resulting coordinate. This yields the final position of the point
+ resulting coordinate. This yields the final position of the point
inside the picture.
\item
The backend driver (like |dvips| or |pdftex|) adds transformation
@@ -41,11 +41,11 @@ coordinate like $(1,2)$ before a point on the screen is chosen:
\item
\textsc{pdf} (or PostScript) apply the canvas transformation
matrix to the point, which can once more change the position on the
- page.
+ page.
\item
The viewer application or the printer applies the device
transformation matrix to transform the coordinate to its final pixel
- coordinate on the screen or paper.
+ coordinate on the screen or paper.
\end{enumerate}
In reality, the process is even more involved, but the above should
@@ -87,7 +87,7 @@ options:
\begin{key}{/tikz/x=\meta{value} (initially 1cm)}
If \meta{value} is a dimension, the $x$-vector of
- \pgfname's $xyz$-coordinate system is setup to point
+ \pgfname's $xyz$-coordinate system is setup to point
\meta{value} to the right, that is, to $(\meta{value},0pt)$.
\begin{codeexample}[]
@@ -95,11 +95,11 @@ options:
\draw (0,0) -- +(1,0);
\draw[x=2cm,color=red] (0,0.1) -- +(1,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\tikz \draw[x=1.5cm] (0,0) grid (2,2);
-\end{codeexample}
+\end{codeexample}
The last example shows that the size of steppings in grids, just like
all other dimensions, are not affected by the $x$-vector. After all,
@@ -108,7 +108,7 @@ options:
If \meta{value} is a coordinate, the $x$-vector of
\pgfname's $xyz$-coordinate system to the specified coordinate. If
- \meta{value} contains a comma, it must be put in braces.
+ \meta{value} contains a comma, it must be put in braces.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -134,7 +134,7 @@ options:
resulting vector points to $(0,\meta{value})$.
\end{key}
-\begin{key}{/tikz/z=\meta{value} (initially \normalfont$-\sqrt{2}$cm)}
+\begin{key}{/tikz/z=\meta{value} (initially \normalfont$-3.85$mm)}
Works like the |y=| option, but now a dimension is means the point
$(\meta{value},\meta{value})$.
@@ -201,7 +201,7 @@ below.
Transformations apply immediately when they are encountered ``in the
middle of a path'' and they apply only to the coordinates on the path
-following the transformation option.
+following the transformation option.
\begin{codeexample}[]
\tikz \draw (0,0) rectangle (1,0.5) [xshift=2cm] (0,0) rectangle (1,0.5);
@@ -213,7 +213,7 @@ that all transformations are done using \TeX, which has a fairly low
accuracy. Furthermore, in certain situations it is necessary that
\tikzname\ \emph{inverts} the current transformation matrix and this will
fail if the transformation matrix is badly conditioned or even
-singular (if you do not know what singular matrices are, you are blessed).
+singular (if you do not know what singular matrices are, you are blessed).
\begin{key}{/tikz/shift={\ttfamily\char`\{}\meta{coordinate}{\ttfamily\char`\}}}
Adds the \meta{coordinate} to all coordinates.
@@ -234,9 +234,9 @@ singular (if you do not know what singular matrices are, you are blessed).
or scaling relative to the origin or skewing will no longer have an
effect.
- This option is useful in situtations where a complicated
+ This option is useful in situations where a complicated
transformation is used to ``get to a position,'' but you then wish
- to draw something ``normal'' at this position.
+ to draw something ``normal'' at this position.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -249,7 +249,7 @@ singular (if you do not know what singular matrices are, you are blessed).
\end{key}
\begin{key}{/tikz/xshift=\meta{dimension}}
- Adds \meta{dimension} to the $x$ value of all coordinates.
+ Adds \meta{dimension} to the $x$ value of all coordinates.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -280,7 +280,7 @@ singular (if you do not know what singular matrices are, you are blessed).
\begin{key}{/tikz/scale around={\ttfamily\char`\{}\meta{factor}|:|\meta{coordinate}{\ttfamily\char`\}}}
Scales the coordinate system by \meta{factor}, put with the ``origin
- of scaling'' centered on \meta{coordinate} rather than the origin.
+ of scaling'' centered on \meta{coordinate} rather than the origin.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -293,7 +293,7 @@ singular (if you do not know what singular matrices are, you are blessed).
\begin{key}{/tikz/xscale=\meta{factor}}
Multiplies only the $x$-value of all coordinates by the given
- \meta{factor}.
+ \meta{factor}.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -368,7 +368,7 @@ singular (if you do not know what singular matrices are, you are blessed).
\left(\begin{smallmatrix} x \\ y \end{smallmatrix}\right) +
\left(\begin{smallmatrix} t_x \\ t_y
\end{smallmatrix}\right)$. Usually, you do not use this option
- directly.
+ directly.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
index ba56a91a53e..5f7eba71c8c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
@@ -26,7 +26,7 @@ obscure the background, rather they blend the background with the new
color. At first sight, using such semitransparent colors might seem quite
straightforward, but the math going on in the background is quite
involved and the correct handling of transparency fills some 64 pages
-in the PDF specification.
+in the PDF specification.
In the present section, we start with the different ways of specifying
``how transparent'' newly drawn objects should be. The simplest way is
@@ -34,7 +34,7 @@ to just specify a percentage like ``60\% transparent.'' A much more
general way is to use something that I call a \emph{fading,} also
known as a soft mask or a mask.
-At the end of the section we adress the problem of creating so-called
+At the end of the section we address the problem of creating so-called
\emph{transparency groups}. This problem arises when you paint over a
position several times with a semitransparent color. Sometimes you
want the effect to accumulate, sometimes you do not.
@@ -42,8 +42,8 @@ want the effect to accumulate, sometimes you do not.
\emph{Note:} Transparency is best supported by the pdf\TeX\
driver. The \textsc{svg} driver also has some support. For PostScript
output, opacity is rendered correctly only with the most recent
-versions of GhostScript. Printers and other programs will typically
-ignore the opacity setting.
+versions of Ghostscript. Printers and other programs will typically
+ignore the opacity setting.
@@ -60,8 +60,8 @@ following options.
yields lines that are semitransparent.
Note that when you use PostScript as your output format,
- this option works only with recent versions of GhostScript.
-
+ this option works only with recent versions of Ghostscript.
+
\begin{codeexample}[]
\begin{tikzpicture}[line width=1ex]
\draw (0,0) -- (3,1);
@@ -73,7 +73,7 @@ following options.
Note that the |draw opacity| options only sets the opacity of drawn
lines. The opacity of fillings is set using the option
|fill opacity| (documented in Section~\ref{section-fill-opacity}. The
-option |opacity| sets both at the same time.
+option |opacity| sets both at the same time.
\begin{key}{/tikz/opacity=\meta{value}}
Sets both the drawing and filling opacity to \meta{value}.
@@ -111,21 +111,21 @@ option |opacity| sets both at the same time.
\end{codeexample}
\end{stylekey}
- \begin{stylekey}{/tikz/semitransparent}
+ \begin{stylekey}{/tikz/semitransparent}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[semitransparent] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
\end{stylekey}
- \begin{stylekey}{/tikz/nearly opaque}
+ \begin{stylekey}{/tikz/nearly opaque}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[nearly opaque] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
\end{stylekey}
-
- \begin{stylekey}{/tikz/very nearly opaque}
+
+ \begin{stylekey}{/tikz/very nearly opaque}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[very nearly opaque] (0.5,0) rectangle (1.5,0.25); }
@@ -154,8 +154,8 @@ option |opacity| sets both at the same time.
operations, this opacity also applies to text and images.
Note, again, that when you use PostScript as your output format,
- this option works only with recent versions of GhostScript.
-
+ this option works only with recent versions of Ghostscript.
+
\begin{codeexample}[]
\begin{tikzpicture}[thick,fill opacity=0.5]
\filldraw[fill=red] (0:1cm) circle (12mm);
@@ -175,7 +175,7 @@ option |opacity| sets both at the same time.
\end{key}
\begin{key}{/tikz/text opacity=\meta{value}}
- Sets the opacity of text labels, overriding the |fill opacity| setting.
+ Sets the opacity of text labels, overriding the |fill opacity| setting.
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={fill,draw}]
\draw[line width=2mm,blue!50,line cap=round] (0,0) grid (3,2);
@@ -224,12 +224,12 @@ each point of an area to transparency of the point. This transparency
can by any number between 0 and 1. A \emph{fading picture} is a normal
graphic that, in a way to be described in a moment, determines the
transparency of points inside the fading. Each fading has an
-underlying fading picture.
+underlying fading picture.
The fading picture is a normal graphic drawn using any of the normal
graphic drawing commands. A fading and its fading picture are related
as follows: Given any point of the fading, the transparency of this
-point is determined by the lumonisity of the fading picture at the
+point is determined by the luminosity of the fading picture at the
same position. The luminosity of a point determines ``how bright'' the
point is. The brighter the point in the fading picture, the more
opaque is the point in the fading. In particular, a white point of the
@@ -244,7 +244,7 @@ will be \emph{transparent}. For this reason, \tikzname\ defines a
color called |transparent| that is the same as |black|. The nice thing
about this definition is that the color
|transparent!|\meta{percentage} in the fading picture yields a
-pixel that is \meta{percantage} per cent transparent in the fading.
+pixel that is \meta{percentage} per cent transparent in the fading.
Turning a fading picture into a normal picture is achieved using the
following commands, which are \emph{only defined in the library},
@@ -260,10 +260,11 @@ namely the library |fadings|. So, to use them, you have to say
Use this option with the |{tikzfadingfrompicture}| environment to
set the name of the fading. You \emph{must} provide this option.
\end{key}
-
+
The following shading is 2cm by 2cm and changes gets more and more
transparent from left to right, but is 50\% transparent for a large
circle in the middle.
+{\tikzexternaldisable
\begin{codeexample}[]
\begin{tikzfadingfrompicture}[name=fade right]
\shade[left color=transparent!0,
@@ -277,13 +278,13 @@ namely the library |fadings|. So, to use them, you have to say
\fill [black!20] (-1.2,-1.2) rectangle (1.2,1.2);
\pattern [pattern=checkerboard,pattern color=black!30]
(-1.2,-1.2) rectangle (1.2,1.2);
-
+
\fill [path fading=fade right,red] (-1,-1) rectangle (1,1);
\end{tikzpicture}
\end{codeexample}
In the next example we create a fading picture that contains some
text. When the fading is used, we only see the shading ``through
- it.''
+ it.''
\begin{codeexample}[]
\begin{tikzfadingfrompicture}[name=tikz]
\node [text=transparent!20]
@@ -301,6 +302,7 @@ namely the library |fadings|. So, to use them, you have to say
(-2,-1) rectangle (2,1);
\end{tikzpicture}
\end{codeexample}
+}%
\end{environment}
\begin{plainenvironment}{{tikzfadingfrompicture}\oarg{options}}
@@ -313,7 +315,7 @@ namely the library |fadings|. So, to use them, you have to say
\begin{command}{\tikzfading\oarg{options}}
This command is used to define a fading similarly to that way a
- shading is defined. In the \meta{options} you should
+ shading is defined. In the \meta{options} you should
\begin{enumerate}
\item use the |name=|\meta{name} option to set a name for the fading,
\item use the |shading| option to set the name of the shading that
@@ -338,7 +340,7 @@ namely the library |fadings|. So, to use them, you have to say
\fill [red,path fading=fade right] (-1,-1) rectangle (1,1);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\tikzfading[name=fade out,
@@ -354,7 +356,7 @@ namely the library |fadings|. So, to use them, you have to say
\fill [blue,path fading=fade out] (-1,-1) rectangle (1,1);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\end{command}
@@ -363,7 +365,7 @@ namely the library |fadings|. So, to use them, you have to say
Aa fading specifies for each pixel of a certain area how transparent
this pixel will be. The following options are used to install such a
-fading for the current scope or path.
+fading for the current scope or path.
\pgfdeclarefading{fade down}{%
\tikzset{top color=pgftransparent!0,bottom color=pgftransparent!100}
@@ -376,7 +378,7 @@ fading for the current scope or path.
\begin{key}{/tikz/path fading=\meta{name} (default \normalfont scope's setting)}
This option tells \tikzname\ that the current path should be faded
- with the fading \meta{name}. If no \meta{name} is given, the
+ with the fading \meta{name}. If no \meta{name} is given, the
\meta{name} set for the whole scope is used. Similarly to options
like |draw| or |fill|, this option is reset for each path, so you
have to add it to each path that should be faded. You can also
@@ -404,7 +406,7 @@ fading for the current scope or path.
path. When set to |false|, the fading is only shifted so that it
is centered on the path's center, but it is not resized. This can
be useful for special-purpose fadings, for instance when you use a
- fading to ``punsh out'' something.
+ fading to ``punsh out'' something. % TODOsp: punsh out --> punch out??
\end{key}
\begin{key}{/tikz/fading transform=\meta{transformation options}}
@@ -424,14 +426,14 @@ fading for the current scope or path.
\end{tikzpicture}
\end{codeexample}
\end{key}
-
+
\begin{key}{/tikz/fading angle=\meta{degree}}
A shortcut for |fading transform={rotate=|\meta{degree}|}|.
\end{key}
Note that you can ``fade just about anything.'' In particular, you
can fade a shading.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
% Checker board
@@ -448,7 +450,7 @@ fading for the current scope or path.
\begin{codeexample}[]
\tikzfading[name=fade inside,
inner color=transparent!80,
- outer color=transparent!30]
+ outer color=transparent!30]
\begin{tikzpicture}
% Checker board
\fill [black!20] (0,0) rectangle (4,4);
@@ -488,7 +490,7 @@ visually rather pleasing effects:
\subsubsection{Fading a Scope}
-In addtion to fading individual paths, you may also wish to ``fade a
+In addition to fading individual paths, you may also wish to ``fade a
scope,'' that is, you may wish to install a fading that is used
globally to specify the transparency for all objects drawn inside a
scope. This effect can also be thought of as a ``soft clip'' and it
@@ -498,7 +500,7 @@ in the scope are faded. You will use a |transparency group| in
conjunction, see the end of this section.
\begin{key}{/tikz/scope fading=\meta{fading}}
- In principle, this key works in excatly the same way as the
+ In principle, this key works in exactly the same way as the
|path fading| key. The only difference is, that the effect of the
fading will persist after the current path till the end of the
scope. Thus, the \meta{fading} is applied to all subsequent drawings
@@ -512,7 +514,7 @@ conjunction, see the end of this section.
the |scope fading| option with a |{scope}| only sets the name of the
fading to be used. You have to explicitly provide the |scope fading|
with a path to actually install a fading.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\fill [black!20] (-2,-2) rectangle (2,2);
@@ -554,7 +556,7 @@ conjunction, see the end of this section.
This is some text that will fade out as we go right
and down. It is pretty hard to achieve this effect in
other ways.
-};
+};
\end{codeexample}
\end{key}
@@ -564,7 +566,7 @@ conjunction, see the end of this section.
Consider the following cross and sign. They ``look wrong'' because we
can see how they were constructed, while this is not really part of
-the desired effect.
+the desired effect.
\begin{codeexample}[]
\begin{tikzpicture}[opacity=.5]
@@ -615,9 +617,9 @@ Transparency groups are used to render them correctly:
are painted multiple times (up to three times), but only the last
color ``wins.''
- Then, when the scope is finished, it is painted as a whole. The
+ Then, when the scope is finished, it is painted as a whole. The
\emph{fill} transparency settings are now applied to the resulting
- picutre. For instance, the pixel that has been painted three times
+ picture. For instance, the pixel that has been painted three times
is just red at the end, so this red color will be blended with
whatever is ``behind'' the group on the page.
@@ -625,12 +627,12 @@ Transparency groups are used to render them correctly:
objects in a transparency group that lie outside the picture. This
has to do with internal bounding box computations.
Section~\ref{section-transparency} explains how to sidestep this
- problem.
+ problem.
\end{key}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
index f3f2a514f33..ac0a00bda5f 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
@@ -33,7 +33,7 @@ mathematician or a computer scientist by looking at the direction
their trees grow. A computer scientist's trees will grow downward
while a mathematician's tree will grow upward. Naturally, the
\emph{correct} way is the mathematician's way, which can be specify as
-follows:
+follows:
\begin{codeexample}[]
\begin{tikzpicture}
\node {root} [grow'=up]
@@ -49,7 +49,7 @@ In \tikzname, trees are specified by adding \emph{children} to a
node on a path using the |child| operation:
\begin{pathoperation}{child}{\opt{\oarg{options}}%
- \opt{|foreach|\meta{variables}|in|\marg{values}}\opt{\marg{child path}}}
+ \opt{|foreach|\meta{variables}|in|\marg{values}}\opt{\marg{child path}}}
This operation should directly follow a completed |node| operation
or another |child| operation, although it is permissible that the
first |child| operation is preceded by options (we will come to
@@ -61,7 +61,7 @@ node on a path using the |child| operation:
|child| and its arguments until it reaches a path operation that is
not a |child|. Note that this will fix the character codes of all
text inside the child arguments, which means, in essence, that you
- cannot use verbatim text inside the nodes inside a |child|. Sorry.
+ cannot use verbatim text inside the nodes inside a |child|. Sorry.
Once the children have been collected and counted, \tikzname\ starts
generating the child nodes. For each child of a parent node
@@ -80,7 +80,7 @@ node on a path using the |child| operation:
each value in this list, a new |child| is added to the node. The
syntax for \meta{variables} and for \meta{values} is the same as for
the |\foreach| statement, see Section~\ref{section-foreach}. For
- example, when you say
+ example, when you say
\begin{codeexample}[code only]
node {root} child [red] foreach \name in {1,2} {node {\name}}
\end{codeexample}
@@ -88,7 +88,7 @@ node {root} child [red] foreach \name in {1,2} {node {\name}}
\begin{codeexample}[code only]
node {root} child[red] {node {1}} child[ref] {node {2}}
\end{codeexample}
- When you write
+ When you write
\begin{codeexample}[code only]
node {root} child[\pos] foreach \name/\pos in {1/left,2/right} {node[\pos] {\name}}
\end{codeexample}
@@ -103,7 +103,7 @@ node {root} child[left] {node[left] {1}} child[right] {node[right] {2}}
[level distance=4mm,level/.style={sibling distance=8mm/#1}]
\coordinate
child foreach \x in {0,1}
- {child foreach \y in {0,1}
+ {child foreach \y in {0,1}
{child foreach \z in {0,1}}};
\end{tikzpicture}
\end{codeexample}
@@ -130,7 +130,7 @@ first child, the \meta{child path} has the child node |node {y}|. For
the second child, no child node is specified and, thus, it is just
|coordinate|.
-As for any normal node, you can give the child node a name, shift it
+As for any normal node, you can give the child node a name, shift it
around, or use options to influence how it is rendered.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -147,14 +147,14 @@ node. However, the node specification may be followed by arbitrary
other material that will be added to the picture, transformed to the
child's coordinate system. For your convenience, a move-to |(0,0)|
operation is inserted automatically at the beginning of the path. Here
-is an example:
+is an example:
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
child {[fill] circle (2pt)}
child {[fill] circle (2pt)};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
@@ -210,7 +210,7 @@ Here is an example:
\begin{codeexample}[]
\begin{tikzpicture}
\node (root) {root}
- child
+ child
child {
child {coordinate (special)}
child
@@ -223,6 +223,7 @@ Here is an example:
\end{codeexample}
\subsection{Specifying Options for Trees and Children}
+\label{section-tree-options}
Each |child| may have its own \meta{options}, which apply to ``the
whole child,'' including all of its grandchildren. Here is an
@@ -240,7 +241,7 @@ example:
The options of the root node have no effect on the children since
the options of a node are always ``local'' to that node. Because of
this, the edges in the following tree are black, not red.
-
+
\begin{codeexample}[]
\begin{tikzpicture}[thick]
\node [red] {root}
@@ -328,7 +329,7 @@ There are additional styles that influence how children are rendered:
\begin{stylekey}{/tikz/level \meta{number} (initially \normalfont empty)}
This style is used in addition to the |level| style. So, when you
say |\node {x} child child;|, then the following key list is
- executed: |level=1,level 1|.
+ executed: |level=1,level 1|.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -352,7 +353,7 @@ There are additional styles that influence how children are rendered:
Perhaps the most difficult part in drawing a tree is the correct
layout of the children. Typically, the children have different sizes
and it is not easy to arrange them in such a manner that not too much
-space is wasted, the children do not overlap, and they are either
+space is wasted, the children do not overlap, and they are either
evenly spaced or their centers are evenly distributed. Calculating
good positions is especially difficult since a good position for the
first child may depend on the size of the last child.
@@ -375,14 +376,14 @@ distance between children (appropriately called the
distances may change from level to level. The direction in which the
tree grows can be changed globally and for parts of the tree. You can
even specify your own ``growth function'' to arrange children on a
-circle or along special lines or curves.
+circle or along special lines or curves.
\subsubsection{Default Growth Function}
The default growth function works as follows: Assume that we are given
a node and five children. These children will be placed on a line with
their centers (or, more generally, with their anchors) spaced apart by
-the current |sibling distance|. The line is
+the current |sibling distance|. The line is
orthogonal to the current \emph{direction of growth}, which is set
with the |grow| and |grow'| option (the latter option reverses the
ordering of the children). The distance from the line to the parent node
@@ -402,7 +403,7 @@ is given by the |level distance|.
\draw[|<->|,thick] (root-1.center)
-- node[above,sloped] {sibling distance} (root-2.center);
- \draw[|<->|,thick] (root.center)
+ \draw[|<->|,thick] (root.center)
-- node[above,sloped] {level distance} +(-10:\tikzleveldistance);
\end{tikzpicture}
\end{codeexample}
@@ -410,10 +411,10 @@ is given by the |level distance|.
\begin{key}{/tikz/level distance=\meta{distance} (initially 15mm)}
This key determines the distance between different levels of the
- tree, more precisely, between the parent and the line
+ tree, more precisely, between the parent and the line
on which its children are arranged. When given to a single child,
this will set the distance for this child only.
-
+
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -425,14 +426,14 @@ is given by the |level distance|.
child
child
}
- child[level distance=10mm];
+ child[level distance=10mm];
\end{tikzpicture}
\end{codeexample}
-
+
\begin{codeexample}[]
\begin{tikzpicture}
- [level 1/.style={level distance=10mm},
- level 2/.style={level distance=5mm}]
+ [level 1/.style={level distance=10mm},
+ level 2/.style={level distance=5mm}]
\node {root}
child
child {
@@ -447,7 +448,7 @@ is given by the |level distance|.
\begin{key}{/tikz/sibling distance=\meta{distance} (initially 15mm)}
This key specifies the distance between the anchors of the
- children of a parent node.
+ children of a parent node.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -494,7 +495,7 @@ is given by the |level distance|.
};
\end{tikzpicture}
\end{codeexample}
-\end{key}
+\end{key}
\begin{key}{/tikz/grow=\meta{direction}}
@@ -543,7 +544,7 @@ is given by the |level distance|.
child
child[grow=right] {
child child child
- };
+ };
\end{tikzpicture}
\end{codeexample}
@@ -561,7 +562,7 @@ is given by the |level distance|.
coordinate (wrong)
};
\draw[<-,red] ([yshift=-2mm]wrong) -- +(0,-1)
- node[below]{This is wrong!};
+ node[below]{This is wrong!};
\end{tikzpicture}
\end{codeexample}
@@ -616,10 +617,10 @@ will not be rendered.
to be used for computing the children's position. For example, when
there is only one child and the |level distance| is |2cm|, then the
child node will be placed two centimeters below the \meta{anchor} of
- the parent node. ``Beinng placed'' means that the child node's
+ the parent node. ``Being placed'' means that the child node's
anchor (which is the anchor specified using the |anchor=| option in
the |node| command of the child) is two centimeters below the parent
- node's \meta{anchor}.
+ node's \meta{anchor}.
In the following example, the two red lines both have length |1cm|.
\begin{codeexample}[]
@@ -640,7 +641,7 @@ will not be rendered.
\begin{codeexample}[]
\begin{tikzpicture}
[level distance=2cm,growth parent anchor=north,
- every node/.style={anchor=north,rectangle,draw}
+ every node/.style={anchor=north,rectangle,draw}
every child node/.style={anchor=south}]
\node at (0,0) {root} child {node {small}};
@@ -673,7 +674,7 @@ will not be rendered.
transform the coordinate system further. For example, it could be
rotated or scaled.
- Additional growth functions are defined in the library, see
+ Additional growth functions are defined in the library, see
Section~\ref{section-tree-library}.
\end{key}
@@ -703,7 +704,7 @@ edge called the |edge from parent|. This edge is added to the
This options allows you to set the edge from parent path to a new
path. Initially, this path is the following:
\begin{codeexample}[code only]
-(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)
+(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)
\end{codeexample}
The |\tikzparentnode| is a macro that will expand to the name of
the parent node. This works even when you have not assigned a name
@@ -740,7 +741,7 @@ edge called the |edge from parent|. This edge is added to the
Specifies the anchor where the edge from parent meets the child
node by setting the macro |\tikzchildanchor| to
|.|\meta{anchor}.
-
+
If you specify |border| as the \meta{anchor}, then the macro
|\tikzchildanchor| is set to the empty string. The effect of
this is that the edge from the parent will meet the child on the
@@ -769,10 +770,10 @@ edge called the |edge from parent|. This edge is added to the
also installed prior to inserting the path:
\begin{stylekey}{/tikz/edge from parent (initially draw)}
This style is inserted right before the edge from parent path and
- before the \meta{options} are inserted.
+ before the \meta{options} are inserted.
\begin{codeexample}[]
\begin{tikzpicture}
- [edge from parent/.style={draw,red,thick}]
+ [edge from parent/.style={draw,red,thick}]
\node {root}
child {node {left} edge from parent[dashed]}
child {node {right}
@@ -796,7 +797,7 @@ edge called the |edge from parent|. This edge is added to the
As an example, consider the following code:
\begin{codeexample}[code only]
-\node (root) {} child {node (child) {} edge to parent node {label}};
+\node (root) {} child {node (child) {} edge to parent node {label}};
\end{codeexample}
The |edge to parent| operation and the following |node| operation
will, together, have the same effect as if we had said:
@@ -832,7 +833,7 @@ edge called the |edge from parent|. This edge is added to the
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
-%%% End:
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
index 08f4ce97686..2ca446abecc 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
@@ -21,7 +21,7 @@ publisher). Up to know, he wrote down his text and graphics on
papyrus, but his publisher suddenly insists that he must submit in
electronic form. Euclid tries to argue with the publisher that
electronics will only be discovered thousands of years later, but the
-publisher informs him that the use of amber is no longer cutting edge
+publisher informs him that the use of papyrus is no longer cutting edge
technology and Euclid will just have to keep up with modern tools.
Slightly disgruntled, Euclid starts converting his papyrus
@@ -53,11 +53,10 @@ E. Joyce, to be found on his website at Clark University.}
\draw [input] (A) -- (B);
- \node [help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {};
- \node [help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {};
+ \node [name path=D,help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {};
+ \node [name path=E,help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {};
- \coordinate [label=above:\C]
- (C) at (intersection 2 of D and E);
+ \path [name intersections={of=D and E,by={[label=above:\C]C}}];
\draw [output] (A) -- (C);
\draw [output] (B) -- (C);
@@ -69,7 +68,7 @@ E. Joyce, to be found on his website at Clark University.}
\fill[triangle!80] (A) -- (C) -- (B) -- cycle;
\end{pgfonlayer}
- \node [below right,text width=10cm,text justified] at (4,3)
+ \node [below right,text width=10cm,align=justify] at (4,3)
{
\small
\textbf{Proposition I}\par
@@ -106,26 +105,28 @@ Let us have a look at how Euclid can turn this into \tikzname\ code.
\subsubsection{Setting up the Environment}
As in the previous tutorials, Euclid needs to load \tikzname, together
-with some libraries. These libraries are |calc|, |through|, and
-|backgrounds|. Depending on which format he uses, Euclid would use one
-of the following in the preamble:
+with some libraries. These libraries are |calc|, |intersections|,
+|through|, and |backgrounds|. Depending on which format\footnote{Note
+ that \pgfname/\tikzname{} is not supported by recent Con\TeX t versions
+ (like mark IV, the Lua\TeX-aware part of Con\TeX t).} he uses,
+Euclid would use one of the following in the preamble:
\begin{codeexample}[code only]
% For LaTeX:
\usepackage{tikz}
-\usetikzlibrary{calc,through,backgrounds}
+\usetikzlibrary{calc,intersections,through,backgrounds}
\end{codeexample}
\begin{codeexample}[code only]
% For plain TeX:
\input tikz.tex
-\usetikzlibrary{calc,through,backgrounds}
+\usetikzlibrary{calc,intersections,through,backgrounds}
\end{codeexample}
\begin{codeexample}[code only]
% For ConTeXt:
\usemodule[tikz]
-\usetikzlibrary[calc,through,backgrounds]
+\usetikzlibrary[calc,intersections,through,backgrounds]
\end{codeexample}
@@ -330,48 +331,58 @@ as above.
Euclid can now draw the line and the circles. The final problem is to
compute the intersection of the two circles. This computation is a bit
-involved if you want to do it ``by hand.'' Fortunately, the so-called
-intersection coordinate system allows us to specify points as the
-intersection of two objects (in order for the following code to work,
-the |calc| library must be loaded; it defines the necessary code for
-computing the intersection of circles):
+involved if you want to do it ``by hand.'' Fortunately, the
+intersection library allows us to compute the intersection of
+arbitrary paths.
+
+The idea is simple: First, you ``name'' two paths using the
+|name path| option. Then, at some later point, you can use the option
+|name intersections|, which creates coordinates called
+|intersection-1|, |intersection-2|, and so on at all intersections of
+the paths. Euclid assigns the names |D| and |E| to the paths of the
+two circles (which happen to be the same names as the nodes
+themselves, but nodes and their paths live in different
+``namespaces'').
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
\coordinate [label=right:$B$] (B) at (1.25,0.25);
\draw (A) -- (B);
- \node (D) [draw,circle through=(B),label=left:$D$] at (A) {};
- \node (E) [draw,circle through=(A),label=right:$E$] at (B) {};
+ \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {};
+ \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {};
- \coordinate [label=above:$C$] (C) at (intersection 2 of D and E);
+ % Name the coordinates, but do not draw anything:
+ \path [name intersections={of=D and E}];
+
+ \coordinate [label=above:$C$] (C) at (intersection-1);
\draw [red] (A) -- (C);
\draw [red] (B) -- (C);
\end{tikzpicture}
\end{codeexample}
-We could also have written |intersection 1 of| or just
-|intersection of| to get access to the other intersection of the
-circles.
-
-Although Euclid does not need it for the current picture, it is just a
-small step to computing the bisection of the line $AB$:
+It turns out that this can be further shortened: The
+|name intersections| takes an optional argument |by|, which lets you
+specify names for the coordinates and options for them. This creates
+more compact code. Although Euclid does not need it for the current
+picture, it is just a small step to computing the bisection of the line $AB$:
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
\coordinate [label=right:$B$] (B) at (1.25,0.25);
- \draw (A) -- (B);
+ \draw [name path=A--B] (A) -- (B);
- \node (D) [draw,circle through=(B),label=left:$D$] at (A) {};
- \node (E) [draw,circle through=(A),label=right:$E$] at (B) {};
+ \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {};
+ \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {};
- \coordinate [label=above:$C$] (C) at (intersection 2 of D and E);
- \coordinate [label=below:$C'$] (C') at (intersection 1 of D and E);
+ \path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C'$]C'}}];
- \draw [red] (C) -- (C');
- \node [fill=red,inner sep=1pt,label=-45:$F$] (F) at (intersection of C--C' and A--B) {};
+ \draw [name path=C--C',red] (C) -- (C');
+
+ \path [name intersections={of=A--B and C--C',by=F}];
+ \node [fill=red,inner sep=1pt,label=-45:$F$] at (F) {};
\end{tikzpicture}
\end{codeexample}
@@ -398,10 +409,10 @@ end.
\draw [input] (A) -- (B);
- \node [help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {};
- \node [help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {};
+ \node [name path=D,help lines,draw,label=left:\D] (D) at (A) [circle through=(B)] {};
+ \node [name path=E,help lines,draw,label=right:\E] (E) at (B) [circle through=(A)] {};
- \coordinate [label=above:\C] (C) at (intersection 2 of D and E);
+ \path [name intersections={of=D and E,by={[label=above:\C]C}}];
\draw [output] (A) -- (C) -- (B);
@@ -412,7 +423,7 @@ end.
\fill[triangle!80] (A) -- (C) -- (B) -- cycle;
\end{pgfonlayer}
- \node [below right, text width=10cm,text justified] at (4,3) {
+ \node [below right, text width=10cm,align=justify] at (4,3) {
\small\textbf{Proposition I}\par
\emph{To construct an \textcolor{triangle}{equilateral triangle}
on a given \textcolor{input}{finite straight line}.}
@@ -449,20 +460,23 @@ The second proposition in the Elements is the following:
\draw [help lines] (D) -- ($ (D)!3.75!(A) $) coordinate [label=-135:\E] (E);
\draw [help lines] (D) -- ($ (D)!3.75!(B) $) coordinate [label=-45:\F] (F);
- \node (H) at (B) [help lines,circle through=(C),draw,label=135:\H] {};
-
- \coordinate [label=right:\G] (G) at (intersection of B--F and H);
+ \node (H) at (B) [name path=H,help lines,circle through=(C),draw,label=135:\H] {};
+ \path [name path=B--F] (B) -- (F);
+ \path [name intersections={of=H and B--F}]
+ coordinate [label=right:\G] (G) at (intersection-1);
- \node (K) at (D) [help lines,circle through=(G),draw,label=135:\K] {};
+ \node (K) at (D) [name path=K,help lines,circle through=(G),draw,label=135:\K] {};
- \coordinate [label=below:\L] (L) at (intersection of A--E and K);
+ \path [name path=A to E line] (A) -- (E);
+ \path [name intersections={of=K and A to E line}]
+ coordinate [label=below:\L] (L) at (intersection-1);
\draw [output] (A) -- (L);
\foreach \point in {A,B,C,D,G,L}
\fill [black,opacity=.5] (\point) circle (2pt);
- \node [below right, text width=9cm,text justified] at (4,4) {
+ \node [below right, text width=9cm,align=justify] at (4,4) {
\small\textbf{Proposition II}\par
\emph{To place a \textcolor{output}{straight line} equal to a
given \textcolor{input}{straight line} with
@@ -602,6 +616,7 @@ straight line to \meta{q}.
We know that the point $G$ is on the way from $B$ to $F$. The distance
is given by the radius of the circle~$H$. Here is the code form
computing $H$:
+{\tikzexternaldisable
\begin{codeexample}[pre={
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -610,17 +625,18 @@ computing $H$:
\draw (A) -- (B) -- (C);
\coordinate [label=above:$D$] (D) at
($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {};
- \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {};
\draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F);
\draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E);
},post={\end{tikzpicture}}]
+ \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {};
\path let \p1 = ($ (B) - (C) $) in
coordinate [label=left:$G$] (G) at ($ (B) ! veclen(\x1,\y1) ! (F) $);
\fill[red,opacity=.5] (G) circle (2pt);
\end{codeexample}
-However, there is a simpler way: As for circles, we can also intersect
-a line and a circle using the |intersection| coordinate system:
+However, there is a simpler way: We can simply name the path of the
+circle and of the line in question and then use |name intersections|
+to compute the intersections.
\begin{codeexample}[pre={
\begin{tikzpicture}
@@ -630,13 +646,15 @@ a line and a circle using the |intersection| coordinate system:
\draw (A) -- (B) -- (C);
\coordinate [label=above:$D$] (D) at
($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {};
- \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {};
\draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F);
\draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E);
},post={\end{tikzpicture}}]
- \coordinate [label=left:$G$] (G) at (intersection of B--F and H);
+ \node (H) [name path=H,label=135:$H$,draw,circle through=(C)] at (B) {};
+ \path [name path=B--F] (B) -- (F);
+ \path [name intersections={of=H and B--F,by={[label=left:$G$]G}}];
\fill[red,opacity=.5] (G) circle (2pt);
\end{codeexample}
+}%
\subsubsection{The Complete Code}
@@ -662,13 +680,13 @@ a line and a circle using the |intersection| coordinate system:
\draw [help lines] (D) -- ($ (D)!3.75!(A) $) coordinate [label=-135:\E] (E);
\draw [help lines] (D) -- ($ (D)!3.75!(B) $) coordinate [label=-45:\F] (F);
- \node (H) at (B) [help lines,circle through=(C),draw,label=135:\H] {};
-
- \coordinate [label=right:\G] (G) at (intersection of B--F and H);
+ \node (H) at (B) [name path=H,help lines,circle through=(C),draw,label=135:\H] {};
+ \path [name path=B--F] (B) -- (F);
+ \path [name intersections={of=H and B--F,by={[label=right:\G]G}}];
- \node (K) at (D) [help lines,circle through=(G),draw,label=135:\K] {};
-
- \coordinate [label=below:\L] (L) at (intersection of A--E and K);
+ \node (K) at (D) [name path=K,help lines,circle through=(G),draw,label=135:\K] {};
+ \path [name path=A--E] (A) -- (E);
+ \path [name intersections={of=K and A--E,by={[label=below:\L]L}}];
\draw [output] (A) -- (L);
@@ -677,4 +695,4 @@ a line and a circle using the |intersection| coordinate system:
% \node ...
\end{tikzpicture}
-\end{codeexample} \ No newline at end of file
+\end{codeexample}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
index f7b8d211110..725702513fb 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
@@ -28,14 +28,14 @@ using pens and rules, it looks like this\footnote{The shown diagram was not scan
% The size:
minimum size=6mm,
% The border:
- very thick,
+ very thick,
draw=red!50!black!50, % 50% red and 50% black,
% and that mixed with 50% white
% The filling:
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
% Font
- font=\itshape
+ font=\itshape
},
terminal/.style={
% The shape:
@@ -74,7 +74,7 @@ using pens and rules, it looks like this\footnote{The shown diagram was not scan
\node [support] (after dot) {};
\node [terminal] {digit};
\node [support] (after digit) {};
- \node [support] (skip) {};
+ \node [support] (skip) {};
\node [support] (before E) {};
\node [terminal] {E};
\node [support] (after E) {};
@@ -186,14 +186,14 @@ corners involved. Naturally, she sets up a style:
% The size:
minimum size=6mm,
% The border:
- very thick,
+ very thick,
draw=red!50!black!50, % 50% red and 50% black,
% and that mixed with 50% white
% The filling:
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
% Font
- font=\itshape
+ font=\itshape
}]
\node [nonterminal] {unsigned integer};
\end{tikzpicture}
@@ -260,7 +260,7 @@ nodes is not aligned:
\p3 = (E.base)
in (-.5,\y1) -- (3.5,\y1)
(-.5,\y2) -- (3.5,\y2)
- (-.5,\y3) -- (3.5,\y3);
+ (-.5,\y3) -- (3.5,\y3);
\end{tikzpicture}
\end{codeexample}
\noindent (Ilka has moved the style definition to the preamble by
@@ -316,7 +316,7 @@ graphics this is perfectly alright, but it has several disadvantages:
recalculate the coordinates.
\item The source code of the graphic is not very clear since the
relationships between the positions of the nodes are not made
- explicit.
+ explicit.
\end{enumerate}
For these reasons, Ilka decides to try out different ways of arranging
@@ -376,7 +376,7 @@ does not affect anchors, she gets the following result:
\end{tikzpicture}
\end{codeexample}
A third way is to use matrices, which we will do later.
-
+
Now that the nodes have been placed, Ilka needs to add
connections. Here, some connections are more difficult than
other. Consider for instance the ``repeat'' line around the
@@ -397,7 +397,7 @@ Ilka can put this into code as follows:
% start right of digit.east, that is, at the point that is the
% linear combination of digit.east and the vector (2mm,0pt). We
% use the ($ ... $) notation for computing linear combinations
- ($ (digit.east) + (2mm,0) $)
+ ($ (digit.east) + (2mm,0) $)
% Now go down
-- ++(0,-.5)
% And back to the left of digit.west
@@ -425,7 +425,7 @@ setup a style that contains the correct path:
\end{codeexample}
Ilka can even go a step further and make her |skip look| style
-parametrized. For this, the skip loop's vertical offset is passed as
+parameterized. For this, the skip loop's vertical offset is passed as
parameter |#1|. Also, in the following code Ilka specifies the start
and targets differently, namely as the positions that are ``in the
middle between the nodes.''
@@ -472,7 +472,7 @@ containing only the minus node.
&
\node [nonterminal] {unsigned integer}; \\
% Third row:
- & & & & \node [terminal] {-}; & \\
+ & & & & \node [terminal] {-}; & \\
};
\end{tikzpicture}
\end{codeexample}
@@ -606,7 +606,7 @@ option.
When the first branch ends, only the plus node has been added and the
current chain is the original chain once more and we are back to the
|E| node. Now we start a new branch for the minus node. After this
-branch, the current chain ens at |E| node once more.
+branch, the current chain ends at |E| node once more.
Finally, the rightmost unsigned integer is added to the (main) chain,
which is why it is joined correctly with the |E| node. The two
@@ -652,9 +652,9 @@ to be used for the join.
\begin{codeexample}[]
\begin{tikzpicture}[start chain,node distance=5mm and 2mm,
- every node/.style={on chain},
- nonterminal/.append style={join=by ->},
- terminal/.append style={join=by ->},
+ every node/.style={on chain},
+ nonterminal/.append style={join=by ->},
+ terminal/.append style={join=by ->},
point/.style={join=by -,circle,fill=red,minimum size=2pt,inner sep=0pt}]
\node [point] {}; \node [nonterminal] {unsigned integer};
\node [point] {}; \node [terminal] {.};
@@ -693,8 +693,8 @@ node name and optionally some options. The effect is that the named
node is made part of the current chain.
\begin{codeexample}[pre={\tikzset{node distance=5mm and 2mm,
- every node/.style={on chain},
- terminal/.append style={join=by ->},
+ every node/.style={on chain},
+ terminal/.append style={join=by ->},
point/.style={join=by -,circle,fill=red,minimum size=2pt,inner sep=0pt}}}]
\begin{tikzpicture}[start chain] % plus some styles that are not shown
\node [point] {};
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex
new file mode 100644
index 00000000000..ec0ea535f38
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex
@@ -0,0 +1,1301 @@
+% Copyright 2008 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\section{Tutorial: A Lecture Map for Johannes}
+
+In this tutorial we explore the tree and mind map mechanisms of
+\tikzname.
+
+Johannes is quite excited: For the first time he will be teaching a
+course all by himself during the upcoming semester! Unfortunately, the
+course is not on his favorite subject, which is of course Theoretical Immunology,
+but on Complexity Theory, but as a young academic Johannes is not
+likely to complain too loudly. In order to help the students get a
+general overview of what is going to happen during the course as a
+whole, he intends to draw some kind of tree or graph containing the
+basic concepts. He got this idea from his old professor who seems to
+be using these ``lecture maps'' with some success. Independently of
+the success of these maps, Johannes thinks they look quite neat.
+
+
+
+\subsection{Problem Statement}
+
+Johannes wishes to create a lecture map with the following features:
+\begin{enumerate}
+\item It should contain a tree or graph depicting the main concepts.
+\item It should somehow visualize the different lectures that will be
+ taught. Note that the lectures are not necessarily the same as the
+ concepts since the graph may contain more concepts than will be
+ addressed in lectures and some concepts may be addressed during more
+ than one lecture.
+\item The map should also contain a calendar showing when the
+ individual lectures will be given.
+\item The aesthetical reasons, the whole map should have a visually
+ nice and information-rich background.
+\end{enumerate}
+
+As always, Johannes will have to include the right libraries and
+setup the environment. Since Johannes is going to use the
+|mindmap| library and since he wishes to show a calendar, he will need
+the |mindmap| and the |calendar| libraries. In order to put something
+on a background layer, it seems like a good idea to also include the
+|background| library.
+
+
+\subsection{Introduction to Trees}
+
+The first choice Johannes must make is whether he will organize the
+concepts are a tree, with root concepts and concept branches and leaf
+concepts, or as a general graph. The tree implicitly organizes the
+concepts, while a graph is more flexible. Johannes decides to
+compromise: Basically, the concepts will be organized as a
+tree. However, he will selectively add connections between concepts
+that are related, but which appear on different levels or branches of
+the tree.
+
+Johannes starts with a tree-like list of concepts that he feels are
+important in Computational Complexity:
+
+\begin{itemize}
+\item Computational Problems
+ \begin{itemize}\itemsep=0pt\parskip=0pt
+ \item Problem Measures
+ \item Problem Aspects
+ \item Problem Domains
+ \item Key Problems
+ \end{itemize}
+\item Computational Models
+ \begin{itemize}\itemsep=0pt\parskip=0pt
+ \item Turing Machines
+ \item Random-Access Machines
+ \item Circuits
+ \item Binary Decision Diagrams
+ \item Oracle Machines
+ \item Programming in Logic
+ \end{itemize}
+\item Measuring Complexity
+ \begin{itemize}\itemsep=0pt\parskip=0pt
+ \item Complexity Measures
+ \item Classifying Complexity
+ \item Comparing Complexity
+ \item Describing Complexity
+ \end{itemize}
+\item Solving Problems
+ \begin{itemize}\itemsep=0pt\parskip=0pt
+ \item Exact Algorithms
+ \item Randomization
+ \item Fixed-Parameter Algorithms
+ \item Parallel Computation
+ \item Partial Solutions
+ \item Approximation
+ \end{itemize}
+\end{itemize}
+
+Johannes will surely need to modify this list later on, but it looks
+good as a first approximation. He will also need to add a number of
+subtopics (like \emph{lots} of complexity classes under the topic
+``classifying complexity''), but he will do this as he constructs the
+map.
+
+Turning the list of topics into a \tikzname-tree is easy, in
+principle. The basic idea is that a node can have \emph{children},
+which in turn can have children of their own, and so on. To add a
+child to a node, Johannes can simply write |child {|\meta{node}|}|
+right after a node. The \meta{node} should, in turn, be the code for
+creating a node. To add another node, Johannes can use |child| once
+more, and so on. Johannes is eager to try out this construct and
+writes down the following:
+
+\begin{codeexample}[]
+\tikz
+ \node {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child { node {Computational Models}
+ child { node {Turing Machines} }
+ child { node {Random-Access Machines} }
+ child { node {Circuits} }
+ child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} }
+ child { node {Programming in Logic} }
+ }
+ child { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} }
+ child { node {Describing Complexity} }
+ }
+ child { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} }
+ child { node {Parallel Computation} }
+ child { node {Partial Solutions} }
+ child { node {Approximation} }
+ };
+\end{codeexample}
+
+Well, that did not quite work out as expected (although, what,
+exactly, did one expect?). There are two problems:
+\begin{enumerate}
+\item The overlap of the nodes is due to the fact that \tikzname\ is
+ not particularly smart when it comes to placing child nodes. Even
+ though it is possible to configure \tikzname\ to use rather clever
+ placement methods, \tikzname\ has no way of taking the actual size
+ of the child nodes into account. This may seem strange but the
+ reason is that the child nodes are rendered and placed one at a
+ time, so the size of the last node is not known when the first node
+ is being processed. In essence, you have to specify appropriate
+ level and sibling node spacings ``by hand.''
+\item The standard computer-science-top-down rendering of a tree is
+ rather ill-suited to visualizing the concepts. It would be better to
+ either rotate the map by ninety degrees or, even better, to use some
+ sort of circular arrangement.
+\end{enumerate}
+
+Johannes redraws the tree, but this time with some more appropriate
+options set, which he found more or less by trial-and-error:
+
+\begin{codeexample}[render instead={
+\tikz [font=\footnotesize,
+ grow=right, level 1/.style={sibling distance=6em},
+ level 2/.style={sibling distance=1em}, level distance=5cm]
+ \node {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} } child { node {Problem Aspects} }
+ child { node {Problem Domains} } child { node {Key Problems} }
+ }
+ child { node {Computational Models}
+ child { node {Turing Machines} } child { node {Random-Access Machines} }
+ child { node {Circuits} } child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} } child { node {Programming in Logic} }
+ }
+ child { node {Measuring Complexity}
+ child { node {Complexity Measures} } child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} } child { node {Describing Complexity} }
+ }
+ child { node {Solving Problems}
+ child { node {Exact Algorithms} } child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} }
+ child { node {Partial Solutions} } child { node {Approximation} }
+ };
+ }]
+\tikz [font=\footnotesize,
+ grow=right, level 1/.style={sibling distance=6em},
+ level 2/.style={sibling distance=1em}, level distance=5cm]
+ \node {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ ... % as before
+\end{codeexample}
+
+Still not quite what Johannes had in mind, but he is getting
+somewhere.
+
+For configuring the tree, two parameters are of particular importance:
+The |level distance| tells \tikzname\ the distance between (the
+centers of) the nodes on adjacent levels or layers of a tree. The
+|sibling distance| is, as the name suggests, the distance between (the
+centers of) siblings of the tree.
+
+You can globally set these parameters for a tree by simply setting
+them somewhere before the tree starts, but you will
+typically wish them to be different for different levels of the
+tree. In this case, you should set styles like |level 1| or
+|level 2|. For the first level of the tree, the |level 1| style is
+used, for the second level the |level 2| style, and so on. You can
+also set the sibling and level distances only for certain nodes by
+passing these options to the |child| command as options. (Note that
+the options of a |node| command are local to the node and have no
+effect on the children. Also note that it is possible to specify
+options that do have an effect on the children. Finally note that
+specifying options for children ``at the right place'' is an arcane
+art and you should peruse Section~\ref{section-tree-options} on
+a rainy Sunday afternoon, if you are really interested.)
+
+The |grow| key is used to configure the direction in which a tree
+grows. You can change growth direction ``in the middle of a tree''
+simply by changing this key for a single child or a whole level. By
+including the |tree| library you also get access to additional growth
+strategies such as a ``circular'' growth:
+
+
+\begin{codeexample}[render instead={
+\tikz [text width=2.7cm, align=flush center,
+ grow cyclic,
+ level 1/.style={level distance=2.5cm,sibling angle=90},
+ level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}]
+ \node[font=\bfseries] {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} } child { node {Problem Aspects} }
+ child { node {Problem Domains} } child { node {Key Problems} }
+ }
+ child { node {Computational Models}
+ child { node {Turing Machines} } child { node {Random-Access Machines} }
+ child { node {Circuits} } child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} } child { node {Programming in Logic} }
+ }
+ child { node {Measuring Complexity}
+ child { node {Complexity Measures} } child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} } child { node {Describing Complexity} }
+ }
+ child { node {Solving Problems}
+ child { node {Exact Algorithms} } child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} }
+ child { node {Partial Solutions} } child { node {Approximation} }
+ };
+ }]
+\tikz [text width=2.7cm, align=flush center,
+ grow cyclic,
+ level 1/.style={level distance=2.5cm,sibling angle=90},
+ level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}]
+ \node[font=\bfseries] {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ ... % as before
+\end{codeexample}
+
+
+Johannes is pleased to learn that he can access and manipulate the
+nodes of tree like any normal node. In particular, he can name them
+using the |name=| option or the |(|\meta{name}|)| notation and he can
+use any available shape or style for the trees nodes. He can connect
+trees later on using the normal |\draw (some node) -- (another node);|
+syntax. In essence, the |child| command just computes an appropriate
+position for a node and adds a line from the child to the parent
+node.
+
+
+\subsection{Creating the Lecture Map}
+
+Johannes now has a first possible layout for his lecture map. The next
+step is to make it ``look nicer.'' For this, the |mindmap| library is
+helpful since it makes a number of styles available that will make a
+tree look like a nice ``mind map'' or ``concept map.''
+
+The first step is to include the |mindmap| library, which Johannes
+already did. Next, he must add one of the following options to a scope
+that will contain the lecture map: |mindmap| or |large mindmap| or
+|huge mindmap|. These options all have the same effect, except that
+for a |large mindmap| the predefined font size and node sizes are
+somewhat larger than for a standard |mindmap| and for a |huge mindmap|
+they are even larger. So, a |large mindmap| does not necessarily need
+to have a lot of concepts, but it will need a lot of paper.
+
+The second step is to add the |concept| option to every node that
+will, indeed, be a concept of the mindmap. The idea is that some nodes
+of a tree will be real concepts, while other nodes might just be
+``simple children.'' Typically, this is not the case, so you might
+consider saying |every node/.style=concept|.
+
+The third step is to setup the sibling \emph{angle} (rather than a
+sibling distance) to specify the angle between sibling concepts.
+
+\begin{codeexample}[render instead={
+\tikz [mindmap, every node/.style=concept, concept color=black!20,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \node [root concept] {Computational Complexity} % root
+ child { node {\hbox to 2cm{Computational\hss} Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child { node {\hbox to 2cm{Computational\hss} Models}
+ child { node {Turing Machines} }
+ child { node {Random-Access Machines} }
+ child { node {Circuits} }
+ child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} }
+ child { node {\hbox to1.5cm{Programming\hss} in Logic} }
+ }
+ child { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} }
+ child { node {Describing Complexity} }
+ }
+ child { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ child { node {\hbox to 1.5cm{Randomization\hss}} }
+ child { node {Fixed-Parameter Algorithms} }
+ child { node {Parallel Computation} }
+ child { node {Partial Solutions} }
+ child { node {\hbox to1.5cm{Approximation\hss}} }
+ };}]
+\tikz [mindmap, every node/.style=concept, concept color=black!20,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \node [root concept] {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ ... % as before
+\end{codeexample}
+
+When Johannes typesets the above map, \TeX\ (rightfully) starts
+complaining about several overfull boxes and, indeed, words like
+``Randomization'' stretch out beyond the circle of the concept. This
+seems a bit mysterious at first sight: Why does \TeX\ not hyphenate
+the word? The reason is that \TeX\ will never hyphenate the first word
+of a paragraph because it starts looking for ``hyphenatable'' letters
+only after a so-called glue. In order to have \TeX\ hyphenate these
+single words, Johannes must use a bit of evil trickery: He inserts a
+|\hskip0pt| before the word. This has no effect except for inserting
+an (invisible) glue before the word and, thereby, allowing \TeX\ to
+hyphenate the first word also. Since Johannes does not want to add
+|\hskip0pt| inside each node, he uses the |execute at begin node|
+option to make \tikzname\ insert this text with every node.
+
+
+\begin{codeexample}[render instead={
+\begin{tikzpicture}
+ [mindmap,
+ every node/.style={concept, execute at begin node=\hskip0pt},
+ concept color=black!20,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \clip (-1,2) rectangle ++ (-4,5);
+ \node [root concept] {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child { node {Computational Models}
+ child { node {Turing Machines} }
+ child { node {Random-Access Machines} }
+ child { node {Circuits} }
+ child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} }
+ child { node {Programming in Logic} }
+ }
+ child { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} }
+ child { node {Describing Complexity} }
+ }
+ child { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} }
+ child { node {Parallel Computation} }
+ child { node {Partial Solutions} }
+ child { node {Approximation} }
+ };
+\end{tikzpicture}
+}]
+\begin{tikzpicture}
+ [mindmap,
+ every node/.style={concept, execute at begin node=\hskip0pt},
+ concept color=black!20,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \clip (-1,2) rectangle ++ (-4,5);
+ \node [root concept] {Computational Complexity} % root
+ child { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ ... % as before
+\end{tikzpicture}
+\end{codeexample}
+
+
+In the above example a clipping was used to show only part of the
+lecture map, in order to save space. The same will be done in the
+following examples, we return to the complete lecture map at the end of this
+tutorial.
+
+Johannes is now eager to colorize the map. The idea is to use
+different colors for different parts of the map. He can then, during
+his lectures, talk about the ``green'' or the ``red'' topics. This
+will make it easier for his students to locate the topic he is talking
+about on the map. Since ``computational problems'' somehow sounds
+``problematic,'' Johannes chooses red for them, while he picks green
+for the ``solving problems.'' The topics ``measuring complexity'' and
+``computational models'' get more neutral colors; Johannes picks
+orange and blue.
+
+To set the colors, Johannes must use the |concept color| option,
+rather than just, say, |node [fill=red]|. Setting just the fill color
+to |red| would, indeed, make the node red, but it would \emph{just}
+make the node red and not the bar connecting the concept to its parent
+and also not its children. By comparison, the special |concept color|
+option will not only set the color of the node and its children, but
+it will also (magically) create appropriate shadings so that the color
+of a parent concept smoothly changes to the color of a child concept.
+
+For the root concept Johannes decides to do something special: He sets
+the concept color to black, sets the line width to a large value, and
+sets the fill color to white. The effect of this is that the root
+concept will encircled with a thick black line and the children are
+connected to the central concept via bars.
+
+\begin{codeexample}[render instead={
+\begin{tikzpicture}
+ [mindmap,
+ every node/.style={concept, execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black},
+ text=white,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \clip (0,-1) rectangle ++(4,5);
+ \node [root concept] {Computational Complexity} % root
+ child [concept color=red] { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child [concept color=blue] { node {Computational Models}
+ child { node {Turing Machines} }
+ child { node {Random-Access Machines} }
+ child { node {Circuits} }
+ child { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} }
+ child { node {Programming in Logic} }
+ }
+ child [concept color=orange] { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} }
+ child { node {Describing Complexity} }
+ }
+ child [concept color=green!50!black] { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} }
+ child { node {Parallel Computation} }
+ child { node {Partial Solutions} }
+ child { node {Approximation} }
+ };
+ \end{tikzpicture}}]
+\begin{tikzpicture}
+ [mindmap,
+ every node/.style={concept, execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black, fill=white, line width=1ex, text=black},
+ text=white,
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90},
+ level 2/.append style={level distance=3cm,sibling angle=45}]
+ \clip (0,-1) rectangle ++(4,5);
+ \node [root concept] {Computational Complexity} % root
+ child [concept color=red] { node {Computational Problems}
+ child { node {Problem Measures} }
+ ... % as before
+ }
+ child [concept color=blue] { node {Computational Models}
+ child { node {Turing Machines} }
+ ... % as before
+ }
+ child [concept color=orange] { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ ... % as before
+ }
+ child [concept color=green!50!black] { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ ... % as before
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+Johannes adds three finishing touches: First, he changes the font
+of the main concepts to small caps. Second, he decides that some
+concepts should be ``faded,'' namely those that are important in
+principle and belong on the map, but which he will not talk about in
+his lecture. To achieve this, Johannes defines four styles, one for
+each of the four main branches. These styles (a) setup the
+correct concept color for the whole branch and (b) define the |faded|
+style appropriately for this branch. Third, he adds a
+|circular drop shadow|, defined in the |shadows| library, to the
+concepts, just to make things look a bit more fancy.
+
+\begin{codeexample}[render instead={
+\begin{tikzpicture}[mindmap]
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+ \node [root concept] {Computational Complexity} % root
+ child [computational problems] { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child [faded] { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child [computational models] { node {Computational Models}
+ child { node {Turing Machines} }
+ child [faded] { node {Random-Access Machines} }
+ child { node {Circuits} }
+ child [faded] { node {Binary Decision Diagrams} }
+ child { node {Oracle Machines} }
+ child { node {Programming in Logic} }
+ }
+ child [measuring complexity] { node {Measuring Complexity}
+ child { node {Complexity Measures} }
+ child { node {Classifying Complexity} }
+ child { node {Comparing Complexity} }
+ child [faded] { node {Describing Complexity} }
+ }
+ child [solving problems] { node {Solving Problems}
+ child { node {Exact Algorithms} }
+ child { node {Randomization} }
+ child { node {Fixed-Parameter Algorithms} }
+ child { node {Parallel Computation} }
+ child { node {Partial Solutions} }
+ child { node {Approximation} }
+ };
+ \end{scope}
+\end{tikzpicture}}]
+\begin{tikzpicture}[mindmap]
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black, fill=white, line width=1ex, text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+ \node [root concept] {Computational Complexity} % root
+ child [computational problems] { node {Computational Problems}
+ child { node {Problem Measures} }
+ child { node {Problem Aspects} }
+ child [faded] { node {Problem Domains} }
+ child { node {Key Problems} }
+ }
+ child [computational models] { node {Computational Models}
+ child { node {Turing Machines} }
+ child [faded] { node {Random-Access Machines} }
+ ...
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+
+
+\subsection{Adding the Lecture Annotations}
+
+Johannes will give about a dozen lectures during the course
+``computational complexity.'' For each lecture he has compiled a
+(short) list of learning targets that state what knowledge and
+qualifications his students should acquire during this particular
+lecture (note that learning targets are not the same as the contents
+of a lecture). For each lecture he intends to put a little rectangle
+on the map containing these learning targets and the name of the
+lecture, each time somewhere near to the topic of the lecture. Such
+``little rectangles'' are called ``annotations'' by the mindmap
+library.
+
+In order to place the annotations next to the concepts, Johannes must
+assign names to the nodes of the concepts. He could rely on
+\tikzname's automatic naming of the nodes in a tree, where the
+children of a node named |root| are named |root-1|, |root-2|,
+|root-3|, and so on. However, since Johannes is not sure about the
+final order of the concepts in the tree, it seems better to explicitly
+name all concepts of the tree in the following manner:
+
+\begin{codeexample}[code only]
+\node [root concept] (Computational Complexity) {Computational Complexity}
+ child [computational problems] { node (Computational Problems) {Computational Problems}
+ child { node (Problem Measures) {Problem Measures} }
+ child { node (Problem Aspects) {Problem Aspects} }
+ child [faded] { node (Problem Domains) {Problem Domains} }
+ child { node (Key Problems) {Key Problems} }
+ }
+...
+\end{codeexample}
+
+The |annotation| style of the mind map library mainly sets up a
+rectangular shape of appropriate size. Johannes configures the style
+by defining |every annotation| appropriately.
+
+\begin{codeexample}[render instead={
+\begin{tikzpicture}[mindmap]
+ \clip (-5.25,-3) rectangle ++ (4,5);
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+ \node [root concept] (Computational Complexity) {Computational Complexity} % root
+ child [computational problems] { node (Computational Problems) {Computational Problems}
+ child { node (Problem Measures) {Problem Measures} }
+ child { node (Problem Aspects) {Problem Aspects} }
+ child [faded] { node (problem Domains) {Problem Domains} }
+ child { node (Key Problems) {Key Problems} }
+ }
+ child [computational models] { node (Computational Models) {Computational Models}
+ child { node (Turing Machines) {Turing Machines} }
+ child [faded] { node (Random-Access Machines) {Random-Access Machines} }
+ child { node (Circuits) {Circuits} }
+ child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} }
+ child { node (Oracle Machines) {Oracle Machines} }
+ child { node (Programming in Logic) {Programming in Logic} }
+ }
+ child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity}
+ child { node (Complexity Measures) {Complexity Measures} }
+ child { node (Classifying Complexity) {Classifying Complexity} }
+ child { node (Comparing Complexity) {Comparing Complexity} }
+ child [faded] { node (Describing Complexity) {Describing Complexity} }
+ }
+ child [solving problems] { node (Solving Problems) {Solving Problems}
+ child { node (Exact Algorithms) {Exact Algorithms} }
+ child { node (Randomization) {Randomization} }
+ child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} }
+ child { node (Parallel Computation) {Parallel Computation} }
+ child { node (Partial Solutions) {Partial Solutions} }
+ child { node (Approximation) {Approximation} }
+ };
+ \end{scope}
+ \begin{scope}[every annotation/.style={fill=black!40}]
+ \node [annotation, above] at (Computational Problems.north) {
+ Lecture 1: Computational Problems
+ \begin{itemize}
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ \end{itemize}
+ };
+ \end{scope}
+\end{tikzpicture}}]
+\begin{tikzpicture}[mindmap]
+ \clip (-5,-5) rectangle ++ (4,5);
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow, ...}] % as before
+ \node [root concept] (Computational Complexity) ... % as before
+ \end{scope}
+
+ \begin{scope}[every annotation/.style={fill=black!40}]
+ \node [annotation, above] at (Computational Problems.north) {
+ Lecture 1: Computational Problems
+ \begin{itemize}
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ \end{itemize}
+ };
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+
+Well, that does not yet look quite perfect. The spacing or the
+|{itemize}| is not really appropriate and the node is too
+large. Johannes can configure these things ``by hand,'' but it seems
+like a good idea to define a macro that will take care of these things
+for him. The ``right'' way to do this is to define a |\lecture| macro
+that takes a list of key-value pairs as argument and produces the
+desired annotation. However, to keep things simple, Johannes'
+|\lecture| macro simply takes a fixed number of arguments having the
+following meaning: The first argument is the number of the lecture,
+the second is the name of the lecture, the third are positioning
+options like |above|, the fourth is the position where the node is
+placed, the fifth is the list of items to be shown, and the sixth is a
+date when the lecture will be held (this parameter is not yet needed,
+we will, however, need it later on).
+
+\begin{codeexample}[code only]
+\def\lecture#1#2#3#4#5#6{
+ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) {
+ Lecture #1: \textcolor{orange}{\textbf{#2}}
+ \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
+ \parskip=0pt\labelwidth=8pt\leftmargin=8pt
+ \itemindent=0pt\labelsep=2pt}
+ #5
+ \endlist
+ };
+}
+\end{codeexample}
+\def\lecture#1#2#3#4#5#6{
+ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) {
+ Lecture #1: \textcolor{orange}{\textbf{#2}}
+ \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
+ \parskip=0pt\labelwidth=8pt\leftmargin=8pt
+ \itemindent=0pt\labelsep=2pt}
+ #5
+ \endlist
+ };
+}
+
+\begin{codeexample}[render instead={
+\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}]
+ \clip (-5.25,-3) rectangle ++ (4,5);
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+ \node [root concept] (Computational Complexity) {Computational Complexity} % root
+ child [computational problems] { node (Computational Problems) {Computational Problems}
+ child { node (Problem Measures) {Problem Measures} }
+ child { node (Problem Aspects) {Problem Aspects} }
+ child [faded] { node (problem Domains) {Problem Domains} }
+ child { node (Key Problems) {Key Problems} }
+ }
+ child [computational models] { node (Computational Models) {Computational Models}
+ child { node (Turing Machines) {Turing Machines} }
+ child [faded] { node (Random-Access Machines) {Random-Access Machines} }
+ child { node (Circuits) {Circuits} }
+ child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} }
+ child { node (Oracle Machines) {Oracle Machines} }
+ child { node (Programming in Logic) {Programming in Logic} }
+ }
+ child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity}
+ child { node (Complexity Measures) {Complexity Measures} }
+ child { node (Classifying Complexity) {Classifying Complexity} }
+ child { node (Comparing Complexity) {Comparing Complexity} }
+ child [faded] { node (Describing Complexity) {Describing Complexity} }
+ }
+ child [solving problems] { node (Solving Problems) {Solving Problems}
+ child { node (Exact Algorithms) {Exact Algorithms} }
+ child { node (Randomization) {Randomization} }
+ child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} }
+ child { node (Parallel Computation) {Parallel Computation} }
+ child { node (Partial Solutions) {Partial Solutions} }
+ child { node (Approximation) {Approximation} }
+ };
+ \end{scope}
+ \lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+\end{tikzpicture}}]
+\begin{tikzpicture}[mindmap,every annotation/.style={fill=white}]
+ \clip (-5,-5) rectangle ++ (4,5);
+ \begin{scope}[
+ every node/.style={concept, circular drop shadow, ... % as before
+ \node [root concept] (Computational Complexity) ... % as before
+ \end{scope}
+
+ \lecture{1}{Computational Problems}{above,xshift=-3mm}
+ {Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+\end{tikzpicture}
+\end{codeexample}
+
+In the same fashion Johannes can now add the other lecture
+annotations. Obviously, Johannes will have some trouble fitting
+everything on a single A4-sized page, but by adjusting the spacing and
+some experimentation he can quickly arrange all the annotations as needed.
+
+
+\subsection{Adding the Background}
+
+Johannes has already used colors to organize his lecture map into four
+regions, each having a different color. In order to emphasize these
+regions even more strongly, he wishes to add a background coloring to
+each of these regions.
+
+Adding these background colors turns out to be more tricky than
+Johannes would have thought. At first sight, what he needs is some
+sort of ``color wheel'' that is blue in the lower right direction and
+then changes smoothly to orange in the upper right direction and then
+to green in the upper left direction and so on. Unfortunately, there
+is no easy way of creating a true such a color wheel shading (although
+it can be done, in principle, but only at a very high cost, see
+page~\pageref{shading-color-wheel} for an example).
+
+Johannes decides to do something a bit more basic: He creates four
+large rectangles, one for each of the four quadrants around the
+central concept, each colored with a light version of the
+quadrant. Then, in order to ``smooth'' the change between adjacent
+rectangles, he puts four shadings on top of them.
+
+Since these background rectangles should go ``behind'' everything
+else, Johannes puts all his background stuff on the |background|
+layer.
+
+In the following code, only the central concept is shown to save some
+space:
+\begin{codeexample}[]
+\begin{tikzpicture}[
+ mindmap,
+ concept color=black,
+ root concept/.append style={
+ concept,
+ circular drop shadow,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape}
+ ]
+
+ \clip (-1.5,-5) rectangle ++(4,10);
+
+ \node [root concept] (Computational Complexity) {Computational Complexity};
+
+ \begin{pgfonlayer}{background}
+ \clip (-1.5,-5) rectangle ++(4,10);
+
+ \colorlet{upperleft}{green!50!black!25}
+ \colorlet{upperright}{orange!25}
+ \colorlet{lowerleft}{red!25}
+ \colorlet{lowerright}{blue!25}
+
+ % The large rectangles:
+ \fill [upperleft] (Computational Complexity) rectangle ++(-20,20);
+ \fill [upperright] (Computational Complexity) rectangle ++(20,20);
+ \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20);
+ \fill [lowerright] (Computational Complexity) rectangle ++(20,-20);
+
+ % The shadings:
+ \shade [left color=upperleft,right color=upperright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,20);
+ \shade [left color=lowerleft,right color=lowerright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20);
+ \shade [top color=upperleft,bottom color=lowerleft]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2);
+ \shade [top color=upperright,bottom color=lowerright]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(20,2);
+ \end{pgfonlayer}
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsection{Adding the Calendar}
+
+Johannes intends to plan his lecture rather carefully. In particular,
+he already knows when each of his lectures will be held during the
+course. Naturally, this does not mean that Johannes will slavishly
+follow the plan and he might need longer for some subjects than he
+anticipated, but nevertheless he has a detailed plan of when which
+subject will be addressed.
+
+Johannes intends to share this plan with his students by adding a
+calendar to the lecture map. In addition to serving as a reference
+on which particular day a certain topic will be addressed, the
+calendar is also useful so show the overall chronological order of the
+course.
+
+In order to add a calendar to a \tikzname\ graphic, the |calendar|
+library is most useful. The library provides the |\calendar| command,
+which takes a large number of options and which can be configured in
+many ways to produce just about any kind of calendar imaginable. For
+Johannes' purposes, a simple |day list downward| will be a nice option
+since it produces a list of days that go ``downward''.
+
+\begin{codeexample}[leave comments]
+\tiny
+\begin{tikzpicture}
+ \calendar [day list downward,
+ name=cal,
+ dates=2009-04-01 to 2009-04-14]
+ if (weekend)
+ [black!25];
+\end{tikzpicture}
+\end{codeexample}
+
+Using the |name| option, we gave a name to the calendar, which will
+allow us to reference the nodes that make up the individual days of
+the calendar later on. For instance, the rectangular node containing the
+|1| that represents April 1st, 2009, can be referenced as
+|(cal-2009-04-01)|. The |dates| option is used to specify an
+interval for which the calendar should be drawn. Johannes will need
+several months in his calendar, but the above example only shows two
+weeks to save some space.
+
+Note the |if (weekend)| construct. The |\calendar| command is followed
+by options and then by |if|-statements. These |if|-statements are
+checked for each day of the calendar and when a date passes this test,
+the options or the code following the |if|-statement is executed. In
+the above example, we make weekend days (Saturdays and Sundays, to be
+precise) lighter than normal days. (Use your favorite calendar to
+check that, indeed, April 5th, 2009, is a Sunday.)
+
+As mentioned above, Johannes can reference the nodes that are used to
+typeset days. Recall that his |\lecture| macro already got passed a
+date, which we did not use, yet. We can now use it to place the
+lecture's title next to the date when the lecture will be held:
+
+
+\begin{codeexample}[code only]
+\def\lecture#1#2#3#4#5#6{
+ % As before:
+ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) {
+ Lecture #1: \textcolor{orange}{\textbf{#2}}
+ \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
+ \parskip=0pt\labelwidth=8pt\leftmargin=8pt
+ \itemindent=0pt\labelsep=2pt}
+ #5
+ \endlist
+ };
+ % New:
+ \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
+}
+\end{codeexample}
+\def\lecture#1#2#3#4#5#6{
+ \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
+}
+
+Johannes can now use this new |\lecture| command as follows (in the
+example, only the new part of the definition is used):
+
+\begin{codeexample}[]
+\tiny
+\begin{tikzpicture}
+ \calendar [day list downward,
+ name=cal,
+ dates=2009-04-01 to 2009-04-14]
+ if (weekend)
+ [black!25];
+
+ % As before:
+ \lecture{1}{Computational Problems}{above,xshift=-3mm}
+ {Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+\end{tikzpicture}
+\end{codeexample}
+
+
+As a final step, Johannes needs to add a few more options to the
+calendar command: He uses the |month text| option to configure how the
+text of a month is rendered (see Section~\ref{section-calender} for
+details) and then typesets the month text at a special position at the
+beginning of each month.
+
+\begin{codeexample}[leave comments]
+\tiny
+\begin{tikzpicture}
+ \calendar [day list downward,
+ month text=\%mt\ \%y0,
+ month yshift=3.5em,
+ name=cal,
+ dates=2009-04-01 to 2009-05-01]
+ if (weekend)
+ [black!25]
+ if (day of month=1) {
+ \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext};
+ };
+
+ \lecture{1}{Computational Problems}{above,xshift=-3mm}
+ {Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+
+ \lecture{2}{Computational Models}{above,xshift=-3mm}
+ {Computational Models.north}{
+ \item Knowledge of Turing machines
+ \item Being able to compare the computational power of different
+ models
+ }{2009-04-15}
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsection{The Complete Code}
+
+Putting it all together, Johannes gets the following code:
+
+First comes the definition of the |\lecture| command:
+
+\begin{codeexample}[code only]
+\def\lecture#1#2#3#4#5#6{
+ % As before:
+ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) {
+ Lecture #1: \textcolor{orange}{\textbf{#2}}
+ \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
+ \parskip=0pt\labelwidth=8pt\leftmargin=8pt
+ \itemindent=0pt\labelsep=2pt}
+ #5
+ \endlist
+ };
+ % New:
+ \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
+}
+\end{codeexample}
+
+This is followed by the main mindmap setup\dots
+
+\begin{codeexample}[code only]
+\noindent
+\begin{tikzpicture}
+ \begin{scope}[
+ mindmap,
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+\end{codeexample}
+\dots and contents:
+\begin{codeexample}[code only]
+ \node [root concept] (Computational Complexity) {Computational Complexity} % root
+ child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems}
+ child { node (Problem Measures) {Problem Measures} }
+ child { node (Problem Aspects) {Problem Aspects} }
+ child [faded] { node (problem Domains) {Problem Domains} }
+ child { node (Key Problems) {Key Problems} }
+ }
+ child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models}
+ child { node (Turing Machines) {Turing Machines} }
+ child [faded] { node (Random-Access Machines) {Random-Access Machines} }
+ child { node (Circuits) {Circuits} }
+ child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} }
+ child { node (Oracle Machines) {Oracle Machines} }
+ child { node (Programming in Logic) {Programming in Logic} }
+ }
+ child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity}
+ child { node (Complexity Measures) {Complexity Measures} }
+ child { node (Classifying Complexity) {Classifying Complexity} }
+ child { node (Comparing Complexity) {Comparing Complexity} }
+ child [faded] { node (Describing Complexity) {Describing Complexity} }
+ }
+ child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems}
+ child { node (Exact Algorithms) {Exact Algorithms} }
+ child { node (Randomization) {Randomization} }
+ child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} }
+ child { node (Parallel Computation) {Parallel Computation} }
+ child { node (Partial Solutions) {Partial Solutions} }
+ child { node (Approximation) {Approximation} }
+ };
+ \end{scope}
+\end{codeexample}
+Now comes the calendar code:
+\begin{codeexample}[code only]
+ \tiny
+ \calendar [day list downward,
+ month text=\%mt\ \%y0,
+ month yshift=3.5em,
+ name=cal,
+ at={(-.5\textwidth-5mm,.5\textheight-1cm)},
+ dates=2009-04-01 to 2009-06-last]
+ if (weekend)
+ [black!25]
+ if (day of month=1) {
+ \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext};
+ };
+\end{codeexample}
+The lecture annotations:
+\begin{codeexample}[code only]
+ \lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+
+ \lecture{2}{Computational Models}{above left}
+ {Computational Models.west}{
+ \item Knowledge of Turing machines
+ \item Being able to compare the computational power of different
+ models
+ }{2009-04-15}
+\end{codeexample}
+Finally, the background:
+\begin{codeexample}[code only]
+ \begin{pgfonlayer}{background}
+ \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight);
+
+ \colorlet{upperleft}{green!50!black!25}
+ \colorlet{upperright}{orange!25}
+ \colorlet{lowerleft}{red!25}
+ \colorlet{lowerright}{blue!25}
+
+ % The large rectangles:
+ \fill [upperleft] (Computational Complexity) rectangle ++(-20,20);
+ \fill [upperright] (Computational Complexity) rectangle ++(20,20);
+ \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20);
+ \fill [lowerright] (Computational Complexity) rectangle ++(20,-20);
+
+ % The shadings:
+ \shade [left color=upperleft,right color=upperright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,20);
+ \shade [left color=lowerleft,right color=lowerright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20);
+ \shade [top color=upperleft,bottom color=lowerleft]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2);
+ \shade [top color=upperright,bottom color=lowerright]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(20,2);
+ \end{pgfonlayer}
+\end{tikzpicture}
+\end{codeexample}
+
+The next page shows the resulting lecture map in all its glory (it
+would be somewhat more glorious, if there were more lecture
+annotations, but you should get the idea).
+
+\def\lecture#1#2#3#4#5#6{
+ % As before:
+ \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm, fill=white] at (#4) {
+ Lecture #1: \textcolor{orange}{\textbf{#2}}
+ \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
+ \parskip=0pt\labelwidth=8pt\leftmargin=8pt
+ \itemindent=0pt\labelsep=2pt}
+ #5
+ \endlist
+ };
+ % New:
+ \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
+}
+
+\noindent
+\begin{tikzpicture}
+ \begin{scope}[
+ mindmap,
+ every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt},
+ root concept/.append style={
+ concept color=black,
+ fill=white, line width=1ex,
+ text=black, font=\large\scshape},
+ text=white,
+ computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
+ computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
+ measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
+ solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
+ grow cyclic,
+ level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
+ level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
+ \node [root concept] (Computational Complexity) {Computational Complexity} % root
+ child [computational problems] { node [yshift=-1cm] (Computational Problems) {Computational Problems}
+ child { node (Problem Measures) {Problem Measures} }
+ child { node (Problem Aspects) {Problem Aspects} }
+ child [faded] { node (problem Domains) {Problem Domains} }
+ child { node (Key Problems) {Key Problems} }
+ }
+ child [computational models] { node [yshift=-1cm] (Computational Models) {Computational Models}
+ child { node (Turing Machines) {Turing Machines} }
+ child [faded] { node (Random-Access Machines) {Random-Access Machines} }
+ child { node (Circuits) {Circuits} }
+ child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} }
+ child { node (Oracle Machines) {Oracle Machines} }
+ child { node (Programming in Logic) {Programming in Logic} }
+ }
+ child [measuring complexity] { node [yshift=1cm] (Measuring Complexity) {Measuring Complexity}
+ child { node (Complexity Measures) {Complexity Measures} }
+ child { node (Classifying Complexity) {Classifying Complexity} }
+ child { node (Comparing Complexity) {Comparing Complexity} }
+ child [faded] { node (Describing Complexity) {Describing Complexity} }
+ }
+ child [solving problems] { node [yshift=1cm] (Solving Problems) {Solving Problems}
+ child { node (Exact Algorithms) {Exact Algorithms} }
+ child { node (Randomization) {Randomization} }
+ child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} }
+ child { node (Parallel Computation) {Parallel Computation} }
+ child { node (Partial Solutions) {Partial Solutions} }
+ child { node (Approximation) {Approximation} }
+ };
+ \end{scope}
+
+ \tiny
+ \calendar [day list downward,
+ month text=\%mt\ \%y0,
+ month yshift=3.5em,
+ name=cal,
+ at={(-.5\textwidth-5mm,.5\textheight-1cm)},
+ dates=2009-04-01 to 2009-06-last]
+ if (weekend)
+ [black!25]
+ if (day of month=1) {
+ \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext};
+ };
+
+ \lecture{1}{Computational Problems}{above,xshift=-5mm,yshift=5mm}{Computational Problems.north}{
+ \item Knowledge of several key problems
+ \item Knowledge of problem encodings
+ \item Being able to formalize problems
+ }{2009-04-08}
+
+ \lecture{2}{Computational Models}{above left}
+ {Computational Models.west}{
+ \item Knowledge of Turing machines
+ \item Being able to compare the computational power of different
+ models
+ }{2009-04-15}
+
+ \begin{pgfonlayer}{background}
+ \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight);
+
+ \colorlet{upperleft}{green!50!black!25}
+ \colorlet{upperright}{orange!25}
+ \colorlet{lowerleft}{red!25}
+ \colorlet{lowerright}{blue!25}
+
+ % The large rectangles:
+ \fill [upperleft] (Computational Complexity) rectangle ++(-20,20);
+ \fill [upperright] (Computational Complexity) rectangle ++(20,20);
+ \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20);
+ \fill [lowerright] (Computational Complexity) rectangle ++(20,-20);
+
+ % The shadings:
+ \shade [left color=upperleft,right color=upperright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,20);
+ \shade [left color=lowerleft,right color=lowerright]
+ ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20);
+ \shade [top color=upperleft,bottom color=lowerleft]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2);
+ \shade [top color=upperright,bottom color=lowerright]
+ ([yshift=-1cm]Computational Complexity) rectangle ++(20,2);
+ \end{pgfonlayer}
+\end{tikzpicture}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex
index 0f5e1a2d185..f9c5eb8de53 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex
@@ -1,4 +1,4 @@
-% Copyright 2006 by Till Tantau
+% Copyright 2006 by Tilo Tantau
%
% This file may be distributed and/or modified
%
@@ -14,7 +14,7 @@ In this second tutorial we explore the node mechanism of
Hagen must give a talk tomorrow about his favorite formalism for
distributed systems: Petri nets! Hagen used to give his talks using a
-blackboard and everyone seemed to be perfectly concent with
+blackboard and everyone seemed to be perfectly concent with % TODOsp: concent --> consent?
this. Unfortunately, his audience has been spoiled recently with fancy
projector-based presentations and there seems to be a certain amount
of peer pressure that this Petri nets should also be drawn using a
@@ -43,7 +43,7 @@ capacities. The graphic should look like this, ideally:
\node [place] (s) [below=of c1,label=above:$s\le 3$] {};
\node [place] (c2) [below=of s] {};
\node [place,tokens=1] (w2) [below=of c2] {};
-
+
\node [transition] (e1) [left=of c1] {}
edge [pre,bend left] (w1)
edge [post,bend right] (s)
@@ -53,7 +53,7 @@ capacities. The graphic should look like this, ideally:
edge [pre,bend right] (w2)
edge [post,bend left] (s)
edge [post] (c2);
-
+
\node [transition] (l1) [right=of c1] {}
edge [pre] (c1)
edge [pre,bend left] (s)
@@ -64,7 +64,7 @@ capacities. The graphic should look like this, ideally:
edge [pre,bend right] (s)
edge [post,bend left] node {2} (w2);
\end{scope}
-
+
\begin{scope}[xshift=6cm]
% Second net
\node [place,tokens=1]
@@ -76,7 +76,7 @@ capacities. The graphic should look like this, ideally:
\node [place] (c2') [below=of s1',xshift=5mm] {};
\node [place,tokens=1]
(w2') [below=of c2'] {};
-
+
\node [transition] (e1') [left=of c1'] {}
edge [pre,bend left] (w1')
edge [post] (s1')
@@ -88,7 +88,7 @@ capacities. The graphic should look like this, ideally:
edge [post] (s1')
edge [pre] (s2')
edge [post] (c2');
-
+
\node [transition] (l1') [right=of c1'] {}
edge [pre] (c1')
edge [pre] (s1')
@@ -110,7 +110,7 @@ capacities. The graphic should look like this, ideally:
\draw [shorten >=1mm,-to,thick,decorate,decoration={snake,amplitude=.4mm,segment
length=2mm,pre=moveto,pre length=1mm,post length=2mm}]
(r1) -- (r2)
- node [above=1mm,midway,text width=3cm,text centered]
+ node [above=1mm,midway,text width=3cm,align=center]
{replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}};
\end{tikzpicture}
@@ -131,7 +131,7 @@ special arrow tip used in the graphic, the |decoration.pathmorphing|
library for the ``snaking line'' in the middle, the background
library for the two rectangular areas that are behind the two main
parts of the picture, the |fit| library to easily compute the sizes of
-these ractangles, and the |placements| library for placing nodes
+these rectangles, and the |positioning| library for placing nodes
relative to other nodes.
@@ -143,7 +143,7 @@ When using \LaTeX\ use:
\documentclass{article} % say
\usepackage{tikz}
-\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,placments,fit}
+\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
\begin{document}
\begin{tikzpicture}
@@ -160,7 +160,7 @@ When using plain \TeX\ use:
\begin{codeexample}[code only]
%% Plain TeX file
\input tikz.tex
-\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,placments,fit}
+\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
\baselineskip=12pt
\hsize=6.3truein
\vsize=8.7truein
@@ -173,17 +173,19 @@ When using plain \TeX\ use:
\subsubsection{Setting up the Environment in Con\TeX t}
-When using Con\TeX\ use:
+When using Con\TeX\ use\footnote{Note that \pgfname/\tikzname{} is not
+ supported by recent Con\TeX t versions (like mark IV, the
+ Lua\TeX-aware part of Con\TeX t).}:
\begin{codeexample}[code only]
%% ConTeXt file
\usemodule[tikz]
-\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,placments,fit]
+\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri]
\starttext
\starttikzpicture
\draw (0,0) -- (1,1);
\stoptikzpicture
-\startext
+\stoptext
\end{codeexample}
@@ -218,18 +220,18 @@ a node can get a \emph{name} for later reference.
In Hagen's picture we will use nodes for the places and for the
transitions of the Petri net (the places are the circles, the
transitions are the rectangles). Let us start with the upper half of
-the left Petir net. In this upper half we have three places and two
+the left Petri net. In this upper half we have three places and two
transitions. Instead of drawing three circles and two rectangles, we
use three nodes of shape |circle| and two nodes of shape
|rectangle|.
\begin{codeexample}[]
\begin{tikzpicture}
- \path ( 0,2) node [shape=circle,draw] {}
- ( 0,1) node [shape=circle,draw] {}
- ( 0,0) node [shape=circle,draw] {}
+ \path ( 0,2) node [shape=circle,draw] {}
+ ( 0,1) node [shape=circle,draw] {}
+ ( 0,0) node [shape=circle,draw] {}
( 1,1) node [shape=rectangle,draw] {}
- (-1,1) node [shape=rectangle,draw] {};
+ (-1,1) node [shape=rectangle,draw] {};
\end{tikzpicture}
\end{codeexample}
@@ -256,7 +258,7 @@ So, the code |(0,2) node [shape=circle,draw] {}| means the following:
temporarily suspend the construction of the main path while the node
is build. This node will be a |circle| around an empty text. This
circle is to be |draw|n, but not filled or otherwise used. Once this
-whole node is constructed, it is saved until after the
+whole node is constructed, it is saved until after the
main path is finished. Then, it is drawn.'' Then following
|(0,1) node [shape=circle,draw] {}| then has the following effect:
``Continue the main path with a move-to to |(0,1)|. Then construct a
@@ -280,11 +282,11 @@ last coordinate. Hagen can then write the following:
\begin{codeexample}[]
\begin{tikzpicture}
- \path node at ( 0,2) [shape=circle,draw] {}
- node at ( 0,1) [shape=circle,draw] {}
- node at ( 0,0) [shape=circle,draw] {}
+ \path node at ( 0,2) [shape=circle,draw] {}
+ node at ( 0,1) [shape=circle,draw] {}
+ node at ( 0,0) [shape=circle,draw] {}
node at ( 1,1) [shape=rectangle,draw] {}
- node at (-1,1) [shape=rectangle,draw] {};
+ node at (-1,1) [shape=rectangle,draw] {};
\end{tikzpicture}
\end{codeexample}
@@ -296,15 +298,15 @@ be improved further: The |\node| command is an abbreviation for
\begin{codeexample}[]
\begin{tikzpicture}
\node at ( 0,2) [circle,draw] {};
- \node at ( 0,1) [circle,draw] {};
- \node at ( 0,0) [circle,draw] {};
+ \node at ( 0,1) [circle,draw] {};
+ \node at ( 0,0) [circle,draw] {};
\node at ( 1,1) [rectangle,draw] {};
- \node at (-1,1) [rectangle,draw] {};
+ \node at (-1,1) [rectangle,draw] {};
\end{tikzpicture}
\end{codeexample}
Hagen likes this syntax much better than the previous one. Note that
-Hagen has also omitted the |shape=| since, like |color=|, \tikzname\
+Hagen has also omitted the |shape=| since, like |color=|, \tikzname\
allows you to omit the |shape=| if there is no confusion.
@@ -318,10 +320,10 @@ different colors, resulting in the following code:
\begin{codeexample}[]
\begin{tikzpicture}[thick]
\node at ( 0,2) [circle,draw=blue!50,fill=blue!20] {};
- \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {};
- \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {};
+ \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {};
+ \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {};
\node at ( 1,1) [rectangle,draw=black!50,fill=black!20] {};
- \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {};
+ \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {};
\end{tikzpicture}
\end{codeexample}
@@ -338,10 +340,10 @@ places and another style for transitions:
[place/.style={circle,draw=blue!50,fill=blue!20,thick},
transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
\node at ( 0,2) [place] {};
- \node at ( 0,1) [place] {};
- \node at ( 0,0) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
\node at ( 1,1) [transition] {};
- \node at (-1,1) [transition] {};
+ \node at (-1,1) [transition] {};
\end{tikzpicture}
\end{codeexample}
@@ -361,10 +363,10 @@ adds some space around the text. The amount is set using the option
place/.style={circle,draw=blue!50,fill=blue!20,thick},
transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
\node at ( 0,2) [place] {};
- \node at ( 0,1) [place] {};
- \node at ( 0,0) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
\node at ( 1,1) [transition] {};
- \node at (-1,1) [transition] {};
+ \node at (-1,1) [transition] {};
\end{tikzpicture}
\end{codeexample}
@@ -376,7 +378,7 @@ a longer text, it will be larger, but if the text is empty, then the
node will have |minimum size|. This option is also useful to ensure
that several nodes containing different amounts of text have the same
size. The options |minimum height| and |minimum width| allow you to
-specify the minimum height and width independently.
+specify the minimum height and width independently.
So, what Hagen needs to do is to provide |minimum size| for the
nodes. To be on the safe side, he also sets |inner sep=0pt|. This
@@ -389,12 +391,12 @@ the automatically added space.
[place/.style={circle,draw=blue!50,fill=blue!20,thick,
inner sep=0pt,minimum size=6mm},
transition/.style={rectangle,draw=black!50,fill=black!20,thick,
- inner sep=0pt,minimum size=4mm}]
+ inner sep=0pt,minimum size=4mm}]
\node at ( 0,2) [place] {};
- \node at ( 0,1) [place] {};
- \node at ( 0,0) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
\node at ( 1,1) [transition] {};
- \node at (-1,1) [transition] {};
+ \node at (-1,1) [transition] {};
\end{tikzpicture}
\end{codeexample}
@@ -426,10 +428,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
% ... setup styles
\begin{tikzpicture}
\node (waiting 1) at ( 0,2) [place] {};
- \node (critical 1) at ( 0,1) [place] {};
- \node (semaphore) at ( 0,0) [place] {};
+ \node (critical 1) at ( 0,1) [place] {};
+ \node (semaphore) at ( 0,0) [place] {};
\node (leave critical) at ( 1,1) [transition] {};
- \node (enter critical) at (-1,1) [transition] {};
+ \node (enter critical) at (-1,1) [transition] {};
\end{tikzpicture}
\end{codeexample}
}
@@ -437,7 +439,7 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
Hagen is pleased to note that the names help in understanding the
code. Names for nodes can be pretty arbitrary, but they should not
contain commas, periods, parentheses, colons, and some other special
-characters. However, they can contain underscores and hyphens.
+characters. However, they can contain underscores and hyphens.
The syntax for the |node| operation is quite liberal with respect to
the order in which node names, the |at| specifier, and the options
@@ -453,10 +455,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting 1) at ( 0,2) {};
- \node[place] (critical 1) at ( 0,1) {};
- \node[place] (semaphore) at ( 0,0) {};
+ \node[place] (critical 1) at ( 0,1) {};
+ \node[place] (semaphore) at ( 0,0) {};
\node[transition] (leave critical) at ( 1,1) {};
- \node[transition] (enter critical) at (-1,1) {};
+ \node[transition] (enter critical) at (-1,1) {};
\end{tikzpicture}
\end{codeexample}
}
@@ -481,19 +483,19 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\end{tikzpicture}
\end{codeexample}
}
-With the |replacements| library loaded, when an option like |below|
-is followed by |of|, then the position of the node is shifted
+With the |positioning| library loaded, when an option like |below|
+is followed by |of|, then the position of the node is shifted in
such a manner that it is placed at the distance |node distance| in the
specified direction of the given direction. The |node distance| is
-either the distance between the centers of the nodes (when the
+either the distance between the centers of the nodes (when the
|on grid| option is set to true) or the distance between the borders
(when the |on grid| option is set to false, which is the default).
@@ -519,12 +521,12 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
- \node [red,above] at (semaphore.north) {$s\le 3$};
+ \node [red,above] at (semaphore.north) {$s\le 3$};
\end{tikzpicture}
\end{codeexample}
}
@@ -538,7 +540,7 @@ This is a general approach that will ``always work.''
|label=above:$s\le 3$|. This option is interpreted as follows: We
want a node above the |semaphore| node and this node should read
``$s \le 3$.'' Instead of |above| we could also use things like
- |below left| before the colon or a number like |60|.
+ |below left| before the colon or a number like |60|.
{
\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
inner sep=0pt,minimum size=6mm},
@@ -547,11 +549,11 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
+ \node[place] (critical) [below=of waiting] {};
\node[place] (semaphore) [below=of critical,
- label=above:$s\le3$] {};
+ label=above:$s\le3$] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\end{tikzpicture}
\end{codeexample}
}
@@ -576,13 +578,13 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
transition/.style={rectangle,draw=black!50,fill=black!20,thick,
inner sep=0pt,minimum size=4mm}}
\begin{codeexample}[]
-\begin{tikzpicture}[every label/.style={red}]
+\begin{tikzpicture}[every label/.style={red}]
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
+ \node[place] (critical) [below=of waiting] {};
\node[place] (semaphore) [below=of critical,
- label=above:$s\le3$] {};
+ label=above:$s\le3$] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\end{tikzpicture}
\end{codeexample}
}
@@ -611,10 +613,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\draw [->] (critical.west) -- (enter critical.east);
\end{tikzpicture}
\end{codeexample}
@@ -631,10 +633,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\draw [->] (enter critical.east) -- (critical.west);
\draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm)
.. (enter critical.north);
@@ -657,10 +659,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\draw [->] (enter critical) -- (critical);
\draw [->] (waiting) .. controls +(left:8mm) and +(up:8mm)
.. (enter critical);
@@ -682,7 +684,7 @@ anchor by hand.
Hagen would now like to simplify the curve operation somehow. It turns
out that this can be accomplished using a special path operation: the
|to| operation. This operation takes many options (you can even define
-new ones yourself). One pair of option is useful for Hagen: The pair
+new ones yourself). One pair of options is useful for Hagen: The pair
|in| and |out|. These options take angles at which a curve should
leave or reach the start or target coordinates. Without these options,
a straight line is drawn:
@@ -695,10 +697,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\draw [->] (enter critical) to (critical);
\draw [->] (waiting) to [out=180,in=90] (enter critical);
\end{tikzpicture}
@@ -718,10 +720,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
- \node[transition] (enter critical) [left=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
\draw [->] (enter critical) to (critical);
\draw [->] (waiting) to [bend right=45] (enter critical);
\draw [->] (enter critical) to [bend right=45] (semaphore);
@@ -734,10 +736,10 @@ edges: Using the |edge| path operation. This operation is very similar
to the |to| operation, but there is one important difference: Like a
node the edge generated by the |edge| operation is not part of the
main path, but is added only later. This may not seem very important,
-but is has some nice consequences. For example, every edge can have
+but it has some nice consequences. For example, every edge can have
its own arrow tips and its own color and so one and, still, all the
edges can be given on the same path. This allows Hagen to write the
-following:
+following:
{
@@ -748,8 +750,8 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\begin{codeexample}[]
\begin{tikzpicture}
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {};
\node[transition] (enter critical) [left=of critical] {}
edge [->] (critical)
@@ -779,8 +781,8 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
post/.style={->,shorten >=1pt,>=stealth',semithick}]
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {}
edge [pre] (critical)
@@ -830,21 +832,21 @@ each |to| operation.
For Hagen that |auto| option is not really necessary since the two
``2'' labels could also easily be placed ``by hand.'' However, in a
complicated plot with numerous edges automatic placement can be a
-blessing.
+blessing.
{
\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
inner sep=0pt,minimum size=6mm},
transition/.style={rectangle,draw=black!50,fill=black!20,thick,
inner sep=0pt,minimum size=4mm},
-pre/.style={<-,shorten <=1pt,>=stealth',semithick},
-post/.style={->,shorten >=1pt,>=stealth',semithick}}
+pre/.style={<-,shorten <=1pt,>=stealth',semithick},
+post/.style={->,shorten >=1pt,>=stealth',semithick}}
\begin{codeexample}[]
% Styles as before
\begin{tikzpicture}[bend angle=45]
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {}
edge [pre] (critical)
@@ -866,7 +868,7 @@ With the node mechanism Hagen can now easily create the two Petri
nets. What he is unsure of is how he can create the snaked line
between the nets.
-For this he can use a \emph{decoration}.
+For this he can use a \emph{decoration}.
To draw the snake, Hagen only needs to set the two options
|decoration=snake| and |decorate| on
the path. This causes all lines of the path to be replaced by
@@ -883,7 +885,7 @@ Well, that does not look quite right, yet. The problem is that the
snake happens to end exactly at the position where the arrow
begins. Fortunately, there is an option that helps here. Also, the
snake should be a bit smaller, which can be influenced by even more
-options.
+options.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -894,17 +896,34 @@ options.
\end{codeexample}
Now Hagen needs to add the text above the snake. This text is a bit
-challenging since it is a multi-line text. To typeset such text, Hagen
-needs to specify a width for the text and he needs to specify that the
-text should be centered.
+challenging since it is a multi-line text. Hagen has two options for
+this: First, he can specify an |align=center| and then use the |\\|
+command to enforce the line breaks at the desired positions.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->,decorate,
+ decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
+ (0,0) -- (3,0)
+ node [above,align=center,midway]
+ {
+ replacement of\\
+ the \textcolor{red}{capacity}\\
+ by \textcolor{red}{two places}
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+Instead of specifying the line breaks ``by hand,'' Hagen can also
+specify a width for the text and let \TeX\ perform the line breaking
+for him:
\begin{codeexample}[]
\begin{tikzpicture}
\draw [->,decorate,
decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
(0,0) -- (3,0)
- node [above,text width=3cm,text centered,midway]
+ node [above,text width=3cm,align=center,midway]
{
replacement of the \textcolor{red}{capacity} by
\textcolor{red}{two places}
@@ -945,14 +964,14 @@ nodes and coordinates given as parameters to the |fit| option.
inner sep=0pt,minimum size=6mm},
transition/.style={rectangle,draw=black!50,fill=black!20,thick,
inner sep=0pt,minimum size=4mm},
-pre/.style={<-,shorten <=1pt,>=stealth',semithick},
+pre/.style={<-,shorten <=1pt,>=stealth',semithick},
post/.style={->,shorten >=1pt,>=stealth',semithick}}
\begin{codeexample}[]
% Styles as before
\begin{tikzpicture}[bend angle=45]
\node[place] (waiting) {};
- \node[place] (critical) [below=of waiting] {};
- \node[place] (semaphore) [below=of critical] {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
\node[transition] (leave critical) [right=of critical] {}
edge [pre] (critical)
@@ -964,7 +983,7 @@ post/.style={->,shorten >=1pt,>=stealth',semithick}}
edge [post,bend right] (semaphore);
\begin{pgfonlayer}{background}
- \node [fill=black!30,fit=(waiting) (critical) (semaphore)
+ \node [fill=black!30,fit=(waiting) (critical) (semaphore)
(leave critical) (enter critical)] {};
\end{pgfonlayer}
\end{tikzpicture}
@@ -1004,13 +1023,14 @@ Now comes the code for the nets:
red place/.style={place,draw=red!75,fill=red!20},
every label/.style={red},
every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}}
+\tikzexternaldisable
\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}]
\node [place,tokens=1] (w1) {};
\node [place] (c1) [below=of w1] {};
\node [place] (s) [below=of c1,label=above:$s\le 3$] {};
\node [place] (c2) [below=of s] {};
\node [place,tokens=1] (w2) [below=of c2] {};
-
+
\node [transition] (e1) [left=of c1] {}
edge [pre,bend left] (w1)
edge [post,bend right] (s)
@@ -1037,8 +1057,9 @@ every transition/.style={thick,draw=black!75,fill=black!20},
red place/.style= {place,draw=red!75,fill=red!20},
every label/.style={red},
every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}}
+\tikzexternaldisable
\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}]
- \begin{scope}[xshift=6cm]
+ \begin{scope}[xshift=6cm]
\node [place,tokens=1] (w1') {};
\node [place] (c1') [below=of w1'] {};
\node [red place] (s1') [below=of c1',xshift=-5mm]
@@ -1047,7 +1068,7 @@ every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}
[label=right:$\bar s$] {};
\node [place] (c2') [below=of s1',xshift=5mm] {};
\node [place,tokens=1] (w2') [below=of c2'] {};
-
+
\node [transition] (e1') [left=of c1'] {}
edge [pre,bend left] (w1')
edge [post] (s1')
@@ -1083,7 +1104,7 @@ The code for the background and the snake is the following:
\draw [shorten >=1mm,-to,thick,decorate,
decoration={snake,amplitude=.4mm,segment length=2mm,
pre=moveto,pre length=1mm,post length=2mm}]
- (r1) -- (r2) node [above=1mm,midway,text width=3cm,text centered]
+ (r1) -- (r2) node [above=1mm,midway,text width=3cm,align=center]
{replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}};
\end{tikzpicture}
\end{codeexample}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig
new file mode 100644
index 00000000000..99ac79cd642
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex.orig
@@ -0,0 +1,1108 @@
+% Copyright 2006 by Tilo Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\section{Tutorial: A Petri-Net for Hagen}
+
+In this second tutorial we explore the node mechanism of
+\tikzname\ and \pgfname.
+
+Hagen must give a talk tomorrow about his favorite formalism for
+distributed systems: Petri nets! Hagen used to give his talks using a
+blackboard and everyone seemed to be perfectly concent with % TODOsp: concent --> consent?
+this. Unfortunately, his audience has been spoiled recently with fancy
+projector-based presentations and there seems to be a certain amount
+of peer pressure that this Petri nets should also be drawn using a
+graphic program. One of the professors at his institutes recommends
+\tikzname\ for this and Hagen decides to give it a try.
+
+
+\subsection{Problem Statement}
+
+For his talk, Hagen wishes to create a graphic that demonstrates how a
+net with place capacities can be simulated by a net without
+capacities. The graphic should look like this, ideally:
+
+\begin{quote}
+\begin{tikzpicture}
+ [node distance=1.3cm,>=stealth',bend angle=45,auto,
+ place/.style={circle,thick,draw=blue!75,fill=blue!20,minimum size=6mm},
+ red place/.style={place,draw=red!75,fill=red!20},
+ transition/.style={rectangle,thick,draw=black!75,fill=black!20,minimum size=4mm},
+ every label/.style={red},on grid]
+
+ \begin{scope}
+ % First net
+ \node [place,tokens=1] (w1) {};
+ \node [place] (c1) [below=of w1] {};
+ \node [place] (s) [below=of c1,label=above:$s\le 3$] {};
+ \node [place] (c2) [below=of s] {};
+ \node [place,tokens=1] (w2) [below=of c2] {};
+
+ \node [transition] (e1) [left=of c1] {}
+ edge [pre,bend left] (w1)
+ edge [post,bend right] (s)
+ edge [post] (c1);
+
+ \node [transition] (e2) [left=of c2] {}
+ edge [pre,bend right] (w2)
+ edge [post,bend left] (s)
+ edge [post] (c2);
+
+ \node [transition] (l1) [right=of c1] {}
+ edge [pre] (c1)
+ edge [pre,bend left] (s)
+ edge [post,bend right] node[swap] {2} (w1);
+
+ \node [transition] (l2) [right=of c2] {}
+ edge [pre] (c2)
+ edge [pre,bend right] (s)
+ edge [post,bend left] node {2} (w2);
+ \end{scope}
+
+ \begin{scope}[xshift=6cm]
+ % Second net
+ \node [place,tokens=1]
+ (w1') {};
+ \node [place] (c1') [below=of w1'] {};
+ \node [red place] (s1') [below=of c1',xshift=-5mm,label=left:$s$] {};
+ \node [red place,tokens=3]
+ (s2') [below=of c1',xshift=5mm,label=right:$\bar s$] {};
+ \node [place] (c2') [below=of s1',xshift=5mm] {};
+ \node [place,tokens=1]
+ (w2') [below=of c2'] {};
+
+ \node [transition] (e1') [left=of c1'] {}
+ edge [pre,bend left] (w1')
+ edge [post] (s1')
+ edge [pre] (s2')
+ edge [post] (c1');
+
+ \node [transition] (e2') [left=of c2'] {}
+ edge [pre,bend right] (w2')
+ edge [post] (s1')
+ edge [pre] (s2')
+ edge [post] (c2');
+
+ \node [transition] (l1') [right=of c1'] {}
+ edge [pre] (c1')
+ edge [pre] (s1')
+ edge [post] (s2')
+ edge [post,bend right] node[swap] {2} (w1');
+
+ \node [transition] (l2') [right=of c2'] {}
+ edge [pre] (c2')
+ edge [pre] (s1')
+ edge [post] (s2')
+ edge [post,bend left] node {2} (w2');
+ \end{scope}
+
+ \begin{pgfonlayer}{background}
+ \node (r1) [fill=black!10,rounded corners,fit=(w1)(w2)(e1)(e2)(l1)(l2)] {};
+ \node (r2) [fill=black!10,rounded corners,fit=(w1')(w2')(e1')(e2')(l1')(l2')] {};
+ \end{pgfonlayer}
+
+ \draw [shorten >=1mm,-to,thick,decorate,decoration={snake,amplitude=.4mm,segment
+ length=2mm,pre=moveto,pre length=1mm,post length=2mm}]
+ (r1) -- (r2)
+ node [above=1mm,midway,text width=3cm,align=center]
+ {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}};
+
+\end{tikzpicture}
+\end{quote}
+
+
+\subsection{Setting up the Environment}
+
+For the picture Hagen will need to load the \tikzname\ package as did
+Karl in the previous tutorial. However, Hagen will also need to load
+some additional \emph{library packages} that Karl did not need. These
+library packages contain additional definitions like extra arrow tips
+that are typically not needed in a picture and that need to be
+loaded explicitly.
+
+Hagen will need to load several libraries: The |arrows| library for the
+special arrow tip used in the graphic, the |decoration.pathmorphing|
+library for the ``snaking line'' in the middle, the background
+library for the two rectangular areas that are behind the two main
+parts of the picture, the |fit| library to easily compute the sizes of
+these rectangles, and the |positioning| library for placing nodes
+relative to other nodes.
+
+
+\subsubsection{Setting up the Environment in \LaTeX}
+
+When using \LaTeX\ use:
+
+\begin{codeexample}[code only]
+\documentclass{article} % say
+
+\usepackage{tikz}
+\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
+
+\begin{document}
+\begin{tikzpicture}
+ \draw (0,0) -- (1,1);
+\end{tikzpicture}
+\end{document}
+\end{codeexample}
+
+
+\subsubsection{Setting up the Environment in Plain \TeX}
+
+When using plain \TeX\ use:
+
+\begin{codeexample}[code only]
+%% Plain TeX file
+\input tikz.tex
+\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
+\baselineskip=12pt
+\hsize=6.3truein
+\vsize=8.7truein
+\tikzpicture
+ \draw (0,0) -- (1,1);
+\endtikzpicture
+\bye
+\end{codeexample}
+
+
+\subsubsection{Setting up the Environment in Con\TeX t}
+
+When using Con\TeX\ use:
+\begin{codeexample}[code only]
+%% ConTeXt file
+\usemodule[tikz]
+\usetikzlibrary[arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri]
+
+\starttext
+ \starttikzpicture
+ \draw (0,0) -- (1,1);
+ \stoptikzpicture
+\stoptext
+\end{codeexample}
+
+
+
+\subsection{Introduction to Nodes}
+
+In principle, we already know how to create the graphics that Hagen
+desires (except perhaps for the snaked line, we will come to that): We
+start with big light gray rectangle and then add lots of circles and
+small rectangle, plus some arrows.
+
+However, this approach has numerous disadvantages: First, it is hard
+to change anything at a later stage. For example, if we decide to add
+more places to the Petri nets (the circles are called places in Petri
+net theory), all of the coordinates change and we need to recalculate
+everything. Second, it is hard to read the code for the Petri net as
+it just a long and complicated list of coordinates and drawing
+commands -- the underlying structure of the Petri net is lost.
+
+Fortunately, \tikzname\ offers a powerful mechanism for avoiding the
+above problems: nodes. We already came across nodes in the previous
+tutorial, where we used them to add labels to Karl's graphic. In the
+present tutorial we will see that nodes are much more powerful.
+
+A node is a small part of a picture. When a node is created, you
+provide a position where the node should be drawn and a
+\emph{shape}. A node of shape |circle| will be drawn as a circle, a
+node of shape |rectangle| as a rectangle, and so on. A node may also
+contain same text, which is why Karl used nodes to show text. Finally,
+a node can get a \emph{name} for later reference.
+
+In Hagen's picture we will use nodes for the places and for the
+transitions of the Petri net (the places are the circles, the
+transitions are the rectangles). Let us start with the upper half of
+the left Petri net. In this upper half we have three places and two
+transitions. Instead of drawing three circles and two rectangles, we
+use three nodes of shape |circle| and two nodes of shape
+|rectangle|.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \path ( 0,2) node [shape=circle,draw] {}
+ ( 0,1) node [shape=circle,draw] {}
+ ( 0,0) node [shape=circle,draw] {}
+ ( 1,1) node [shape=rectangle,draw] {}
+ (-1,1) node [shape=rectangle,draw] {};
+\end{tikzpicture}
+\end{codeexample}
+
+Hagen notes that this does not quite look like the final picture, but
+it seems like a good first step.
+
+Let us have a more detailed look at the code. The whole picture
+consists of a single path. Ignoring the |node| operations there is not
+much going on in this path: It is just a sequence of coordinates with
+nothing ``happening'' between them. Indeed, even if something were to
+happen like a line-to or a curve-to, the |\path| command would not
+``do'' anything with the resulting path. So, all the magic must be in
+the |node| commands.
+
+In the previous tutorial we learned that a |node| will add a piece of
+text at the last coordinate. Thus, each of the five nodes is added at
+a different position. In the above code, this text is empty
+(because of the empty |{}|). So, why do we see anything at all? The
+answer is the |draw| option for the |node| operation: It causes the
+``shape around the text'' to be drawn.
+
+So, the code |(0,2) node [shape=circle,draw] {}| means the following:
+``In the main path, add a move-to to the coordinate |(0,2)|. Then,
+temporarily suspend the construction of the main path while the node
+is build. This node will be a |circle| around an empty text. This
+circle is to be |draw|n, but not filled or otherwise used. Once this
+whole node is constructed, it is saved until after the
+main path is finished. Then, it is drawn.'' Then following
+|(0,1) node [shape=circle,draw] {}| then has the following effect:
+``Continue the main path with a move-to to |(0,1)|. Then construct a
+node at this position also. This node is also shown after the main
+path is finished.'' And so on.
+
+
+
+\subsection{Placing Nodes Using the At Syntax}
+
+Hagen now understands how the |node| operation adds nodes to the path,
+but it seems a bit silly to create a path using the |\path| operation,
+consisting of numerous superfluous move-to operations, only to place
+nodes. He is pleased to learn that there are ways to add nodes in a
+more sensible manner.
+
+First, the |node| operation allows one to add
+|at (|\meta{coordinate}|)| in order to directly specify where the node
+should be placed, sidestepping the rule that nodes are placed on the
+last coordinate. Hagen can then write the following:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \path node at ( 0,2) [shape=circle,draw] {}
+ node at ( 0,1) [shape=circle,draw] {}
+ node at ( 0,0) [shape=circle,draw] {}
+ node at ( 1,1) [shape=rectangle,draw] {}
+ node at (-1,1) [shape=rectangle,draw] {};
+\end{tikzpicture}
+\end{codeexample}
+
+Now Hagen is still left with a single empty path, but at least the
+path no longer contains strange move-tos. It turns out that this can
+be improved further: The |\node| command is an abbreviation for
+|\path node|, which allows Hagen to write:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node at ( 0,2) [circle,draw] {};
+ \node at ( 0,1) [circle,draw] {};
+ \node at ( 0,0) [circle,draw] {};
+ \node at ( 1,1) [rectangle,draw] {};
+ \node at (-1,1) [rectangle,draw] {};
+\end{tikzpicture}
+\end{codeexample}
+
+Hagen likes this syntax much better than the previous one. Note that
+Hagen has also omitted the |shape=| since, like |color=|, \tikzname\
+allows you to omit the |shape=| if there is no confusion.
+
+
+
+\subsection{Using Styles}
+
+Feeling adventurous, Hagen tries to make the nodes look nicer. In the
+final picture, the circles and rectangle should be filled with
+different colors, resulting in the following code:
+
+\begin{codeexample}[]
+\begin{tikzpicture}[thick]
+ \node at ( 0,2) [circle,draw=blue!50,fill=blue!20] {};
+ \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {};
+ \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {};
+ \node at ( 1,1) [rectangle,draw=black!50,fill=black!20] {};
+ \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {};
+\end{tikzpicture}
+\end{codeexample}
+
+While this looks nicer in the picture, the code starts to get a bit
+ugly. Ideally, we would like our code to transport the message ``there
+are three places and two transitions'' and not so much which
+filling colors should be used.
+
+To solve this problem, Hagen uses styles. He defines a style for
+places and another style for transitions:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [place/.style={circle,draw=blue!50,fill=blue!20,thick},
+ transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
+ \node at ( 0,2) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
+ \node at ( 1,1) [transition] {};
+ \node at (-1,1) [transition] {};
+\end{tikzpicture}
+\end{codeexample}
+
+
+\subsection{Node Size}
+
+Before Hagen starts naming and connecting the nodes, let us first
+make sure that the nodes get their final appearance. They are still
+too small. Indeed, Hagen wonders why they have any size at all, after
+all, the text is empty. The reason is than \tikzname\ automatically
+adds some space around the text. The amount is set using the option
+|inner sep|. So, to increase the size of the nodes, Hagen could write:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [inner sep=2mm,
+ place/.style={circle,draw=blue!50,fill=blue!20,thick},
+ transition/.style={rectangle,draw=black!50,fill=black!20,thick}]
+ \node at ( 0,2) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
+ \node at ( 1,1) [transition] {};
+ \node at (-1,1) [transition] {};
+\end{tikzpicture}
+\end{codeexample}
+
+However, this is not really the best way to achieve the desired
+effect. It is much better to use the |minimum size| option
+instead. This option allows Hagen to specify a minimum size that the
+node should have. If the nodes actually needs to be bigger because of
+a longer text, it will be larger, but if the text is empty, then the
+node will have |minimum size|. This option is also useful to ensure
+that several nodes containing different amounts of text have the same
+size. The options |minimum height| and |minimum width| allow you to
+specify the minimum height and width independently.
+
+So, what Hagen needs to do is to provide |minimum size| for the
+nodes. To be on the safe side, he also sets |inner sep=0pt|. This
+ensures that the nodes will really have size |minimum size| and not,
+for very small minimum sizes, the minimal size necessary to encompass
+the automatically added space.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}]
+ \node at ( 0,2) [place] {};
+ \node at ( 0,1) [place] {};
+ \node at ( 0,0) [place] {};
+ \node at ( 1,1) [transition] {};
+ \node at (-1,1) [transition] {};
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+
+\subsection{Naming Nodes}
+
+Hagen's next aim is to connect the nodes using arrows. This seems like
+a tricky business since the arrows should not start in the middle of
+the nodes, but somewhere on the border and Hagen would very much like
+to avoid computing these positions by hand.
+
+Fortunately, \pgfname\ will perform all the necessary calculations for
+him. However, he first has to assign names to the nodes so that he can
+reference them later on.
+
+There are two ways to name a node. The first is the use the |name=|
+option. The second method is to write the desired name in parentheses
+after the |node| operation. Hagen thinks that this second method seems
+strange, but he will soon change his opinion.
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+% ... setup styles
+\begin{tikzpicture}
+ \node (waiting 1) at ( 0,2) [place] {};
+ \node (critical 1) at ( 0,1) [place] {};
+ \node (semaphore) at ( 0,0) [place] {};
+ \node (leave critical) at ( 1,1) [transition] {};
+ \node (enter critical) at (-1,1) [transition] {};
+\end{tikzpicture}
+\end{codeexample}
+}
+
+Hagen is pleased to note that the names help in understanding the
+code. Names for nodes can be pretty arbitrary, but they should not
+contain commas, periods, parentheses, colons, and some other special
+characters. However, they can contain underscores and hyphens.
+
+The syntax for the |node| operation is quite liberal with respect to
+the order in which node names, the |at| specifier, and the options
+must come. Indeed, you can even have multiple option blocks between
+the |node| and the text in curly braces, they accumulate. You can
+rearrange them arbitrarily and perhaps the following might be preferable:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting 1) at ( 0,2) {};
+ \node[place] (critical 1) at ( 0,1) {};
+ \node[place] (semaphore) at ( 0,0) {};
+ \node[transition] (leave critical) at ( 1,1) {};
+ \node[transition] (enter critical) at (-1,1) {};
+\end{tikzpicture}
+\end{codeexample}
+}
+
+
+
+\subsection{Placing Nodes Using Relative Placement}
+
+Although Hagen still wishes to connect the nodes, he first wishes to
+address another problem again: The placement of the nodes. Although he
+likes the |at| syntax, in this particular case he would prefer placing
+the nodes ``relative to each other.'' So, Hagen would like to say that
+the |critical 1| node should be below the |waiting 1| node, wherever
+the |waiting 1| node might be. There are different ways of achieving
+this, but the nicest one in Hagen's case is the |below| option:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+\end{tikzpicture}
+\end{codeexample}
+}
+
+With the |positioning| library loaded, when an option like |below|
+is followed by |of|, then the position of the node is shifted
+such a manner that it is placed at the distance |node distance| in the
+specified direction of the given direction. The |node distance| is
+either the distance between the centers of the nodes (when the
+|on grid| option is set to true) or the distance between the borders
+(when the |on grid| option is set to false, which is the default).
+
+Even though the above code has the same effect the earlier code, Hagen
+can pass it to his colleagues who will be able to just read and
+understand it, perhaps without even having to see the picture.
+
+
+
+\subsection{Adding Labels Next to Nodes}
+
+Before we have a look at how Hagen can connect the nodes, let us add
+the capacity ``$s \le 3$'' to the bottom node. For this, two
+approaches are possible:
+\begin{enumerate}
+\item Hagen can just add a new node above the |north| anchor of the
+ |semaphore| node.
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+
+ \node [red,above] at (semaphore.north) {$s\le 3$};
+\end{tikzpicture}
+\end{codeexample}
+}
+This is a general approach that will ``always work.''
+
+\item Hagen can use the special |label| option. This option is given
+ to a |node| and it causes \emph{another} node to be added next to
+ the node where the option is given. Here is the idea: When we
+ construct the |semaphore| node, we wish to indicate that we want
+ another node with the capacity above it. For this, we use the option
+ |label=above:$s\le 3$|. This option is interpreted as follows: We
+ want a node above the |semaphore| node and this node should read
+ ``$s \le 3$.'' Instead of |above| we could also use things like
+ |below left| before the colon or a number like |60|.
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical,
+ label=above:$s\le3$] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+\end{tikzpicture}
+\end{codeexample}
+}
+ It is also possible to give multiple |label| options, this causes
+ multiple labels to be drawn.
+\begin{codeexample}[]
+\tikz
+ \node [circle,draw,label=60:$60^\circ$,label=below:$-90^\circ$] {my circle};
+\end{codeexample}
+ Hagen is not fully satisfied with the |label| option since the label
+ is not red. To achieve this, he has two options: First, he can
+ redefine the |every label| style. Second, he can add options to the
+ label's node. These options are given following the |label=|, so he
+ would write |label=[red]above:$s\le3$|. However, this does not quite
+ work since \TeX\ thinks that the |]| closes the whole option list of
+ the |semaphore| node. So, Hagen has to add braces and writes
+ |label={[red]above:$s\le3$}|. Since this looks a bit ugly, Hagen
+ decides to redefine the |every label| style.
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}[every label/.style={red}]
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical,
+ label=above:$s\le3$] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+\end{tikzpicture}
+\end{codeexample}
+}
+\end{enumerate}
+
+
+
+\subsection{Connecting Nodes}
+
+It is now high time to connect the nodes. Let us start with something
+simple, namely with the straight line from |enter critical| to
+|critical|. We want this line to start at the right side of
+|enter critical| and to end at the left side of |critical|. For
+this, we can use the \emph{anchors} of the nodes. Every node defines a
+whole bunch of anchors that lie on its border or inside it. For
+example, the |center| anchor is at the center of the node, the |west|
+anchor is on the left of the node, and so on. To access the coordinate
+of a node, we use a coordinate that contains the node's name followed
+by a dot, followed by the anchor's name:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+ \draw [->] (critical.west) -- (enter critical.east);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+Next, let us tackle the curve from |waiting| to |enter critical|. This
+can be specified using curves and controls:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+ \draw [->] (enter critical.east) -- (critical.west);
+ \draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm)
+ .. (enter critical.north);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+Hagen sees how he can now add all his edges, but the whole process
+seems a but awkward and not very flexible. Again, the code seems to
+obscure the structure of the graphic rather than showing it.
+
+So, let us start improving the code for the edges. First, Hagen can
+leave out the anchors:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+ \draw [->] (enter critical) -- (critical);
+ \draw [->] (waiting) .. controls +(left:8mm) and +(up:8mm)
+ .. (enter critical);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+Hagen is a bit surprised that this works. After all, how did
+\tikzname\ know that the line from |enter critical| to |critical|
+should actually start on the borders? Whenever \tikzname\ encounters a
+whole node name as a ``coordinate,'' it tries to ``be smart'' about
+the anchor that it should choose for this node. Depending on what
+happens next, \tikzname\ will choose an anchor that lies on the border
+of the node on a line to the next coordinate or control point. The
+exact rules are a bit complex, but the chosen point will usually be
+correct -- and when it is not, Hagen can still specify the desired
+anchor by hand.
+
+Hagen would now like to simplify the curve operation somehow. It turns
+out that this can be accomplished using a special path operation: the
+|to| operation. This operation takes many options (you can even define
+new ones yourself). One pair of option is useful for Hagen: The pair
+|in| and |out|. These options take angles at which a curve should
+leave or reach the start or target coordinates. Without these options,
+a straight line is drawn:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+ \draw [->] (enter critical) to (critical);
+ \draw [->] (waiting) to [out=180,in=90] (enter critical);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+There is another option for the |to| operation, that is even better
+suited to Hagen's problem: The |bend right| option. This option also
+takes an angle, but this angle only specifies the angle by which the
+curve is bend to the right:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {};
+ \draw [->] (enter critical) to (critical);
+ \draw [->] (waiting) to [bend right=45] (enter critical);
+ \draw [->] (enter critical) to [bend right=45] (semaphore);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+It is now time for Hagen to learn about yet another way of specifying
+edges: Using the |edge| path operation. This operation is very similar
+to the |to| operation, but there is one important difference: Like a
+node the edge generated by the |edge| operation is not part of the
+main path, but is added only later. This may not seem very important,
+but is has some nice consequences. For example, every edge can have
+its own arrow tips and its own color and so one and, still, all the
+edges can be given on the same path. This allows Hagen to write the
+following:
+
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+ \node[transition] (leave critical) [right=of critical] {};
+ \node[transition] (enter critical) [left=of critical] {}
+ edge [->] (critical)
+ edge [<-,bend left=45] (waiting)
+ edge [->,bend right=45] (semaphore);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+Each |edge| caused a new path to be constructed, consisting of a |to|
+between the node |enter critical| and the node following the |edge|
+command.
+
+The finishing touch is to introduce two styles |pre| and |post| and to
+use the |bend angle=45| option to set the bend angle once and for all:
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm}}
+\begin{codeexample}[]
+% Styles place and transition as before
+\begin{tikzpicture}
+ [bend angle=45,
+ pre/.style={<-,shorten <=1pt,>=stealth',semithick},
+ post/.style={->,shorten >=1pt,>=stealth',semithick}]
+
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+
+ \node[transition] (leave critical) [right=of critical] {}
+ edge [pre] (critical)
+ edge [post,bend right] (waiting)
+ edge [pre, bend left] (semaphore);
+ \node[transition] (enter critical) [left=of critical] {}
+ edge [post] (critical)
+ edge [pre, bend left] (waiting)
+ edge [post,bend right] (semaphore);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+
+
+
+\subsection{Adding Labels Next to Lines}
+
+The next thing that Hagen needs to add is the ``$2$'' at the arcs. For
+this Hagen can use \tikzname's automatic node placement: By adding the
+option |auto|, \tikzname\ will position nodes on curves and lines in
+such a way that they are not on the curve but next to it. Adding
+|swap| will mirror the label with respect to the line. Here is a
+general example:
+
+{
+\begin{codeexample}[]
+\begin{tikzpicture}[auto,bend right]
+ \node (a) at (0:1) {$0^\circ$};
+ \node (b) at (120:1) {$120^\circ$};
+ \node (c) at (240:1) {$240^\circ$};
+
+ \draw (a) to node {1} node [swap] {1'} (b)
+ (b) to node {2} node [swap] {2'} (c)
+ (c) to node {3} node [swap] {3'} (a);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+What is happening here? The nodes are given somehow inside the |to|
+operation! When this is done, the node is placed on the middle of the
+curve or line created by the |to| operation. The |auto| option then
+causes the node to be moved in such a way that it does not lie on the
+curve, but next to it. In the example we provide even two nodes on
+each |to| operation.
+
+For Hagen that |auto| option is not really necessary since the two
+``2'' labels could also easily be placed ``by hand.'' However, in a
+complicated plot with numerous edges automatic placement can be a
+blessing.
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm},
+pre/.style={<-,shorten <=1pt,>=stealth',semithick},
+post/.style={->,shorten >=1pt,>=stealth',semithick}}
+\begin{codeexample}[]
+% Styles as before
+\begin{tikzpicture}[bend angle=45]
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+
+ \node[transition] (leave critical) [right=of critical] {}
+ edge [pre] (critical)
+ edge [post,bend right] node[auto,swap] {2} (waiting)
+ edge [pre, bend left] (semaphore);
+ \node[transition] (enter critical) [left=of critical] {}
+ edge [post] (critical)
+ edge [pre, bend left] (waiting)
+ edge [post,bend right] (semaphore);
+\end{tikzpicture}
+\end{codeexample}
+}
+
+
+
+\subsection{Adding the Snaked Line and Multi-Line Text}
+
+With the node mechanism Hagen can now easily create the two Petri
+nets. What he is unsure of is how he can create the snaked line
+between the nets.
+
+For this he can use a \emph{decoration}.
+To draw the snake, Hagen only needs to set the two options
+|decoration=snake| and |decorate| on
+the path. This causes all lines of the path to be replaced by
+snakes. It is also possible to use snakes only in certain parts of a
+path, but Hagen will not need this.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->,decorate,decoration=snake] (0,0) -- (2,0);
+\end{tikzpicture}
+\end{codeexample}
+
+Well, that does not look quite right, yet. The problem is that the
+snake happens to end exactly at the position where the arrow
+begins. Fortunately, there is an option that helps here. Also, the
+snake should be a bit smaller, which can be influenced by even more
+options.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->,decorate,
+ decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
+ (0,0) -- (3,0);
+\end{tikzpicture}
+\end{codeexample}
+
+Now Hagen needs to add the text above the snake. This text is a bit
+challenging since it is a multi-line text. Hagen has two options for
+this: First, he can specify an |align=center| and then use the |\\|
+command to enforce the line breaks at the desired positions.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->,decorate,
+ decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
+ (0,0) -- (3,0)
+ node [above,align=center,midway]
+ {
+ replacement of\\
+ the \textcolor{red}{capacity}\\
+ by \textcolor{red}{two places}
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+Instead of specifying the line breaks ``by hand,'' Hagen can also
+specify a width for the text and let \TeX\ perform the line breaking
+for him:
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [->,decorate,
+ decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
+ (0,0) -- (3,0)
+ node [above,text width=3cm,align=center,midway]
+ {
+ replacement of the \textcolor{red}{capacity} by
+ \textcolor{red}{two places}
+ };
+\end{tikzpicture}
+\end{codeexample}
+
+
+
+\subsection{Using Layers: The Background Rectangles}
+
+Hagen still needs to add the background rectangles. These are a bit
+tricky: Hagen would like to draw the rectangles \emph{after} the Petri
+nets are finished. The reason is that only then can he conveniently
+refer to the coordinates that make up the corners of the
+rectangle. If Hagen draws the rectangle first, then he needs to know
+the exact size of the Petri net -- which he does not.
+
+The solution is to use \emph{layers}. When the background library is
+loaded, Hagen can put parts of his picture inside a |{pgfonlayer}|
+environment. Then this part of the picture becomes part of the layer
+that is given as an argument to this environment. When the
+|{tikzpicture}| environment ends, the layers are put on top of each
+other, starting with the background layer. This causes everything
+drawn on the background layer to be behind the main text.
+
+The next tricky question is, how big should the rectangle be?
+Naturally, Hagen can compute the size ``by hand'' or using some clever
+observations concerning the $x$- and $y$-coordinates of the nodes, but
+it would be nicer to just have \tikzname\ compute a rectangle into
+which all the nodes ``fit.'' For this, the |fit| library can be
+used. It defines the |fit| options, which, when give to a node, causes
+the node to be resized and shifted such that it exactly covers all the
+nodes and coordinates given as parameters to the |fit| option.
+
+{
+\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
+ inner sep=0pt,minimum size=6mm},
+transition/.style={rectangle,draw=black!50,fill=black!20,thick,
+ inner sep=0pt,minimum size=4mm},
+pre/.style={<-,shorten <=1pt,>=stealth',semithick},
+post/.style={->,shorten >=1pt,>=stealth',semithick}}
+\begin{codeexample}[]
+% Styles as before
+\begin{tikzpicture}[bend angle=45]
+ \node[place] (waiting) {};
+ \node[place] (critical) [below=of waiting] {};
+ \node[place] (semaphore) [below=of critical] {};
+
+ \node[transition] (leave critical) [right=of critical] {}
+ edge [pre] (critical)
+ edge [post,bend right] node[auto,swap] {2} (waiting)
+ edge [pre, bend left] (semaphore);
+ \node[transition] (enter critical) [left=of critical] {}
+ edge [post] (critical)
+ edge [pre, bend left] (waiting)
+ edge [post,bend right] (semaphore);
+
+ \begin{pgfonlayer}{background}
+ \node [fill=black!30,fit=(waiting) (critical) (semaphore)
+ (leave critical) (enter critical)] {};
+ \end{pgfonlayer}
+\end{tikzpicture}
+\end{codeexample}
+}
+
+
+
+
+\subsection{The Complete Code}
+
+Hagen has now finally put everything together. Only then does he learn
+that there is already a library for drawing Petri nets! It turns out
+that this library mainly provides the same definitions as Hagen
+did. For example, it defines a |place| style in a similar way as Hagen
+did. Adjusting the code so that it uses the library shortens Hagen
+code a bit, as shown in the following.
+
+First, Hagen needs less style definitions, but he still needs to
+specify the colors of places and transitions.
+
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ [node distance=1.3cm,on grid,>=stealth',bend angle=45,auto,
+ every place/.style= {minimum size=6mm,thick,draw=blue!75,fill=blue!20},
+ every transition/.style={thick,draw=black!75,fill=black!20},
+ red place/.style= {place,draw=red!75,fill=red!20},
+ every label/.style= {red}]
+\end{codeexample}
+
+Now comes the code for the nets:
+
+{
+\tikzset{%
+ every place/.style={minimum size=6mm,thick,draw=blue!75,fill=blue!20},
+ every transition/.style={thick,draw=black!75,fill=black!20},
+ red place/.style={place,draw=red!75,fill=red!20},
+ every label/.style={red},
+ every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}}
+\tikzexternaldisable
+\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}]
+ \node [place,tokens=1] (w1) {};
+ \node [place] (c1) [below=of w1] {};
+ \node [place] (s) [below=of c1,label=above:$s\le 3$] {};
+ \node [place] (c2) [below=of s] {};
+ \node [place,tokens=1] (w2) [below=of c2] {};
+
+ \node [transition] (e1) [left=of c1] {}
+ edge [pre,bend left] (w1)
+ edge [post,bend right] (s)
+ edge [post] (c1);
+ \node [transition] (e2) [left=of c2] {}
+ edge [pre,bend right] (w2)
+ edge [post,bend left] (s)
+ edge [post] (c2);
+ \node [transition] (l1) [right=of c1] {}
+ edge [pre] (c1)
+ edge [pre,bend left] (s)
+ edge [post,bend right] node[swap] {2} (w1);
+ \node [transition] (l2) [right=of c2] {}
+ edge [pre] (c2)
+ edge [pre,bend right] (s)
+ edge [post,bend left] node {2} (w2);
+\end{codeexample}
+}
+
+{
+\tikzset{
+every place/.style= {minimum size=6mm,thick,draw=blue!75,fill=blue!20},
+every transition/.style={thick,draw=black!75,fill=black!20},
+red place/.style= {place,draw=red!75,fill=red!20},
+every label/.style={red},
+every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}}
+\tikzexternaldisable
+\begin{codeexample}[pre=\begin{tikzpicture},post=\end{tikzpicture}]
+ \begin{scope}[xshift=6cm]
+ \node [place,tokens=1] (w1') {};
+ \node [place] (c1') [below=of w1'] {};
+ \node [red place] (s1') [below=of c1',xshift=-5mm]
+ [label=left:$s$] {};
+ \node [red place,tokens=3] (s2') [below=of c1',xshift=5mm]
+ [label=right:$\bar s$] {};
+ \node [place] (c2') [below=of s1',xshift=5mm] {};
+ \node [place,tokens=1] (w2') [below=of c2'] {};
+
+ \node [transition] (e1') [left=of c1'] {}
+ edge [pre,bend left] (w1')
+ edge [post] (s1')
+ edge [pre] (s2')
+ edge [post] (c1');
+ \node [transition] (e2') [left=of c2'] {}
+ edge [pre,bend right] (w2')
+ edge [post] (s1')
+ edge [pre] (s2')
+ edge [post] (c2');
+ \node [transition] (l1') [right=of c1'] {}
+ edge [pre] (c1')
+ edge [pre] (s1')
+ edge [post] (s2')
+ edge [post,bend right] node[swap] {2} (w1');
+ \node [transition] (l2') [right=of c2'] {}
+ edge [pre] (c2')
+ edge [pre] (s1')
+ edge [post] (s2')
+ edge [post,bend left] node {2} (w2');
+ \end{scope}
+\end{codeexample}
+}
+
+The code for the background and the snake is the following:
+
+\begin{codeexample}[code only]
+ \begin{pgfonlayer}{background}
+ \node (r1) [fill=black!10,rounded corners,fit=(w1)(w2)(e1)(e2)(l1)(l2)] {};
+ \node (r2) [fill=black!10,rounded corners,fit=(w1')(w2')(e1')(e2')(l1')(l2')] {};
+ \end{pgfonlayer}
+
+ \draw [shorten >=1mm,-to,thick,decorate,
+ decoration={snake,amplitude=.4mm,segment length=2mm,
+ pre=moveto,pre length=1mm,post length=2mm}]
+ (r1) -- (r2) node [above=1mm,midway,text width=3cm,align=center]
+ {replacement of the \textcolor{red}{capacity} by \textcolor{red}{two places}};
+\end{tikzpicture}
+\end{codeexample}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
index 8b9cfe6bae9..b2dcfbe5a05 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
@@ -26,7 +26,7 @@ Karl was never entirely satisfied with the result.
Karl's son, who was even less satisfied with the results (he did not
have to take the exams, after all), told Karl that he might wish
to try out a new package for creating graphics. A bit confusingly,
-this package seems to have two names: First, Karl had to download and
+this package seems to have two names: First, Karl had to download and
install a package called \pgfname. Then it turns out that inside this
package there is another package called \tikzname, which is supposed to
stand for ``\tikzname\ ist \emph{kein} Zeichenprogramm.'' Karl finds this
@@ -65,7 +65,7 @@ cosine. What he would like to have is something that looks like this
% The graphic
\draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);
-
+
\draw (0,0) circle (1cm);
\begin{scope}[axes]
@@ -74,20 +74,20 @@ cosine. What he would like to have is something that looks like this
\foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1}
\draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] {$\xtext$};
-
+
\foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}
\draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$};
\end{scope}
-
+
\filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm);
\draw (15:2mm) node[anglecolor] {$\alpha$};
-
+
\draw[important line,sincolor]
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} +(0,-.5);
-
+
\draw[important line,coscolor]
(0,0) -- node[below=2pt,fill=white] {$\cos \alpha$} (\costhirty,0);
-
+
\draw[important line,tancolor] (1,0) --
node [right=1pt,fill=white]
{
@@ -96,7 +96,7 @@ cosine. What he would like to have is something that looks like this
} (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
\draw (0,0) -- (t);
-
+
\draw[xshift=1.85cm] node [right,text width=6cm,information text]
{
The {\color{anglecolor} angle $\alpha$} is $30^\circ$ in the
@@ -110,10 +110,10 @@ cosine. What he would like to have is something that looks like this
line, which is the {\color{coscolor}cosine of $\alpha$}, must be
\[
{\color{coscolor}\cos\alpha} = \sqrt{1 - 1/4} = \textstyle
- \frac{1}{2} \sqrt 3.
+ \frac{1}{2} \sqrt 3.
\]%
This shows that {\color{tancolor}$\tan \alpha$}, which is the
- height of the orange line, is
+ height of the orange line, is
\[
{\color{tancolor}\tan\alpha} = \frac{{\color{sincolor}\sin
\alpha}}{\color{coscolor}\cos \alpha} = 1/\sqrt 3.
@@ -160,7 +160,7 @@ We are working on
Admittedly, not quite the whole picture, yet, but we
do have the axes established. Well, not quite, but we have the lines
that make up the axes drawn. Karl suddenly has a sinking feeling
-that the picture is still some way off.
+that the picture is still some way off.
Let's have a more detailed look at the code. First, the package
|tikz| is loaded. This package is a so-called ``frontend'' to the
@@ -187,7 +187,7 @@ Karl's wife Gerda, who also happens to be a math teacher, is not a
``the old way.'' She can also use \tikzname. Instead of
|\usepackage{tikz}| she has to write |\input tikz.tex| and instead of
|\begin{tikzpicture}| she writes |\tikzpicture| and instead of
- |\end{tikzpicture}| she writes |\endtikzpicture|.
+ |\end{tikzpicture}| she writes |\endtikzpicture|.
Thus, she would use:
\begin{codeexample}[code only]
@@ -206,7 +206,7 @@ We are working on
Gerda can typeset this file using either |pdftex| or |tex| together
with |dvips|. \tikzname\ will automatically discern which driver she is
-using. If she wishes to use |dvipdfm| together with |tex|, she
+using. If she wishes to use |dvipdfm| together with |tex|, she
either needs to modify the file |pgf.cfg| or can write
|\def\pgfsysdriver{pgfsys-dvipdfm.def}| somewhere \emph{before} she
inputs |tikz.tex| or |pgf.tex|.
@@ -219,7 +219,7 @@ Karl's uncle Hans uses Con\TeX t. Like Gerda, Hans can also use
\tikzname. Instead of |\usepackage{tikz}| he says
|\usemodule[tikz]|. Instead of |\begin{tikzpicture}| he writes
|\starttikzpicture| and instead of |\end{tikzpicture}| he writes
-|\stoptikzpicture|.
+|\stoptikzpicture|.
His version of the example looks like this:
\begin{codeexample}[code only]
@@ -232,16 +232,19 @@ His version of the example looks like this:
\draw (-1.5,0) -- (1.5,0);
\draw (0,-1.5) -- (0,1.5);
\stoptikzpicture.
-\stoptext
+\stoptext
\end{codeexample}
-Hans will now typeset this file in the usual way using |texexec|.
+Hans will now typeset this file in the usual way using
+|texexec|\footnote{Note that \pgfname/\tikzname{} is not supported by
+ recent Con\TeX t versions (like mark IV, the Lua\TeX-aware part of
+ Con\TeX t).}.
\subsection{Straight Path Construction}
-The basic building block of all pictures in \tikzname\ is the path.
+The basic building block of all pictures in \tikzname\ is the path.
A \emph{path} is a series of straight lines and curves that are
connected (that is not the whole picture, but let us ignore the
complications for the moment). You start a path by specifying the
@@ -265,7 +268,7 @@ puts it inside a |{tikzpicture}| environment. As a rule of thumb, all
\tikzname\ graphic drawing commands must occur as an argument of |\tikz|
or inside a |{tikzpicture}| environment. Fortunately, the command
|\draw| will only be defined inside this environment, so there is
-little chance that you will accidentally do something wrong here.
+little chance that you will accidentally do something wrong here.
@@ -296,7 +299,7 @@ Here is an example (the control points have been added for clarity):
The general syntax for extending a path in a ``curved'' way is
|.. controls| \meta{first control point} |and| \meta{second control
point} |..| \meta{end point}. You can leave out the |and|
-\meta{second control point}, which causes the first one to be used
+\meta{second control point}, which causes the first one to be used
twice.
So, Karl can now add the first half circle to the picture:
@@ -328,7 +331,7 @@ the following example: (Note that the previous position is used as the
You can also append an ellipse to the path using the |ellipse|
operation. Instead of a single radius you can specify two of them, one
for the $x$-direction and one for the $y$-direction, separated by
-|and|:
+|and|:
\begin{codeexample}[]
\tikz \draw (0,0) ellipse (20pt and 10pt);
@@ -339,7 +342,7 @@ point in an arbitrary direction (a ``turned ellipse'' like \tikz
\draw[rotate=30] (0,0) ellipse (6pt and 3pt);) you can use
transformations, which are explained later. The code for the little
ellipse is |\tikz \draw[rotate=30] (0,0) ellipse (6pt and 3pt);|, by
-the way.
+the way.
So, returning to Karl's problem, he can write
|\draw (0,0) circle (1cm);| to draw the circle:
@@ -357,7 +360,7 @@ At this point, Karl is a bit alarmed that the circle is so small when
he wants the final picture to be much bigger. He is pleased to learn
that \tikzname\ has powerful transformation options and scaling
everything by a factor of three is very easy. But let us leave the
-size as it is for the moment to save some space.
+size as it is for the moment to save some space.
@@ -424,7 +427,7 @@ Karl adds two more options to the |\draw| command that draws the
grid. First, he uses the color |gray| for the grid lines. Second, he
reduces the line width to |very thin|. Finally, he swaps the ordering
of the commands so that the grid is drawn first and everything else on
-top.
+top.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -449,17 +452,17 @@ instead of |gray|, he could provide the following option somewhere:
help lines/.style={color=blue!50,very thin}
\end{codeexample}
The effect of this ``style setter'' is that in the current
-scope or environement the |help lines| option has the same effect as
+scope or environment the |help lines| option has the same effect as
|color=blue!50,very thin|.
Using styles makes your graphics code more flexible. You can
-change the way things look easily in a consistent manner.
+change the way things look easily in a consistent manner.
Normally, styles are defined at the beginning of a picture. However,
you may sometimes wish to define a style globally, so that all
pictures of your document can use this style. Then you can easily
change the way all graphics look by changing this one style. In this
situation you can use the |\tikzset| command at the beginning of the
-document as in
+document as in
\begin{codeexample}[code only]
\tikzset{help lines/.style=very thin}
\end{codeexample}
@@ -475,8 +478,8 @@ the |grid| style Karl could say
Styles are made even more powerful by parametrization. This means
that, like other options, styles can also be used with a
-parameter. For instance, Karl could parametrize his grid so that, by
-default, it is blue, but he could also use another color.
+parameter. For instance, Karl could parameterize his grid so that, by
+default, it is blue, but he could also use another color.
\begin{codeexample}[code only]
\begin{tikzpicture}
@@ -522,7 +525,7 @@ and |densely dotted|. If he really, really needs to, Karl can also
define much more complex dashing patterns with the |dash pattern|
option, but his son insists that dashing is to be used with utmost
care and mostly distracts. Karl's son claims that complicated dashing
-patterns are evil. Karl's students do not care about dashing patterns.
+patterns are evil. Karl's students do not care about dashing patterns.
@@ -530,7 +533,7 @@ patterns are evil. Karl's students do not care about dashing patterns.
Our next obstacle is to draw the arc for the angle. For this, the
|arc| path construction operation is useful, which draws part of a
-circle or ellipse. This |arc| operation must be followed by a triple in
+circle or ellipse. This |arc| operation must be followed by a triple in
rounded brackets, where the components of the triple are separated by
colons. The first two components are angles, the last one is a
radius. An example would be |(10:80:10pt)|, which means ``an arc from
@@ -541,7 +544,7 @@ radius. This gives: |(0:30:3mm)|.
When one uses the arc path construction operation, the specified arc will
be added with its starting point at the current position. So, we first
-have to ``get there.''
+have to ``get there.''
\begin{codeexample}[]
\begin{tikzpicture}
@@ -584,7 +587,7 @@ graphics a bit so that we can focus on the ``interesting''
parts. Clipping is pretty easy in \tikzname. You can use the |\clip|
command clip all subsequent drawing. It works like |\draw|, only it
does not draw anything, but uses the given path to clip everything
-subsequently.
+subsequently.
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
@@ -603,7 +606,7 @@ option. (This is not the whole picture: You can also use the |\clip|
command and add the |draw| option. Well, that is also not the whole
picture: In reality, |\draw| is just a shorthand for |\path[draw]|
and |\clip| is a shorthand for |\path[clip]| and you could also say
-|\path[draw,clip]|.) Here is an example:
+|\path[draw,clip]|.) Here is an example:
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
@@ -719,7 +722,7 @@ Karl briefly considers the possibility of making the angle ``more
fancy'' by \emph{shading} it. Instead of filling the with a uniform
color, a smooth transition between different colors is used. For this,
|\shade| and |\shadedraw|, for shading and drawing at the same time,
-can be used:
+can be used:
\begin{codeexample}[]
\tikz \shade (0,0) rectangle (2,1) (3,0.5) circle (.5cm);
@@ -770,7 +773,7 @@ the $x$-direction and 1cm in the $y$-direction, respectively.
In order to specify points in polar coordinates, use the notation
|(30:1cm)|, which means 1cm in direction 30 degree. This is obviously
quite useful to ``get to the point $(\cos 30^\circ,\sin 30^\circ)$ on
-the circle.''
+the circle.''
You can add a single |+| sign in front of a coordinate or two of
them as in |+(1cm,0cm)| or |++(0cm,2cm)|. Such coordinates are interpreted
@@ -802,7 +805,7 @@ line through $p$ and a horizontal line through $q$.''
Next, let us draw the cosine line. One way would be to say
\verb!(30:1cm |- 0,0) -- (0,0)!. Another way is the following: we
-``continue'' from where the sine ends:
+``continue'' from where the sine ends:
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
@@ -818,7 +821,7 @@ Next, let us draw the cosine line. One way would be to say
\end{tikzpicture}
\end{codeexample}
-Note the there is no |--| between |(30:1cm)| and |+(0,-0.5)|. In
+Note the 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 to $(\cos 30^\circ,1/2)$. Next, there comes
another coordinate specification, so I move my pen there without drawing
@@ -849,42 +852,39 @@ By comparison, when using a single |+|, the coordinates are different:
Naturally, all of this could have been written more clearly and more
-economically like this (either with a single of a double |+|):
+economically like this (either with a single of a double |+|):
\begin{codeexample}[]
\tikz \draw (0,0) rectangle +(1,1) (1.5,0) rectangle +(1,1);
\end{codeexample}
+\subsection{Intersecting Paths}
Karl is left with the line for $\tan \alpha$, which seems difficult to
specify using transformations and polar coordinates. For this he needs
another way of specifying coordinates: Karl can specify intersections
-of lines as coordinates. The line for $\tan \alpha$ starts at $(1,0)$
+of paths as coordinates. The line for $\tan \alpha$ starts at $(1,0)$
and goes upward to a point that is at the intersection of a line going
-``up'' and a line going from the origin through |(30:1cm)|. The syntax
-for this point is the following:
+``up'' and a line going from the origin through |(30:1cm)|. Such
+computations are made available by the |intersections| library.
-\begin{codeexample}[code only]
-\draw[very thick,orange] (1,0) -- (intersection of 1,0--1,1 and 0,0--30:1cm);
-\end{codeexample}
+What Karl must do is to create two ``invisible'' paths that intersect
+at the position of interest. Creating paths that are not otherwise
+seen can be done using the |\path| command without any options like
+|draw| or |fill|. Then, Karl can add the |name path| option to the
+path for later reference. Once the paths have been constructed, Karl
+can use the |name intersections| to assign names to the coordinate for
+later reference.
-In the following, two final examples of how to use relative
-positioning are presented. Note that the transformation options,
-which are explained later, are often more useful for shifting than
-relative positioning.
-
-\begin{codeexample}[]
-\begin{tikzpicture}[scale=0.5]
- \draw (0,0) -- (90:1cm) arc (90:360:1cm) arc (0:30:1cm) -- cycle;
- \draw (60:5pt) -- +(30:1cm) arc (30:90:1cm) -- cycle;
+\begin{codeexample}[code only]
+\path [name path=upward line] (1,0) -- (1,1);
+\path [name path=sloped line] (0,0) -- (30:1.5cm); % a bit longer, so that there is an intersection
- \draw (3,0) +(0:1cm) -- +(72:1cm) -- +(144:1cm) -- +(216:1cm) --
- +(288:1cm) -- cycle;
-\end{tikzpicture}
+\draw [name intersections={of=upward line and sloped line, by=x}]
+ [very thick,orange] (1,0) -- (x);
\end{codeexample}
-
\subsection{Adding Arrow Tips}
Karl now wants to add the little arrow tips at the end of the axes. He has
@@ -907,7 +907,11 @@ It turns out that adding arrow tips is pretty easy: Karl adds the option
(0:30:3mm) -- cycle;
\draw[red,very thick] (30:1cm) -- +(0,-0.5);
\draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0);
- \draw[orange,very thick] (1,0) -- (intersection of 1,0--1,1 and 0,0--30:1cm);
+
+ \path [name path=upward line] (1,0) -- (1,1);
+ \path [name path=sloped line] (0,0) -- (30:1.5cm);
+ \draw [name intersections={of=upward line and sloped line, by=x}]
+ [very thick,orange] (1,0) -- (x);
\end{tikzpicture}
\end{codeexample}
@@ -944,7 +948,7 @@ sometimes, he might need to use some other kinds of arrow.
To do so, Karl can say |>=|\meta{right arrow tip kind}, where
\meta{right arrow tip kind} is a special arrow tip specification. For
example, if Karl says |>=stealth|, then he tells \tikzname\
-that he would like ``stealth-fighter-like'' arrow tips:
+that he would like ``stealth-fighter-like'' arrow tips:
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
@@ -961,7 +965,7 @@ students discuss this at some point.
In addition to |stealth| there are several other predefined arrow tip
kinds Karl can choose from, see
Section~\ref{section-library-arrows}. Furthermore, he can define
-arrows types himself, if he needs new ones.
+arrows types himself, if he needs new ones.
@@ -993,7 +997,7 @@ Here is an example:
\draw (1,0) -- (1,1);
\draw (2,0) -- (2,1);
\end{scope}
- \draw (3,0) -- (3,1);
+ \draw (3,0) -- (3,1);
\end{tikzpicture}
\end{codeexample}
@@ -1022,7 +1026,7 @@ options apply to the whole path. Indeed, all transformation options do
\emph{not} apply to the whole path, but only to ``everything following
them on the path.'' We will have a more detailed look at this in a
moment. Nevertheless, all options given during a path construction
-apply only to this path.
+apply only to this path.
@@ -1032,7 +1036,7 @@ When you specify a coordinate like |(1cm,1cm)|, where is that
coordinate placed on the page? To determine the position, \tikzname,
\TeX, and \textsc{pdf} or PostScript all apply certain transformations
to the given coordinate in order to determine the finally position on
-the page.
+the page.
\tikzname\ provides numerous options that allow you to transform
coordinates in \pgfname's private coordinate system. For example, the
@@ -1068,7 +1072,7 @@ a flip), and |xslant| and |yslant| for slanting. If these
transformation and those that I have not mentioned are not
sufficient, the |cm| option allows you to apply an arbitrary
transformation matrix. Karl's students, by the way, do not know what a
-transformation matrix is.
+transformation matrix is.
@@ -1079,7 +1083,7 @@ $-1/2$, $1/2$, and $1$. For this, it would be nice to use some kind of
``loop,'' especially since he wishes to do the same thing at each of
these positions. There are different packages for doing this. \LaTeX\
has its own internal command for this, |pstricks| comes along with the
-powerful |\mulitdo| command. All of these can be used together with
+powerful |\multido| command. All of these can be used together with
\pgfname\ and \tikzname, so if you are familiar with them, feel free to
use them. \pgfname\ introduces yet another command, called |\foreach|,
which I introduced since I could never remember the syntax of the other
@@ -1127,9 +1131,9 @@ braces. He could also have used, say,
Karl is curious what would happen in a more complicated situation
where there are, say, 20 ticks. It seems bothersome to explicitly
mention all these numbers in the set for |\foreach|. Indeed, it is
-possible to use |...| inside the |\foreach| statement to iterate over
+possible to use |...| inside the |\foreach| statement to iterate over
a large number of values (which must, however, be dimensionless
-real numbers) as in the following example:
+real numbers) as in the following example:
\begin{codeexample}[]
\tikz \foreach \x in {1,...,10}
@@ -1166,7 +1170,7 @@ gives the idea.
\subsection{Adding Text}
Karl is, by now, quite satisfied with the picture. However, the most
-important parts, namely the labels, are still missing!
+important parts, namely the labels, are still missing!
\tikzname\ offers an easy-to-use and powerful system for adding text and,
more generally, complex shapes to a picture at specific positions. The
@@ -1180,7 +1184,7 @@ able to perform some magic so that it is even possible to use verbatim
text inside the boxes) and then placed at the current position, that
is, at the last specified position (possibly shifted a bit, according
to the given options). However, all nodes are drawn only after the
-path has been completely drawn/filled/shaded/clipped/whatever.
+path has been completely drawn/filled/shaded/clipped/whatever.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1192,7 +1196,7 @@ path has been completely drawn/filled/shaded/clipped/whatever.
\end{codeexample}
Obviously, Karl would not only like to place nodes \emph{on} the last
-specified position, but also to the left or the
+specified position, but also to the left or the
right of these positions. For this, every node object that you
put in your picture is equipped with several \emph{anchors}. For
example, the |north| anchor is in the middle at the upper end of the shape,
@@ -1228,7 +1232,7 @@ same as |anchor=north|. Similarly, |above right| does the same as
dimension argument. If given, the shape will additionally be shifted
downwards by the given amount. So, |below=1pt| can be used to put
a text label below some point and, additionally shift it 1pt
-downwards.
+downwards.
Karl is not quite satisfied with the ticks. He would like to have
$1/2$ or $\frac{1}{2}$ shown instead of $0.5$, partly to show off the
@@ -1248,7 +1252,7 @@ specify two (or even more) variables separated by a slash as in
iterates must also be of the form \meta{first}|/|\meta{second}. In
each iteration, |\x| will be set to \meta{first} and |\xtext| will be
set to \meta{second}. If no \meta{second} is given, the \meta{first}
-will be used again. So, here is the new code for the ticks:
+will be used again. So, here is the new code for the ticks:
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
@@ -1272,13 +1276,13 @@ interfere with the numbers and decrease their legibility. Karl is not
very concerned by this (his students do not even notice), but his son
insists that there is an easy solution: Karl can add the
|[fill=white]| option to fill out the background of the text shape
-with a white color.
+with a white color.
The next thing Karl wants to do is to add the labels like $\sin
\alpha$. For this, he would like to place a label ``in the middle of
line.'' To do so, instead of specifying the label
|node {$\sin\alpha$}| directly after one of the endpoints of the line
-(which would place
+(which would place
the label at that endpoint), Karl can give the label directly after
the |--|, before the coordinate. By default, this places the label in
the middle of the line, but the |pos=| options can be used to modify
@@ -1295,18 +1299,20 @@ modify this position:
\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis);
\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
\draw (0,0) circle (1cm);
-
+
\draw[very thick,red]
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
\draw[very thick,blue]
(30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
- \draw[very thick,orange] (1,0) -- node [right=1pt,fill=white]
+ \path [name path=upward line] (1,0) -- (1,1);
+ \path [name path=sloped line] (0,0) -- (30:1.5cm);
+ \draw [name intersections={of=upward line and sloped line, by=t}]
+ [very thick,orange] (1,0) -- node [right=1pt,fill=white]
{$\displaystyle \tan \alpha \color{black}=
- \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$}
- (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
+ \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} (t);
\draw (0,0) -- (t);
-
+
\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$};
\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1}
@@ -1335,7 +1341,7 @@ desired effect. So, here is the full code:
\begin{codeexample}[code only]
\begin{tikzpicture}
- [scale=3,line cap=round
+ [scale=3,line cap=round,
% Styles
axes/.style=,
important line/.style={very thick},
@@ -1352,7 +1358,7 @@ desired effect. So, here is the full code:
% The graphic
\draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);
-
+
\draw (0,0) circle (1cm);
\begin{scope}[axes]
@@ -1361,27 +1367,29 @@ desired effect. So, here is the full code:
\foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1}
\draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] {$\xtext$};
-
+
\foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}
\draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$};
\end{scope}
-
+
\filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm);
\draw (15:2mm) node[anglecolor] {$\alpha$};
-
+
\draw[important line,sincolor]
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
-
+
\draw[important line,coscolor]
(30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
-
- \draw[important line,tancolor] (1,0) -- node[right=1pt,fill=white] {
- $\displaystyle \tan \alpha \color{black}=
- \frac{{\color{sincolor}\sin \alpha}}{\color{coscolor}\cos \alpha}$}
- (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);
+
+ \path [name path=upward line] (1,0) -- (1,1);
+ \path [name path=sloped line] (0,0) -- (30:1.5cm);
+ \draw [name intersections={of=upward line and sloped line, by=t}]
+ [very thick,orange] (1,0) -- node [right=1pt,fill=white]
+ {$\displaystyle \tan \alpha \color{black}=
+ \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} (t);
\draw (0,0) -- (t);
-
+
\draw[xshift=1.85cm]
node[right,text width=6cm,information text]
{
@@ -1395,4 +1403,3 @@ desired effect. So, here is the full code:
};
\end{tikzpicture}
\end{codeexample}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf b/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf
new file mode 100644
index 00000000000..4235f281312
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/texmf.cnf
@@ -0,0 +1,83 @@
+% Part 3: Array and other sizes for TeX (and Metafont and MetaPost).
+%
+% If you want to change some of these sizes only for a certain TeX
+% variant, the usual dot notation works, e.g.,
+% main_memory.hugetex = 20000000
+%
+% If a change here appears to be ignored, try redumping the format file
+% with fmtutil-sys.
+
+% Memory. Must be less than 8,000,000 total.
+%
+% main_memory is relevant only to initex, extra_mem_* only to non-ini.
+% Thus, have to redump the .fmt file after changing main_memory; to add
+% to existing fmt files, increase extra_mem_*. (To get an idea of how
+% much, try \tracingstats=2 in your TeX source file;
+% web2c/tests/memtest.tex might also be interesting.)
+%
+% To increase space for boxes (as might be needed by, e.g., PiCTeX),
+% increase extra_mem_bot.
+%
+% For some xy-pic samples, you may need as much as 700000 words of memory.
+% For the vast majority of documents, 60000 or less will do.
+%
+main_memory = 9000000 % words of inimemory available; also applies to inimf&mp
+extra_mem_top = 6000000 % extra high memory for chars, tokens, etc.
+extra_mem_bot = 6000000 % extra low memory for boxes, glue, breakpoints, etc.
+
+% Words of font info for TeX (total size of all TFM files, approximately).
+% Must be >= 20000 and <= 4000000 (without tex.ch changes).
+%font_mem_size = 1200000
+
+% Total number of fonts. Must be >= 50 and <= 2000 (without tex.ch changes).
+%font_max = 2000
+
+% Extra space for the hash table of control sequences (which allows 10K
+% names as distributed).
+hash_extra = 200000
+
+% Max number of characters in all strings, including all error messages,
+% help texts, font names, control sequences. These values apply to TeX and MP.
+pool_size = 3850000
+% Minimum pool space after TeX/MP's own strings; must be at least
+% 25000 less than pool_size, but doesn't need to be nearly that large.
+%string_vacancies = 90000
+% Maximum number of strings.
+%max_strings = 100000
+% min pool space left after loading .fmt
+%pool_free = 47500
+
+% Buffer size. TeX uses the buffer to contain input lines, but macro
+% expansion works by writing material into the buffer and reparsing the
+% line. As a consequence, certain constructs require the buffer to be
+% very large, even though most documents can be handled with a small value.
+%buf_size = 200000
+
+% Hyphenation trie. The maximum possible is 4194303 (ssup_trie_size in
+% the sources), but we don't need that much. The value here suffices
+% for all known free hyphenation patterns to be loaded simultaneously
+% (as TeX Live does).
+%
+%trie_size = 400000
+
+%hyph_size = 8191 % prime number of hyphenation exceptions, >610, <32767.
+ % http://primes.utm.edu/curios/page.php/8191.html
+%nest_size = 500 % simultaneous semantic levels (e.g., groups)
+%max_in_open = 15 % simultaneous input files and error insertions
+%param_size = 10000 % simultaneous macro parameters
+%save_size = 5000 % for saving values outside current group
+save_size=800000
+stack_size = 500000 % simultaneous input sources
+
+
+
+
+% It's probably inadvisable to change these. At any rate, we must have:
+% 45 < error_line < 255;
+% 30 < half_error_line < error_line - 15;
+% 60 <= max_print_line;
+% These apply to Metafont and MetaPost as well.
+error_line = 254
+half_error_line = 127
+max_print_line = 32000
+
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile
index 4b504e6d2ce..6ac2cd93235 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile
@@ -17,4 +17,17 @@ pgfmanual.pdf: $(doc).tex $(doc).ind
dvipdfm -p a4 $(doc)
clean:
- rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps,dvi}
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
new file mode 100644
index 00000000000..b0d1d980eec
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
@@ -0,0 +1,33 @@
+rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
+doc = pgfmanual
+latex = latex -shell-escape
+TEXINPUTS := ../../text-en:$(TEXINPUTS)
+
+all: $(doc).pdf
+
+pgfmanual.idx:
+ touch pgfmanual.idx
+
+pgfmanual.ind: pgfmanual.idx
+ makeindex $(doc).idx
+
+pgfmanual.pdf: $(doc).tex $(doc).ind
+ (TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+ (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+ dvipdfmx -p a4 $(doc)
+
+clean:
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex
new file mode 100644
index 00000000000..987b9fdf9c4
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex
@@ -0,0 +1,16 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\documentclass[a4paper]{ltxdoc}
+
+% pgf version is defined in \pgfversion in file
+% generic/pgf/utilities/pgfrcs.code.tex
+
+\input{../pgfmanual-dvipdfmx.cfg}
+\input{../../text-en/pgfmanual-en-main.tex}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg
new file mode 100644
index 00000000000..7d619800b1b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg
@@ -0,0 +1,18 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\usepackage[dvipdfmx]{graphicx}
+% This will tell everyone which driver we are using.
+
+\usepackage[dvipdfmx,pdfborder={0 0 0}]{hyperref}
+
+% Make sure to compile this using latex + dvipdfmx.
+
+\usepackage[dvipdfmx]{xcolor}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile
index 6b59132e600..285575a6f4b 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile
@@ -18,5 +18,18 @@ pgfmanual.ps: $(doc).tex $(doc).ind
gs -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -dCompatibilityLevel=1.4 -sOutputFile=$(doc).pdf $(doc).ps
clean:
- rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps,dvi}
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile
index 5b023dbae5e..1983d547501 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile
@@ -1,10 +1,21 @@
rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
doc = pgfmanual
latex = pdflatex
-TEXINPUTS := ../../text-en:$(TEXINPUTS)
+TEXINPUTS := ../../text-en:../../images:$(TEXINPUTS)
all: $(doc).pdf
+# make dist will also enable automatic cross references in codeexamples.
+# This is disabled by default as it requires higher mem limits.
+#
+# It employs a 'texmf.cnf' which lies in ../../text-en.
+dist: FORCE
+ export TEXMFCNF="../../text-en:$(TEXMFCNF)"; \
+ export TEXINPUTS="$(TEXINPUTS)"; \
+ $(latex) '\def\pgfautoxrefs{1}\pdfminorversion=5 \pdfobjcompresslevel=2 \input{$(doc)}'
+ makeindex $(doc).idx
+ @echo "$(doc).pdf remade with auto-xref support. Check if auto-xrefs work and rerun make dist if not."
+
pgfmanual.idx:
touch pgfmanual.idx
@@ -14,6 +25,22 @@ pgfmanual.ind: pgfmanual.idx
pgfmanual.pdf: $(doc).tex $(doc).ind
TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+ @echo "Use 'make dist' to generate auto-xrefs."
+
+FORCE:
clean:
- rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg}
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist
new file mode 100644
index 00000000000..5bbdfc855da
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.figlist
@@ -0,0 +1,1464 @@
+pgfmanual-figure0
+pgfmanual-figure1
+pgfmanual-figure2
+pgfmanual-figure3
+pgfmanual-figure4
+pgfmanual-figure5
+pgfmanual-figure6
+pgfmanual-figure7
+pgfmanual-figure8
+pgfmanual-figure9
+pgfmanual-figure10
+pgfmanual-figure11
+pgfmanual-figure12
+pgfmanual-figure13
+pgfmanual-figure14
+pgfmanual-figure15
+pgfmanual-figure16
+pgfmanual-figure17
+pgfmanual-figure18
+pgfmanual-figure19
+pgfmanual-figure20
+pgfmanual-figure21
+pgfmanual-figure22
+pgfmanual-figure23
+pgfmanual-figure24
+pgfmanual-figure25
+pgfmanual-figure26
+pgfmanual-figure27
+pgfmanual-figure28
+pgfmanual-figure29
+pgfmanual-figure30
+pgfmanual-figure31
+pgfmanual-figure32
+pgfmanual-figure33
+pgfmanual-figure34
+pgfmanual-figure35
+pgfmanual-figure36
+pgfmanual-figure37
+pgfmanual-figure38
+pgfmanual-figure39
+pgfmanual-figure40
+pgfmanual-figure41
+pgfmanual-figure42
+pgfmanual-figure43
+pgfmanual-figure44
+pgfmanual-figure45
+pgfmanual-figure46
+pgfmanual-figure47
+pgfmanual-figure48
+pgfmanual-figure49
+pgfmanual-figure50
+pgfmanual-figure51
+pgfmanual-figure52
+pgfmanual-figure53
+pgfmanual-figure54
+pgfmanual-figure55
+pgfmanual-figure56
+pgfmanual-figure57
+pgfmanual-figure58
+pgfmanual-figure59
+pgfmanual-figure60
+pgfmanual-figure61
+pgfmanual-figure62
+pgfmanual-figure63
+pgfmanual-figure64
+pgfmanual-figure65
+pgfmanual-figure66
+pgfmanual-figure67
+pgfmanual-figure68
+pgfmanual-figure69
+pgfmanual-figure70
+pgfmanual-figure71
+pgfmanual-figure72
+pgfmanual-figure73
+pgfmanual-figure74
+pgfmanual-figure75
+pgfmanual-figure76
+pgfmanual-figure77
+pgfmanual-figure78
+pgfmanual-figure79
+pgfmanual-figure80
+pgfmanual-figure81
+pgfmanual-figure82
+pgfmanual-figure83
+pgfmanual-figure84
+pgfmanual-figure85
+pgfmanual-figure86
+pgfmanual-figure87
+pgfmanual-figure88
+pgfmanual-figure89
+pgfmanual-figure90
+pgfmanual-figure91
+pgfmanual-figure92
+pgfmanual-figure93
+pgfmanual-figure94
+pgfmanual-figure95
+pgfmanual-figure96
+pgfmanual-figure97
+pgfmanual-figure98
+pgfmanual-figure99
+pgfmanual-figure100
+pgfmanual-figure101
+pgfmanual-figure102
+pgfmanual-figure103
+pgfmanual-figure104
+pgfmanual-figure105
+pgfmanual-figure106
+pgfmanual-figure107
+pgfmanual-figure108
+pgfmanual-figure109
+pgfmanual-figure110
+pgfmanual-figure111
+pgfmanual-figure112
+pgfmanual-figure113
+pgfmanual-figure114
+pgfmanual-figure115
+pgfmanual-figure116
+pgfmanual-figure117
+pgfmanual-figure118
+pgfmanual-figure119
+pgfmanual-figure120
+pgfmanual-figure121
+pgfmanual-figure122
+pgfmanual-figure123
+pgfmanual-figure124
+pgfmanual-figure125
+pgfmanual-figure126
+pgfmanual-figure127
+pgfmanual-figure128
+pgfmanual-figure129
+pgfmanual-figure130
+pgfmanual-figure131
+pgfmanual-figure132
+pgfmanual-figure133
+pgfmanual-figure134
+pgfmanual-figure135
+pgfmanual-figure136
+pgfmanual-figure137
+pgfmanual-figure138
+pgfmanual-figure139
+pgfmanual-figure140
+pgfmanual-figure141
+pgfmanual-figure142
+pgfmanual-figure143
+pgfmanual-figure144
+pgfmanual-figure145
+pgfmanual-figure146
+pgfmanual-figure147
+pgfmanual-figure148
+pgfmanual-figure149
+pgfmanual-figure150
+pgfmanual-figure151
+pgfmanual-figure152
+pgfmanual-figure153
+pgfmanual-figure154
+pgfmanual-figure155
+pgfmanual-figure156
+pgfmanual-figure157
+pgfmanual-figure158
+pgfmanual-figure159
+pgfmanual-figure160
+pgfmanual-figure161
+pgfmanual-figure162
+pgfmanual-figure163
+pgfmanual-figure164
+pgfmanual-figure165
+pgfmanual-figure166
+pgfmanual-figure167
+pgfmanual-figure168
+pgfmanual-figure169
+pgfmanual-figure170
+pgfmanual-figure171
+pgfmanual-figure172
+pgfmanual-figure173
+pgfmanual-figure174
+pgfmanual-figure175
+pgfmanual-figure176
+pgfmanual-figure177
+pgfmanual-figure178
+pgfmanual-figure179
+pgfmanual-figure180
+pgfmanual-figure181
+pgfmanual-figure182
+pgfmanual-figure183
+pgfmanual-figure184
+pgfmanual-figure185
+pgfmanual-figure186
+pgfmanual-figure187
+pgfmanual-figure188
+pgfmanual-figure189
+pgfmanual-figure190
+pgfmanual-figure191
+pgfmanual-figure192
+pgfmanual-figure193
+pgfmanual-figure194
+pgfmanual-figure195
+pgfmanual-figure196
+pgfmanual-figure197
+pgfmanual-figure198
+pgfmanual-figure199
+pgfmanual-figure200
+pgfmanual-figure201
+pgfmanual-figure202
+pgfmanual-figure203
+pgfmanual-figure204
+pgfmanual-figure205
+pgfmanual-figure206
+pgfmanual-figure207
+pgfmanual-figure208
+pgfmanual-figure209
+pgfmanual-figure210
+pgfmanual-figure211
+pgfmanual-figure212
+pgfmanual-figure213
+pgfmanual-figure214
+pgfmanual-figure215
+pgfmanual-figure216
+pgfmanual-figure217
+pgfmanual-figure218
+pgfmanual-figure219
+pgfmanual-figure220
+pgfmanual-figure221
+pgfmanual-figure222
+pgfmanual-figure223
+pgfmanual-figure224
+pgfmanual-figure225
+pgfmanual-figure226
+pgfmanual-figure227
+pgfmanual-figure228
+pgfmanual-figure229
+pgfmanual-figure230
+pgfmanual-figure231
+pgfmanual-figure232
+pgfmanual-figure233
+pgfmanual-figure234
+pgfmanual-figure235
+pgfmanual-figure236
+pgfmanual-figure237
+pgfmanual-figure238
+pgfmanual-figure239
+pgfmanual-figure240
+pgfmanual-figure241
+pgfmanual-figure242
+pgfmanual-figure243
+pgfmanual-figure244
+pgfmanual-figure245
+pgfmanual-figure246
+pgfmanual-figure247
+pgfmanual-figure248
+pgfmanual-figure249
+pgfmanual-figure250
+pgfmanual-figure251
+pgfmanual-figure252
+pgfmanual-figure253
+pgfmanual-figure254
+pgfmanual-figure255
+pgfmanual-figure256
+pgfmanual-figure257
+pgfmanual-figure258
+pgfmanual-figure259
+pgfmanual-figure260
+pgfmanual-figure261
+pgfmanual-figure262
+pgfmanual-figure263
+pgfmanual-figure264
+pgfmanual-figure265
+pgfmanual-figure266
+pgfmanual-figure267
+pgfmanual-figure268
+pgfmanual-figure269
+pgfmanual-figure270
+pgfmanual-figure271
+pgfmanual-figure272
+pgfmanual-figure273
+pgfmanual-figure274
+pgfmanual-figure275
+pgfmanual-figure276
+pgfmanual-figure277
+pgfmanual-figure278
+pgfmanual-figure279
+pgfmanual-figure280
+pgfmanual-figure281
+pgfmanual-figure282
+pgfmanual-figure283
+pgfmanual-figure284
+pgfmanual-figure285
+pgfmanual-figure286
+pgfmanual-figure287
+pgfmanual-figure288
+pgfmanual-figure289
+pgfmanual-figure290
+pgfmanual-figure291
+pgfmanual-figure292
+pgfmanual-figure293
+pgfmanual-figure294
+pgfmanual-figure295
+pgfmanual-figure296
+pgfmanual-figure297
+pgfmanual-figure298
+pgfmanual-figure299
+pgfmanual-figure300
+pgfmanual-figure301
+pgfmanual-figure302
+pgfmanual-figure303
+pgfmanual-figure304
+pgfmanual-figure305
+pgfmanual-figure306
+pgfmanual-figure307
+pgfmanual-figure308
+pgfmanual-figure309
+pgfmanual-figure310
+pgfmanual-figure311
+pgfmanual-figure312
+pgfmanual-figure313
+pgfmanual-figure314
+pgfmanual-figure315
+pgfmanual-figure316
+pgfmanual-figure317
+pgfmanual-figure318
+pgfmanual-figure319
+pgfmanual-figure320
+pgfmanual-figure321
+pgfmanual-figure322
+pgfmanual-figure323
+pgfmanual-figure324
+pgfmanual-figure325
+pgfmanual-figure326
+pgfmanual-figure327
+pgfmanual-figure328
+pgfmanual-figure329
+pgfmanual-figure330
+pgfmanual-figure331
+pgfmanual-figure332
+pgfmanual-figure333
+pgfmanual-figure334
+pgfmanual-figure335
+pgfmanual-figure336
+pgfmanual-figure337
+pgfmanual-figure338
+pgfmanual-figure339
+pgfmanual-figure340
+pgfmanual-figure341
+pgfmanual-figure342
+pgfmanual-figure343
+pgfmanual-figure344
+pgfmanual-figure345
+pgfmanual-figure346
+pgfmanual-figure347
+pgfmanual-figure348
+pgfmanual-figure349
+pgfmanual-figure350
+pgfmanual-figure351
+pgfmanual-figure352
+pgfmanual-figure353
+pgfmanual-figure354
+pgfmanual-figure355
+pgfmanual-figure356
+pgfmanual-figure357
+pgfmanual-figure358
+pgfmanual-figure359
+pgfmanual-figure360
+pgfmanual-figure361
+pgfmanual-figure362
+pgfmanual-figure363
+pgfmanual-figure364
+pgfmanual-figure365
+pgfmanual-figure366
+pgfmanual-figure367
+pgfmanual-figure368
+pgfmanual-figure369
+pgfmanual-figure370
+pgfmanual-figure371
+pgfmanual-figure372
+pgfmanual-figure373
+pgfmanual-figure374
+pgfmanual-figure375
+pgfmanual-figure376
+pgfmanual-figure377
+pgfmanual-figure378
+pgfmanual-figure379
+pgfmanual-figure380
+pgfmanual-figure381
+pgfmanual-figure382
+pgfmanual-figure383
+pgfmanual-figure384
+pgfmanual-figure385
+pgfmanual-figure386
+pgfmanual-figure387
+pgfmanual-figure388
+pgfmanual-figure389
+pgfmanual-figure390
+pgfmanual-figure391
+pgfmanual-figure392
+pgfmanual-figure393
+pgfmanual-figure394
+pgfmanual-figure395
+pgfmanual-figure396
+pgfmanual-figure397
+pgfmanual-figure398
+pgfmanual-figure399
+pgfmanual-figure400
+pgfmanual-figure401
+pgfmanual-figure402
+pgfmanual-figure403
+pgfmanual-figure404
+pgfmanual-figure405
+pgfmanual-figure406
+pgfmanual-figure407
+pgfmanual-figure408
+pgfmanual-figure409
+pgfmanual-figure410
+pgfmanual-figure411
+pgfmanual-figure412
+pgfmanual-figure413
+pgfmanual-figure414
+pgfmanual-figure415
+pgfmanual-figure416
+pgfmanual-figure417
+pgfmanual-figure418
+pgfmanual-figure419
+pgfmanual-figure420
+pgfmanual-figure421
+pgfmanual-figure422
+pgfmanual-figure423
+pgfmanual-figure424
+pgfmanual-figure425
+pgfmanual-figure426
+pgfmanual-figure427
+pgfmanual-figure428
+pgfmanual-figure429
+pgfmanual-figure430
+pgfmanual-figure431
+pgfmanual-figure432
+pgfmanual-figure433
+pgfmanual-figure434
+pgfmanual-figure435
+pgfmanual-figure436
+pgfmanual-figure437
+pgfmanual-figure438
+pgfmanual-figure439
+pgfmanual-figure440
+pgfmanual-figure441
+pgfmanual-figure442
+pgfmanual-figure443
+pgfmanual-figure444
+pgfmanual-figure445
+pgfmanual-figure446
+pgfmanual-figure447
+pgfmanual-figure448
+pgfmanual-figure449
+pgfmanual-figure450
+pgfmanual-figure451
+pgfmanual-figure452
+pgfmanual-figure453
+pgfmanual-figure454
+pgfmanual-figure455
+pgfmanual-figure456
+pgfmanual-figure457
+pgfmanual-figure458
+pgfmanual-figure459
+pgfmanual-figure460
+pgfmanual-figure461
+pgfmanual-figure462
+pgfmanual-figure463
+pgfmanual-figure464
+pgfmanual-figure465
+pgfmanual-figure466
+pgfmanual-figure467
+pgfmanual-figure468
+pgfmanual-figure469
+pgfmanual-figure470
+pgfmanual-figure471
+pgfmanual-figure472
+pgfmanual-figure473
+pgfmanual-figure474
+pgfmanual-figure475
+pgfmanual-figure476
+pgfmanual-figure477
+pgfmanual-figure478
+pgfmanual-figure479
+pgfmanual-figure480
+pgfmanual-figure481
+pgfmanual-figure482
+pgfmanual-figure483
+pgfmanual-figure484
+pgfmanual-figure485
+pgfmanual-figure486
+pgfmanual-figure487
+pgfmanual-figure488
+pgfmanual-figure489
+pgfmanual-figure490
+pgfmanual-figure491
+pgfmanual-figure492
+pgfmanual-figure493
+pgfmanual-figure494
+pgfmanual-figure495
+pgfmanual-figure496
+pgfmanual-figure497
+pgfmanual-figure498
+pgfmanual-figure499
+pgfmanual-figure500
+pgfmanual-figure501
+pgfmanual-figure502
+pgfmanual-figure503
+pgfmanual-figure504
+pgfmanual-figure505
+pgfmanual-figure506
+pgfmanual-figure507
+pgfmanual-figure508
+pgfmanual-figure509
+pgfmanual-figure510
+pgfmanual-figure511
+pgfmanual-figure512
+pgfmanual-figure513
+pgfmanual-figure514
+pgfmanual-figure515
+pgfmanual-figure516
+pgfmanual-figure517
+pgfmanual-figure518
+pgfmanual-figure519
+pgfmanual-figure520
+pgfmanual-figure521
+pgfmanual-figure522
+pgfmanual-figure523
+pgfmanual-figure524
+pgfmanual-figure525
+pgfmanual-figure526
+pgfmanual-figure527
+pgfmanual-figure528
+pgfmanual-figure529
+pgfmanual-figure530
+pgfmanual-figure531
+pgfmanual-figure532
+pgfmanual-figure533
+pgfmanual-figure534
+pgfmanual-figure535
+pgfmanual-figure536
+pgfmanual-figure537
+pgfmanual-figure538
+pgfmanual-figure539
+pgfmanual-figure540
+pgfmanual-figure541
+pgfmanual-figure542
+pgfmanual-figure543
+pgfmanual-figure544
+pgfmanual-figure545
+pgfmanual-figure546
+pgfmanual-figure547
+pgfmanual-figure548
+pgfmanual-figure549
+pgfmanual-figure550
+pgfmanual-figure551
+pgfmanual-figure552
+pgfmanual-figure553
+pgfmanual-figure554
+pgfmanual-figure555
+pgfmanual-figure556
+pgfmanual-figure557
+pgfmanual-figure558
+pgfmanual-figure559
+pgfmanual-figure560
+pgfmanual-figure561
+pgfmanual-figure562
+pgfmanual-figure563
+pgfmanual-figure564
+pgfmanual-figure565
+pgfmanual-figure566
+pgfmanual-figure567
+pgfmanual-figure568
+pgfmanual-figure569
+pgfmanual-figure570
+pgfmanual-figure571
+pgfmanual-figure572
+pgfmanual-figure573
+pgfmanual-figure574
+pgfmanual-figure575
+pgfmanual-figure576
+pgfmanual-figure577
+pgfmanual-figure578
+pgfmanual-figure579
+pgfmanual-figure580
+pgfmanual-figure581
+pgfmanual-figure582
+pgfmanual-figure583
+pgfmanual-figure584
+pgfmanual-figure585
+pgfmanual-figure586
+pgfmanual-figure587
+pgfmanual-figure588
+pgfmanual-figure589
+pgfmanual-figure590
+pgfmanual-figure591
+pgfmanual-figure592
+pgfmanual-figure593
+pgfmanual-figure594
+pgfmanual-figure595
+pgfmanual-figure596
+pgfmanual-figure597
+pgfmanual-figure598
+pgfmanual-figure599
+pgfmanual-figure600
+pgfmanual-figure601
+pgfmanual-figure602
+pgfmanual-figure603
+pgfmanual-figure604
+pgfmanual-figure605
+pgfmanual-figure606
+pgfmanual-figure607
+pgfmanual-figure608
+pgfmanual-figure609
+pgfmanual-figure610
+pgfmanual-figure611
+pgfmanual-figure612
+pgfmanual-figure613
+pgfmanual-figure614
+pgfmanual-figure615
+pgfmanual-figure616
+pgfmanual-figure617
+pgfmanual-figure618
+pgfmanual-figure619
+pgfmanual-figure620
+pgfmanual-figure621
+pgfmanual-figure622
+pgfmanual-figure623
+pgfmanual-figure624
+pgfmanual-figure625
+pgfmanual-figure626
+pgfmanual-figure627
+pgfmanual-figure628
+pgfmanual-figure629
+pgfmanual-figure630
+pgfmanual-figure631
+pgfmanual-figure632
+pgfmanual-figure633
+pgfmanual-figure634
+pgfmanual-figure635
+pgfmanual-figure636
+pgfmanual-figure637
+pgfmanual-figure638
+pgfmanual-figure639
+pgfmanual-figure640
+pgfmanual-figure641
+pgfmanual-figure642
+pgfmanual-figure643
+pgfmanual-figure644
+pgfmanual-figure645
+pgfmanual-figure646
+pgfmanual-figure647
+pgfmanual-figure648
+pgfmanual-figure649
+pgfmanual-figure650
+pgfmanual-figure651
+pgfmanual-figure652
+pgfmanual-figure653
+pgfmanual-figure654
+pgfmanual-figure655
+pgfmanual-figure656
+pgfmanual-figure657
+pgfmanual-figure658
+pgfmanual-figure659
+pgfmanual-figure660
+pgfmanual-figure661
+pgfmanual-figure662
+pgfmanual-figure663
+pgfmanual-figure664
+pgfmanual-figure665
+pgfmanual-figure666
+pgfmanual-figure667
+pgfmanual-figure668
+pgfmanual-figure669
+pgfmanual-figure670
+pgfmanual-figure671
+pgfmanual-figure672
+pgfmanual-figure673
+pgfmanual-figure674
+pgfmanual-figure675
+pgfmanual-figure676
+pgfmanual-figure677
+pgfmanual-figure678
+pgfmanual-figure679
+pgfmanual-figure680
+pgfmanual-figure681
+pgfmanual-figure682
+pgfmanual-figure683
+pgfmanual-figure684
+pgfmanual-figure685
+pgfmanual-figure686
+pgfmanual-figure687
+pgfmanual-figure688
+pgfmanual-figure689
+pgfmanual-figure690
+pgfmanual-figure691
+pgfmanual-figure692
+pgfmanual-figure693
+pgfmanual-figure694
+pgfmanual-figure695
+pgfmanual-figure696
+pgfmanual-figure697
+pgfmanual-figure698
+pgfmanual-figure699
+pgfmanual-figure700
+pgfmanual-figure701
+pgfmanual-figure702
+pgfmanual-figure703
+pgfmanual-figure704
+pgfmanual-figure705
+pgfmanual-figure706
+pgfmanual-figure707
+pgfmanual-figure708
+pgfmanual-figure709
+pgfmanual-figure710
+pgfmanual-figure711
+pgfmanual-figure712
+pgfmanual-figure713
+pgfmanual-figure714
+pgfmanual-figure715
+pgfmanual-figure716
+pgfmanual-figure717
+pgfmanual-figure718
+pgfmanual-figure719
+pgfmanual-figure720
+pgfmanual-figure721
+pgfmanual-figure722
+pgfmanual-figure723
+pgfmanual-figure724
+pgfmanual-figure725
+pgfmanual-figure726
+pgfmanual-figure727
+pgfmanual-figure728
+pgfmanual-figure729
+pgfmanual-figure730
+pgfmanual-figure731
+pgfmanual-figure732
+pgfmanual-figure733
+pgfmanual-figure734
+pgfmanual-figure735
+pgfmanual-figure736
+pgfmanual-figure737
+pgfmanual-figure738
+pgfmanual-figure739
+pgfmanual-figure740
+pgfmanual-figure741
+pgfmanual-figure742
+pgfmanual-figure743
+pgfmanual-figure744
+pgfmanual-figure745
+pgfmanual-figure746
+pgfmanual-figure747
+pgfmanual-figure748
+pgfmanual-figure749
+pgfmanual-figure750
+pgfmanual-figure751
+pgfmanual-figure752
+pgfmanual-figure753
+pgfmanual-figure754
+pgfmanual-figure755
+pgfmanual-figure756
+pgfmanual-figure757
+pgfmanual-figure758
+pgfmanual-figure759
+pgfmanual-figure760
+pgfmanual-figure761
+pgfmanual-figure762
+pgfmanual-figure763
+pgfmanual-figure764
+pgfmanual-figure765
+pgfmanual-figure766
+pgfmanual-figure767
+pgfmanual-figure768
+pgfmanual-figure769
+pgfmanual-figure770
+pgfmanual-figure771
+pgfmanual-figure772
+pgfmanual-figure773
+pgfmanual-figure774
+pgfmanual-figure775
+pgfmanual-figure776
+pgfmanual-figure777
+pgfmanual-figure778
+pgfmanual-figure779
+pgfmanual-figure780
+pgfmanual-figure781
+pgfmanual-figure782
+pgfmanual-figure783
+pgfmanual-figure784
+pgfmanual-figure785
+pgfmanual-figure786
+pgfmanual-figure787
+pgfmanual-figure788
+pgfmanual-figure789
+pgfmanual-figure790
+pgfmanual-figure791
+pgfmanual-figure792
+pgfmanual-figure793
+pgfmanual-figure794
+pgfmanual-figure795
+pgfmanual-figure796
+pgfmanual-figure797
+pgfmanual-figure798
+pgfmanual-figure799
+pgfmanual-figure800
+pgfmanual-figure801
+pgfmanual-figure802
+pgfmanual-figure803
+pgfmanual-figure804
+pgfmanual-figure805
+pgfmanual-figure806
+pgfmanual-figure807
+pgfmanual-figure808
+pgfmanual-figure809
+pgfmanual-figure810
+pgfmanual-figure811
+pgfmanual-figure812
+pgfmanual-figure813
+pgfmanual-figure814
+pgfmanual-figure815
+pgfmanual-figure816
+pgfmanual-figure817
+pgfmanual-figure818
+pgfmanual-figure819
+pgfmanual-figure820
+pgfmanual-figure821
+pgfmanual-figure822
+pgfmanual-figure823
+pgfmanual-figure824
+pgfmanual-figure825
+pgfmanual-figure826
+pgfmanual-figure827
+pgfmanual-figure828
+pgfmanual-figure829
+pgfmanual-figure830
+pgfmanual-figure831
+pgfmanual-figure832
+pgfmanual-figure833
+pgfmanual-figure834
+pgfmanual-figure835
+pgfmanual-figure836
+pgfmanual-figure837
+pgfmanual-figure838
+pgfmanual-figure839
+pgfmanual-figure840
+pgfmanual-figure841
+pgfmanual-figure842
+pgfmanual-figure843
+pgfmanual-figure844
+pgfmanual-figure845
+pgfmanual-figure846
+pgfmanual-figure847
+pgfmanual-figure848
+pgfmanual-figure849
+pgfmanual-figure850
+pgfmanual-figure851
+pgfmanual-figure852
+pgfmanual-figure853
+pgfmanual-figure854
+pgfmanual-figure855
+pgfmanual-figure856
+pgfmanual-figure857
+pgfmanual-figure858
+pgfmanual-figure859
+pgfmanual-figure860
+pgfmanual-figure861
+pgfmanual-figure862
+pgfmanual-figure863
+pgfmanual-figure864
+pgfmanual-figure865
+pgfmanual-figure866
+pgfmanual-figure867
+pgfmanual-figure868
+pgfmanual-figure869
+pgfmanual-figure870
+pgfmanual-figure871
+pgfmanual-figure872
+pgfmanual-figure873
+pgfmanual-figure874
+pgfmanual-figure875
+pgfmanual-figure876
+pgfmanual-figure877
+pgfmanual-figure878
+pgfmanual-figure879
+pgfmanual-figure880
+pgfmanual-figure881
+pgfmanual-figure882
+pgfmanual-figure883
+pgfmanual-figure884
+pgfmanual-figure885
+pgfmanual-figure886
+pgfmanual-figure887
+pgfmanual-figure888
+pgfmanual-figure889
+pgfmanual-figure890
+pgfmanual-figure891
+pgfmanual-figure892
+pgfmanual-figure893
+pgfmanual-figure894
+pgfmanual-figure895
+pgfmanual-figure896
+pgfmanual-figure897
+pgfmanual-figure898
+pgfmanual-figure899
+pgfmanual-figure900
+pgfmanual-figure901
+pgfmanual-figure902
+pgfmanual-figure903
+pgfmanual-figure904
+pgfmanual-figure905
+pgfmanual-figure906
+pgfmanual-figure907
+pgfmanual-figure908
+pgfmanual-figure909
+pgfmanual-figure910
+pgfmanual-figure911
+pgfmanual-figure912
+pgfmanual-figure913
+pgfmanual-figure914
+pgfmanual-figure915
+pgfmanual-figure916
+pgfmanual-figure917
+pgfmanual-figure918
+pgfmanual-figure919
+pgfmanual-figure920
+pgfmanual-figure921
+pgfmanual-figure922
+pgfmanual-figure923
+pgfmanual-figure924
+pgfmanual-figure925
+pgfmanual-figure926
+pgfmanual-figure927
+pgfmanual-figure928
+pgfmanual-figure929
+pgfmanual-figure930
+pgfmanual-figure931
+pgfmanual-figure932
+pgfmanual-figure933
+pgfmanual-figure934
+pgfmanual-figure935
+pgfmanual-figure936
+pgfmanual-figure937
+pgfmanual-figure938
+pgfmanual-figure939
+pgfmanual-figure940
+pgfmanual-figure941
+pgfmanual-figure942
+pgfmanual-figure943
+pgfmanual-figure944
+pgfmanual-figure945
+pgfmanual-figure946
+pgfmanual-figure947
+pgfmanual-figure948
+pgfmanual-figure949
+pgfmanual-figure950
+pgfmanual-figure951
+pgfmanual-figure952
+pgfmanual-figure953
+pgfmanual-figure954
+pgfmanual-figure955
+pgfmanual-figure956
+pgfmanual-figure957
+pgfmanual-figure958
+pgfmanual-figure959
+pgfmanual-figure960
+pgfmanual-figure961
+pgfmanual-figure962
+pgfmanual-figure963
+pgfmanual-figure964
+pgfmanual-figure965
+pgfmanual-figure966
+pgfmanual-figure967
+pgfmanual-figure968
+pgfmanual-figure969
+pgfmanual-figure970
+pgfmanual-figure971
+pgfmanual-figure972
+pgfmanual-figure973
+pgfmanual-figure974
+pgfmanual-figure975
+pgfmanual-figure976
+pgfmanual-figure977
+pgfmanual-figure978
+pgfmanual-figure979
+pgfmanual-figure980
+pgfmanual-figure981
+pgfmanual-figure982
+pgfmanual-figure983
+pgfmanual-figure984
+pgfmanual-figure985
+pgfmanual-figure986
+pgfmanual-figure987
+pgfmanual-figure988
+pgfmanual-figure989
+pgfmanual-figure990
+pgfmanual-figure991
+pgfmanual-figure992
+pgfmanual-figure993
+pgfmanual-figure994
+pgfmanual-figure995
+pgfmanual-figure996
+pgfmanual-figure997
+pgfmanual-figure998
+pgfmanual-figure999
+pgfmanual-figure1000
+pgfmanual-figure1001
+pgfmanual-figure1002
+pgfmanual-figure1003
+pgfmanual-figure1004
+pgfmanual-figure1005
+pgfmanual-figure1006
+pgfmanual-figure1007
+pgfmanual-figure1008
+pgfmanual-figure1009
+pgfmanual-figure1010
+pgfmanual-figure1011
+pgfmanual-figure1012
+pgfmanual-figure1013
+pgfmanual-figure1014
+pgfmanual-figure1015
+pgfmanual-figure1016
+pgfmanual-figure1017
+pgfmanual-figure1018
+pgfmanual-figure1019
+pgfmanual-figure1020
+pgfmanual-figure1021
+pgfmanual-figure1022
+pgfmanual-figure1023
+pgfmanual-figure1024
+pgfmanual-figure1025
+pgfmanual-figure1026
+pgfmanual-figure1027
+pgfmanual-figure1028
+pgfmanual-figure1029
+pgfmanual-figure1030
+pgfmanual-figure1031
+pgfmanual-figure1032
+pgfmanual-figure1033
+pgfmanual-figure1034
+pgfmanual-figure1035
+pgfmanual-figure1036
+pgfmanual-figure1037
+pgfmanual-figure1038
+pgfmanual-figure1039
+pgfmanual-figure1040
+pgfmanual-figure1041
+pgfmanual-figure1042
+pgfmanual-figure1043
+pgfmanual-figure1044
+pgfmanual-figure1045
+pgfmanual-figure1046
+pgfmanual-figure1047
+pgfmanual-figure1048
+pgfmanual-figure1049
+pgfmanual-figure1050
+pgfmanual-figure1051
+pgfmanual-figure1052
+pgfmanual-figure1053
+pgfmanual-figure1054
+pgfmanual-figure1055
+pgfmanual-figure1056
+pgfmanual-figure1057
+pgfmanual-figure1058
+pgfmanual-figure1059
+pgfmanual-figure1060
+pgfmanual-figure1061
+pgfmanual-figure1062
+pgfmanual-figure1063
+pgfmanual-figure1064
+pgfmanual-figure1065
+pgfmanual-figure1066
+pgfmanual-figure1067
+pgfmanual-figure1068
+pgfmanual-figure1069
+pgfmanual-figure1070
+pgfmanual-figure1071
+pgfmanual-figure1072
+pgfmanual-figure1073
+pgfmanual-figure1074
+pgfmanual-figure1075
+pgfmanual-figure1076
+pgfmanual-figure1077
+pgfmanual-figure1078
+pgfmanual-figure1079
+pgfmanual-figure1080
+pgfmanual-figure1081
+pgfmanual-figure1082
+pgfmanual-figure1083
+pgfmanual-figure1084
+pgfmanual-figure1085
+pgfmanual-figure1086
+pgfmanual-figure1087
+pgfmanual-figure1088
+pgfmanual-figure1089
+pgfmanual-figure1090
+pgfmanual-figure1091
+pgfmanual-figure1092
+pgfmanual-figure1093
+pgfmanual-figure1094
+pgfmanual-figure1095
+pgfmanual-figure1096
+pgfmanual-figure1097
+pgfmanual-figure1098
+pgfmanual-figure1099
+pgfmanual-figure1100
+pgfmanual-figure1101
+pgfmanual-figure1102
+pgfmanual-figure1103
+pgfmanual-figure1104
+pgfmanual-figure1105
+pgfmanual-figure1106
+pgfmanual-figure1107
+pgfmanual-figure1108
+pgfmanual-figure1109
+pgfmanual-figure1110
+pgfmanual-figure1111
+pgfmanual-figure1112
+pgfmanual-figure1113
+pgfmanual-figure1114
+pgfmanual-figure1115
+pgfmanual-figure1116
+pgfmanual-figure1117
+pgfmanual-figure1118
+pgfmanual-figure1119
+pgfmanual-figure1120
+pgfmanual-figure1121
+pgfmanual-figure1122
+pgfmanual-figure1123
+pgfmanual-figure1124
+pgfmanual-figure1125
+pgfmanual-figure1126
+pgfmanual-figure1127
+pgfmanual-figure1128
+pgfmanual-figure1129
+pgfmanual-figure1130
+pgfmanual-figure1131
+pgfmanual-figure1132
+pgfmanual-figure1133
+pgfmanual-figure1134
+pgfmanual-figure1135
+pgfmanual-figure1136
+pgfmanual-figure1137
+pgfmanual-figure1138
+pgfmanual-figure1139
+pgfmanual-figure1140
+pgfmanual-figure1141
+pgfmanual-figure1142
+pgfmanual-figure1143
+pgfmanual-figure1144
+pgfmanual-figure1145
+pgfmanual-figure1146
+pgfmanual-figure1147
+pgfmanual-figure1148
+pgfmanual-figure1149
+pgfmanual-figure1150
+pgfmanual-figure1151
+pgfmanual-figure1152
+pgfmanual-figure1153
+pgfmanual-figure1154
+pgfmanual-figure1155
+pgfmanual-figure1156
+pgfmanual-figure1157
+pgfmanual-figure1158
+pgfmanual-figure1159
+pgfmanual-figure1160
+pgfmanual-figure1161
+pgfmanual-figure1162
+pgfmanual-figure1163
+pgfmanual-figure1164
+pgfmanual-figure1165
+pgfmanual-figure1166
+pgfmanual-figure1167
+pgfmanual-figure1168
+pgfmanual-figure1169
+pgfmanual-figure1170
+pgfmanual-figure1171
+pgfmanual-figure1172
+pgfmanual-figure1173
+pgfmanual-figure1174
+pgfmanual-figure1175
+pgfmanual-figure1176
+pgfmanual-figure1177
+pgfmanual-figure1178
+pgfmanual-figure1179
+pgfmanual-figure1180
+pgfmanual-figure1181
+pgfmanual-figure1182
+pgfmanual-figure1183
+pgfmanual-figure1184
+pgfmanual-figure1185
+pgfmanual-figure1186
+pgfmanual-figure1187
+pgfmanual-figure1188
+pgfmanual-figure1189
+pgfmanual-figure1190
+pgfmanual-figure1191
+pgfmanual-figure1192
+pgfmanual-figure1193
+pgfmanual-figure1194
+pgfmanual-figure1195
+pgfmanual-figure1196
+pgfmanual-figure1197
+pgfmanual-figure1198
+pgfmanual-figure1199
+pgfmanual-figure1200
+pgfmanual-figure1201
+pgfmanual-figure1202
+pgfmanual-figure1203
+pgfmanual-figure1204
+pgfmanual-figure1205
+pgfmanual-figure1206
+pgfmanual-figure1207
+pgfmanual-figure1208
+pgfmanual-figure1209
+pgfmanual-figure1210
+pgfmanual-figure1211
+pgfmanual-figure1212
+pgfmanual-figure1213
+pgfmanual-figure1214
+pgfmanual-figure1215
+pgfmanual-figure1216
+pgfmanual-figure1217
+pgfmanual-figure1218
+pgfmanual-figure1219
+pgfmanual-figure1220
+pgfmanual-figure1221
+pgfmanual-figure1222
+pgfmanual-figure1223
+pgfmanual-figure1224
+pgfmanual-figure1225
+pgfmanual-figure1226
+pgfmanual-figure1227
+pgfmanual-figure1228
+pgfmanual-figure1229
+pgfmanual-figure1230
+pgfmanual-figure1231
+pgfmanual-figure1232
+pgfmanual-figure1233
+pgfmanual-figure1234
+pgfmanual-figure1235
+pgfmanual-figure1236
+pgfmanual-figure1237
+pgfmanual-figure1238
+pgfmanual-figure1239
+pgfmanual-figure1240
+pgfmanual-figure1241
+pgfmanual-figure1242
+pgfmanual-figure1243
+pgfmanual-figure1244
+pgfmanual-figure1245
+pgfmanual-figure1246
+pgfmanual-figure1247
+pgfmanual-figure1248
+pgfmanual-figure1249
+pgfmanual-figure1250
+pgfmanual-figure1251
+pgfmanual-figure1252
+pgfmanual-figure1253
+pgfmanual-figure1254
+pgfmanual-figure1255
+pgfmanual-figure1256
+pgfmanual-figure1257
+pgfmanual-figure1258
+pgfmanual-figure1259
+pgfmanual-figure1260
+pgfmanual-figure1261
+pgfmanual-figure1262
+pgfmanual-figure1263
+pgfmanual-figure1264
+pgfmanual-figure1265
+pgfmanual-figure1266
+pgfmanual-figure1267
+pgfmanual-figure1268
+pgfmanual-figure1269
+pgfmanual-figure1270
+pgfmanual-figure1271
+pgfmanual-figure1272
+pgfmanual-figure1273
+pgfmanual-figure1274
+pgfmanual-figure1275
+pgfmanual-figure1276
+pgfmanual-figure1277
+pgfmanual-figure1278
+pgfmanual-figure1279
+pgfmanual-figure1280
+pgfmanual-figure1281
+pgfmanual-figure1282
+pgfmanual-figure1283
+pgfmanual-figure1284
+pgfmanual-figure1285
+pgfmanual-figure1286
+pgfmanual-figure1287
+pgfmanual-figure1288
+pgfmanual-figure1289
+pgfmanual-figure1290
+pgfmanual-figure1291
+pgfmanual-figure1292
+pgfmanual-figure1293
+pgfmanual-figure1294
+pgfmanual-figure1295
+pgfmanual-figure1296
+pgfmanual-figure1297
+pgfmanual-figure1298
+pgfmanual-figure1299
+pgfmanual-figure1300
+pgfmanual-figure1301
+pgfmanual-figure1302
+pgfmanual-figure1303
+pgfmanual-figure1304
+pgfmanual-figure1305
+pgfmanual-figure1306
+pgfmanual-figure1307
+pgfmanual-figure1308
+pgfmanual-figure1309
+pgfmanual-figure1310
+pgfmanual-figure1311
+pgfmanual-figure1312
+pgfmanual-figure1313
+pgfmanual-figure1314
+pgfmanual-figure1315
+pgfmanual-figure1316
+pgfmanual-figure1317
+pgfmanual-figure1318
+pgfmanual-figure1319
+pgfmanual-figure1320
+pgfmanual-figure1321
+pgfmanual-figure1322
+pgfmanual-figure1323
+pgfmanual-figure1324
+pgfmanual-figure1325
+pgfmanual-figure1326
+pgfmanual-figure1327
+pgfmanual-figure1328
+pgfmanual-figure1329
+pgfmanual-figure1330
+pgfmanual-figure1331
+pgfmanual-figure1332
+pgfmanual-figure1333
+pgfmanual-figure1334
+pgfmanual-figure1335
+pgfmanual-figure1336
+pgfmanual-figure1337
+pgfmanual-figure1338
+pgfmanual-figure1339
+pgfmanual-figure1340
+pgfmanual-figure1341
+pgfmanual-figure1342
+pgfmanual-figure1343
+pgfmanual-figure1344
+pgfmanual-figure1345
+pgfmanual-figure1346
+pgfmanual-figure1347
+pgfmanual-figure1348
+pgfmanual-figure1349
+pgfmanual-figure1350
+pgfmanual-figure1351
+pgfmanual-figure1352
+pgfmanual-figure1353
+pgfmanual-figure1354
+pgfmanual-figure1355
+pgfmanual-figure1356
+pgfmanual-figure1357
+pgfmanual-figure1358
+pgfmanual-figure1359
+pgfmanual-figure1360
+pgfmanual-figure1361
+pgfmanual-figure1362
+pgfmanual-figure1363
+pgfmanual-figure1364
+pgfmanual-figure1365
+pgfmanual-figure1366
+pgfmanual-figure1367
+pgfmanual-figure1368
+pgfmanual-figure1369
+pgfmanual-figure1370
+pgfmanual-figure1371
+pgfmanual-figure1372
+pgfmanual-figure1373
+pgfmanual-figure1374
+pgfmanual-figure1375
+pgfmanual-figure1376
+pgfmanual-figure1377
+pgfmanual-figure1378
+pgfmanual-figure1379
+pgfmanual-figure1380
+pgfmanual-figure1381
+pgfmanual-figure1382
+pgfmanual-figure1383
+pgfmanual-figure1384
+pgfmanual-figure1385
+pgfmanual-figure1386
+pgfmanual-figure1387
+pgfmanual-figure1388
+pgfmanual-figure1389
+pgfmanual-figure1390
+pgfmanual-figure1391
+pgfmanual-figure1392
+pgfmanual-figure1393
+pgfmanual-figure1394
+pgfmanual-figure1395
+pgfmanual-figure1396
+pgfmanual-figure1397
+pgfmanual-figure1398
+pgfmanual-figure1399
+pgfmanual-figure1400
+pgfmanual-figure1401
+pgfmanual-figure1402
+pgfmanual-figure1403
+pgfmanual-figure1404
+pgfmanual-figure1405
+pgfmanual-figure1406
+pgfmanual-figure1407
+pgfmanual-figure1408
+pgfmanual-figure1409
+pgfmanual-figure1410
+pgfmanual-figure1411
+pgfmanual-figure1412
+pgfmanual-figure1413
+pgfmanual-figure1414
+pgfmanual-figure1415
+pgfmanual-figure1416
+pgfmanual-figure1417
+pgfmanual-figure1418
+pgfmanual-figure1419
+pgfmanual-figure1420
+pgfmanual-figure1421
+pgfmanual-figure1422
+pgfmanual-figure1423
+pgfmanual-figure1424
+pgfmanual-figure1425
+pgfmanual-figure1426
+pgfmanual-figure1427
+pgfmanual-figure1428
+pgfmanual-figure1429
+pgfmanual-figure1430
+pgfmanual-figure1431
+pgfmanual-figure1432
+pgfmanual-figure1433
+pgfmanual-figure1434
+pgfmanual-figure1435
+pgfmanual-figure1436
+pgfmanual-figure1437
+pgfmanual-figure1438
+pgfmanual-figure1439
+pgfmanual-figure1440
+pgfmanual-figure1441
+pgfmanual-figure1442
+pgfmanual-figure1443
+pgfmanual-figure1444
+pgfmanual-figure1445
+pgfmanual-figure1446
+pgfmanual-figure1447
+pgfmanual-figure1448
+pgfmanual-figure1449
+pgfmanual-figure1450
+pgfmanual-figure1451
+pgfmanual-figure1452
+pgfmanual-figure1453
+pgfmanual-figure1454
+pgfmanual-figure1455
+pgfmanual-figure1456
+pgfmanual-figure1457
+pgfmanual-figure1458
+pgfmanual-figure1459
+pgfmanual-figure1460
+pgfmanual-figure1461
+pgfmanual-figure1462
+pgfmanual-figure1463
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile
index 571fd095be8..aebb669ae2e 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile
@@ -13,5 +13,27 @@ pgfmanual.html: $(doc).tex $(doc).ind
TEXINPUTS="$(TEXINPUTS)" htlatex $(doc).tex
clean:
- rm -f pgfmanual*.aux pgfmanual{.out,.log,.idx,.ind,.ilg,.pdf,.toc,.bbl,.blg,.ps,*.gif,*.html,*.svg,.xref,.css,.4ct,.4tc,.dvi,.lg,.idv} *.png
-
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.*gif \
+ pgfmanual.*html \
+ pgfmanual.*svg \
+ pgfmanual.xref \
+ pgfmanual.css \
+ pgfmanual.4ct \
+ pgfmanual.4tc \
+ pgfmanual.dvi \
+ pgfmanual.lg \
+ pgfmanual.idv \
+ pgfmanual*.aux \
+ *.png
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile
index 780ecee91b2..ca3fce8d28f 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile
@@ -16,5 +16,17 @@ pgfmanual.ps: $(doc).tex $(doc).ind
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
clean:
- rm -f pgfmanual*.aux pgfmanual.{out,log,idx,ind,ilg,pdf,toc,bbl,blg,ps}
-
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot
deleted file mode 100644
index 4c854afda9f..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgf-asymptotic-example.table"; set format "%.5f"
-set samples 200; set parametric; plot [t=0.4:1.5] (t*t*t)*sin(1/(t*t*t)),(t*t*t)*cos(1/(t*t*t))
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table
deleted file mode 100644
index 173ab5e9c77..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-asymptotic-example.table
+++ /dev/null
@@ -1,204 +0,0 @@
-#Curve 0, 200 points
-#x y type
-0.00530 -0.06378 i
-0.04363 -0.05043 i
-0.06711 -0.01790 i
-0.06896 0.02170 i
-0.05014 0.05606 i
-0.01712 0.07631 i
--0.02110 0.07849 i
--0.05579 0.06337 i
--0.08032 0.03512 i
--0.09097 -0.00029 i
--0.08696 -0.03664 i
--0.06987 -0.06850 i
--0.04284 -0.09192 i
--0.00982 -0.10460 i
-0.02515 -0.10585 i
-0.05841 -0.09629 i
-0.08703 -0.07749 i
-0.10892 -0.05162 i
-0.12282 -0.02111 i
-0.12828 0.01163 i
-0.12547 0.04436 i
-0.11507 0.07518 i
-0.09810 0.10255 i
-0.07579 0.12534 i
-0.04948 0.14280 i
-0.02048 0.15454 i
--0.00995 0.16043 i
--0.04065 0.16063 i
--0.07063 0.15545 i
--0.09905 0.14536 i
--0.12521 0.13092 i
--0.14860 0.11273 i
--0.16882 0.09143 i
--0.18562 0.06764 i
--0.19885 0.04197 i
--0.20848 0.01500 i
--0.21454 -0.01276 i
--0.21712 -0.04083 i
--0.21637 -0.06879 i
--0.21247 -0.09627 i
--0.20565 -0.12295 i
--0.19613 -0.14858 i
--0.18415 -0.17294 i
--0.16996 -0.19585 i
--0.15379 -0.21718 i
--0.13589 -0.23682 i
--0.11647 -0.25471 i
--0.09576 -0.27080 i
--0.07396 -0.28508 i
--0.05126 -0.29753 i
--0.02783 -0.30819 i
--0.00384 -0.31707 i
-0.02057 -0.32421 i
-0.04526 -0.32967 i
-0.07011 -0.33350 i
-0.09502 -0.33576 i
-0.11989 -0.33651 i
-0.14463 -0.33582 i
-0.16917 -0.33376 i
-0.19345 -0.33040 i
-0.21741 -0.32580 i
-0.24100 -0.32003 i
-0.26418 -0.31315 i
-0.28691 -0.30524 i
-0.30918 -0.29634 i
-0.33096 -0.28653 i
-0.35222 -0.27585 i
-0.37297 -0.26437 i
-0.39318 -0.25213 i
-0.41285 -0.23918 i
-0.43197 -0.22557 i
-0.45056 -0.21134 i
-0.46860 -0.19654 i
-0.48611 -0.18119 i
-0.50309 -0.16535 i
-0.51954 -0.14904 i
-0.53547 -0.13229 i
-0.55090 -0.11514 i
-0.56582 -0.09761 i
-0.58026 -0.07972 i
-0.59422 -0.06150 i
-0.60772 -0.04298 i
-0.62076 -0.02416 i
-0.63336 -0.00508 i
-0.64554 0.01425 i
-0.65729 0.03382 i
-0.66864 0.05361 i
-0.67960 0.07361 i
-0.69018 0.09381 i
-0.70039 0.11420 i
-0.71024 0.13475 i
-0.71975 0.15548 i
-0.72892 0.17636 i
-0.73778 0.19739 i
-0.74632 0.21857 i
-0.75456 0.23989 i
-0.76251 0.26134 i
-0.77018 0.28291 i
-0.77759 0.30461 i
-0.78473 0.32643 i
-0.79162 0.34837 i
-0.79826 0.37042 i
-0.80468 0.39258 i
-0.81087 0.41485 i
-0.81684 0.43723 i
-0.82261 0.45972 i
-0.82817 0.48232 i
-0.83354 0.50502 i
-0.83872 0.52782 i
-0.84372 0.55073 i
-0.84855 0.57374 i
-0.85321 0.59686 i
-0.85772 0.62009 i
-0.86206 0.64342 i
-0.86626 0.66685 i
-0.87032 0.69040 i
-0.87423 0.71405 i
-0.87801 0.73781 i
-0.88167 0.76169 i
-0.88520 0.78567 i
-0.88861 0.80977 i
-0.89191 0.83398 i
-0.89510 0.85831 i
-0.89818 0.88276 i
-0.90115 0.90733 i
-0.90403 0.93202 i
-0.90682 0.95683 i
-0.90951 0.98177 i
-0.91211 1.00683 i
-0.91463 1.03202 i
-0.91707 1.05735 i
-0.91942 1.08280 i
-0.92171 1.10839 i
-0.92391 1.13411 i
-0.92605 1.15998 i
-0.92812 1.18598 i
-0.93012 1.21213 i
-0.93205 1.23842 i
-0.93393 1.26485 i
-0.93575 1.29143 i
-0.93751 1.31817 i
-0.93921 1.34505 i
-0.94086 1.37209 i
-0.94246 1.39929 i
-0.94401 1.42664 i
-0.94552 1.45415 i
-0.94697 1.48183 i
-0.94838 1.50967 i
-0.94975 1.53767 i
-0.95108 1.56584 i
-0.95236 1.59418 i
-0.95361 1.62270 i
-0.95482 1.65138 i
-0.95600 1.68025 i
-0.95713 1.70928 i
-0.95824 1.73850 i
-0.95931 1.76790 i
-0.96035 1.79748 i
-0.96136 1.82725 i
-0.96234 1.85720 i
-0.96329 1.88735 i
-0.96422 1.91768 i
-0.96511 1.94820 i
-0.96598 1.97892 i
-0.96683 2.00983 i
-0.96765 2.04094 i
-0.96845 2.07225 i
-0.96922 2.10376 i
-0.96998 2.13547 i
-0.97071 2.16739 i
-0.97142 2.19952 i
-0.97211 2.23185 i
-0.97278 2.26439 i
-0.97344 2.29714 i
-0.97407 2.33010 i
-0.97469 2.36328 i
-0.97529 2.39667 i
-0.97588 2.43028 i
-0.97644 2.46411 i
-0.97700 2.49817 i
-0.97754 2.53244 i
-0.97806 2.56694 i
-0.97857 2.60166 i
-0.97906 2.63661 i
-0.97955 2.67179 i
-0.98001 2.70720 i
-0.98047 2.74284 i
-0.98092 2.77871 i
-0.98135 2.81482 i
-0.98177 2.85117 i
-0.98218 2.88775 i
-0.98258 2.92457 i
-0.98297 2.96163 i
-0.98335 2.99894 i
-0.98372 3.03649 i
-0.98408 3.07428 i
-0.98443 3.11232 i
-0.98477 3.15061 i
-0.98511 3.18914 i
-0.98543 3.22793 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot
deleted file mode 100644
index 1d34e313af8..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgf-exp.table"; set format "%.5f"
-set samples 25; plot [x=0:4] 0.05*exp(x)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table
deleted file mode 100644
index 8e728570397..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-exp.table
+++ /dev/null
@@ -1,29 +0,0 @@
-#Curve 0, 25 points
-#x y type
-0.00000 0.05000 i
-0.16667 0.05907 i
-0.33333 0.06978 i
-0.50000 0.08244 i
-0.66667 0.09739 i
-0.83333 0.11505 i
-1.00000 0.13591 i
-1.16667 0.16056 i
-1.33333 0.18968 i
-1.50000 0.22408 i
-1.66667 0.26472 i
-1.83333 0.31274 i
-2.00000 0.36945 i
-2.16667 0.43646 i
-2.33333 0.51561 i
-2.50000 0.60912 i
-2.66667 0.71960 i
-2.83333 0.85010 i
-3.00000 1.00428 i
-3.16667 1.18641 i
-3.33333 1.40158 i
-3.50000 1.65577 i
-3.66667 1.95606 i
-3.83333 2.31082 i
-4.00000 2.72991 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot
deleted file mode 100644
index e1c3f3b52f2..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgf-parametric-example.table"; set format "%.5f"
-set samples 25; set parametric; plot [t=-3.141:3.141] t*sin(t),t*cos(t)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table
deleted file mode 100644
index de0c383ddde..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-parametric-example.table
+++ /dev/null
@@ -1,29 +0,0 @@
-#Curve 0, 25 points
-#x y type
-0.00186 3.14100 i
-0.74672 2.78074 i
-1.30987 2.26617 i
-1.66651 1.66503 i
-1.81387 1.04628 i
-1.76998 0.47361 i
-1.57050 -0.00047 i
-1.26407 -0.33904 i
-0.90663 -0.52368 i
-0.55517 -0.55534 i
-0.26171 -0.45339 i
-0.06773 -0.25283 i
-0.00000 -0.00000 i
-0.06773 0.25283 i
-0.26171 0.45339 i
-0.55517 0.55534 i
-0.90663 0.52368 i
-1.26407 0.33904 i
-1.57050 0.00047 i
-1.76998 -0.47361 i
-1.81387 -1.04628 i
-1.66651 -1.66503 i
-1.30987 -2.26617 i
-0.74672 -2.78074 i
-0.00186 -3.14100 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot
deleted file mode 100644
index 884d534bf4a..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgf-sin.table"; set format "%.5f"
-set samples 25; plot [x=0:4] sin(x)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table
deleted file mode 100644
index 9ab8f2c8d56..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-sin.table
+++ /dev/null
@@ -1,29 +0,0 @@
-#Curve 0, 25 points
-#x y type
-0.00000 0.00000 i
-0.16667 0.16590 i
-0.33333 0.32719 i
-0.50000 0.47943 i
-0.66667 0.61837 i
-0.83333 0.74018 i
-1.00000 0.84147 i
-1.16667 0.91944 i
-1.33333 0.97194 i
-1.50000 0.99749 i
-1.66667 0.99541 i
-1.83333 0.96573 i
-2.00000 0.90930 i
-2.16667 0.82766 i
-2.33333 0.72309 i
-2.50000 0.59847 i
-2.66667 0.45727 i
-2.83333 0.30340 i
-3.00000 0.14112 i
-3.16667 -0.02507 i
-3.33333 -0.19057 i
-3.50000 -0.35078 i
-3.66667 -0.50128 i
-3.83333 -0.63788 i
-4.00000 -0.75680 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot
deleted file mode 100644
index bb95994cd89..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgf-x.table"; set format "%.5f"
-set samples 25; plot [x=0:4] x
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table
deleted file mode 100644
index 329b9fa56b5..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgf-x.table
+++ /dev/null
@@ -1,29 +0,0 @@
-#Curve 0, 25 points
-#x y type
-0.00000 0.00000 i
-0.16667 0.16667 i
-0.33333 0.33333 i
-0.50000 0.50000 i
-0.66667 0.66667 i
-0.83333 0.83333 i
-1.00000 1.00000 i
-1.16667 1.16667 i
-1.33333 1.33333 i
-1.50000 1.50000 i
-1.66667 1.66667 i
-1.83333 1.83333 i
-2.00000 2.00000 i
-2.16667 2.16667 i
-2.33333 2.33333 i
-2.50000 2.50000 i
-2.66667 2.66667 i
-2.83333 2.83333 i
-3.00000 3.00000 i
-3.16667 3.16667 i
-3.33333 3.33333 i
-3.50000 3.50000 i
-3.66667 3.66667 i
-3.83333 3.83333 i
-4.00000 4.00000 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot
deleted file mode 100644
index 8e3f24b9172..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.gnuplot
+++ /dev/null
@@ -1,5 +0,0 @@
-set terminal table
-set output "pgfmanual-sine.table"
-set format "%.5f"
-set samples 20
-plot [x=0:10] sin(x)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table
deleted file mode 100644
index 9d5d248a561..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfmanual-sine.table
+++ /dev/null
@@ -1,24 +0,0 @@
-#Curve 0, 20 points
-#x y type
-0.00000 0.00000 i
-0.52632 0.50235 i
-1.05263 0.86873 i
-1.57895 0.99997 i
-2.10526 0.86054 i
-2.63158 0.48819 i
-3.15789 -0.01630 i
-3.68421 -0.51638 i
-4.21053 -0.87669 i
-4.73684 -0.99970 i
-5.26316 -0.85212 i
-5.78947 -0.47390 i
-6.31579 0.03260 i
-6.84211 0.53027 i
-7.36842 0.88441 i
-7.89474 0.99917 i
-8.42105 0.84348 i
-8.94737 0.45948 i
-9.47368 -0.04889 i
-10.00000 -0.54402 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot
deleted file mode 100644
index 3bd81ae92d1..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.gnuplot
+++ /dev/null
@@ -1,2 +0,0 @@
-set terminal table; set output "plots/pgfplotgnuplot-example.table"; set format "%.5f"
-plot [x=0:3.5] x*sin(x)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table
deleted file mode 100644
index a4e517898a8..00000000000
--- a/Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/plots/pgfplotgnuplot-example.table
+++ /dev/null
@@ -1,104 +0,0 @@
-#Curve 0, 100 points
-#x y type
-0.00000 0.00000 i
-0.03535 0.00125 i
-0.07071 0.00500 i
-0.10606 0.01123 i
-0.14141 0.01993 i
-0.17677 0.03108 i
-0.21212 0.04466 i
-0.24747 0.06062 i
-0.28283 0.07893 i
-0.31818 0.09954 i
-0.35354 0.12240 i
-0.38889 0.14745 i
-0.42424 0.17463 i
-0.45960 0.20387 i
-0.49495 0.23509 i
-0.53030 0.26822 i
-0.56566 0.30318 i
-0.60101 0.33986 i
-0.63636 0.37817 i
-0.67172 0.41803 i
-0.70707 0.45932 i
-0.74242 0.50194 i
-0.77778 0.54577 i
-0.81313 0.59069 i
-0.84848 0.63660 i
-0.88384 0.68337 i
-0.91919 0.73086 i
-0.95455 0.77896 i
-0.98990 0.82753 i
-1.02525 0.87643 i
-1.06061 0.92554 i
-1.09596 0.97471 i
-1.13131 1.02381 i
-1.16667 1.07269 i
-1.20202 1.12121 i
-1.23737 1.16923 i
-1.27273 1.21661 i
-1.30808 1.26320 i
-1.34343 1.30886 i
-1.37879 1.35345 i
-1.41414 1.39682 i
-1.44949 1.43884 i
-1.48485 1.47937 i
-1.52020 1.51826 i
-1.55556 1.55537 i
-1.59091 1.59059 i
-1.62626 1.62376 i
-1.66162 1.65477 i
-1.69697 1.68348 i
-1.73232 1.70977 i
-1.76768 1.73353 i
-1.80303 1.75463 i
-1.83838 1.77296 i
-1.87374 1.78841 i
-1.90909 1.80089 i
-1.94444 1.81028 i
-1.97980 1.81650 i
-2.01515 1.81946 i
-2.05051 1.81906 i
-2.08586 1.81524 i
-2.12121 1.80792 i
-2.15657 1.79704 i
-2.19192 1.78252 i
-2.22727 1.76433 i
-2.26263 1.74240 i
-2.29798 1.71671 i
-2.33333 1.68720 i
-2.36869 1.65386 i
-2.40404 1.61667 i
-2.43939 1.57560 i
-2.47475 1.53066 i
-2.51010 1.48184 i
-2.54545 1.42915 i
-2.58081 1.37260 i
-2.61616 1.31223 i
-2.65152 1.24805 i
-2.68687 1.18011 i
-2.72222 1.10845 i
-2.75758 1.03312 i
-2.79293 0.95418 i
-2.82828 0.87170 i
-2.86364 0.78576 i
-2.89899 0.69642 i
-2.93434 0.60380 i
-2.96970 0.50797 i
-3.00505 0.40904 i
-3.04040 0.30713 i
-3.07576 0.20235 i
-3.11111 0.09482 i
-3.14646 -0.01533 i
-3.18182 -0.12796 i
-3.21717 -0.24292 i
-3.25253 -0.36007 i
-3.28788 -0.47926 i
-3.32323 -0.60032 i
-3.35859 -0.72308 i
-3.39394 -0.84739 i
-3.42929 -0.97305 i
-3.46465 -1.09990 i
-3.50000 -1.22774 i
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile
new file mode 100644
index 00000000000..4b0b147f908
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile
@@ -0,0 +1,33 @@
+rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
+doc = pgfmanual
+latex = xelatex --no-pdf
+TEXINPUTS := ../../text-en:$(TEXINPUTS)
+
+all: $(doc).pdf
+
+pgfmanual.idx:
+ touch pgfmanual.idx
+
+pgfmanual.ind: pgfmanual.idx
+ makeindex $(doc).idx
+
+pgfmanual.pdf: $(doc).tex $(doc).ind
+ (TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+ (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+ xdvipdfmx -p a4 $(doc)
+
+clean:
+ rm -f \
+ plots/* \
+ pgfmanual.out \
+ pgfmanual.log \
+ pgfmanual.idx \
+ pgfmanual.ind \
+ pgfmanual.ilg \
+ pgfmanual.pdf \
+ pgfmanual.toc \
+ pgfmanual.bbl \
+ pgfmanual.blg \
+ pgfmanual.ps \
+ pgfmanual.dvi \
+ pgfmanual*.aux
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex
new file mode 100644
index 00000000000..647d821179a
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex
@@ -0,0 +1,16 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\documentclass[a4paper]{ltxdoc}
+
+% pgf version is defined in \pgfversion in file
+% generic/pgf/utilities/pgfrcs.code.tex
+
+\input{../pgfmanual-xetex.cfg}
+\input{../../text-en/pgfmanual-en-main.tex}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg
new file mode 100644
index 00000000000..0466c698f54
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg
@@ -0,0 +1,16 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\usepackage[xetex]{graphics}
+% This will tell everyone which driver we are using.
+
+\usepackage[xetex]{hyperref}
+
+% Make sure to compile this using xelatex + xdvipdfmx.
diff --git a/Master/texmf-dist/doc/latex/pgf/README b/Master/texmf-dist/doc/latex/pgf/README
new file mode 100644
index 00000000000..de59b6dede9
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgf/README
@@ -0,0 +1,12 @@
+pgf -- A Portable Graphic Format for TeX
+
+See the directory doc/generic/pgf for more information. See the file
+doc/generic/pgf/pgfmanual.pdf for a manual. This
+documentation also explains the installation. See the file
+doc/generic/pgf/license/LICENSE for license details.
+
+Please go to http://sourceforge.net/projects/pgf/
+to submit bug reports, request new features, etc.
+
+
+
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdf b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdf
new file mode 100644
index 00000000000..d386670f931
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty
new file mode 100644
index 00000000000..8b76c5f24eb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.sty
@@ -0,0 +1,147 @@
+% A~definition of some database entity diagram arrow tips for
+% pgf (tikz) based on arrow declaration tips in the Till Tantau's pgf
+% manual for v1.10 p.\ 254.
+%
+% author: Natror (Grzegorz Murzynowski), natror at o2.pl
+% 2006/12/16
+%
+% This file is a~draft version intended to be possibly adjusted by the
+% tikz package developer(s) and included into the tikz bundle
+% on the Gnu Public License.
+%
+%
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pgfdatabasearrows}
+
+\RequirePackage{tikz}
+\RequirePackage{pgflibraryarrows}
+
+
+\newdimen\arrowsize
+
+% nulla
+\pgfarrowsdeclare{nulla}{nulla}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfarrowsleftextend{-.5\pgflinewidth}
+ \pgfarrowsrightextend{3\arrowsize+.5\pgflinewidth}
+}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfsetdash{}{0pt} % do not dash
+ \pgfsetroundjoin
+ \pgfsetroundcap
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{3\arrowsize}{0\arrowsize}}
+ \pgfusepathqstroke
+}
+
+% nulla = dbplain
+\pgfarrowsdeclarealias{dbplain}{dbplain}{nulla}{nulla}
+
+
+% nullalonga
+\pgfarrowsdeclare{nullalonga}{nullalonga}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfarrowsleftextend{-.5\pgflinewidth}
+ \pgfarrowsrightextend{5.5\arrowsize+.5\pgflinewidth}
+}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfsetdash{}{0pt} % do not dash
+ \pgfsetroundjoin
+ \pgfsetroundcap
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{5.5\arrowsize}{0\arrowsize}}
+ \pgfusepathqstroke
+}
+
+% nullalonga = dbplainlong
+\pgfarrowsdeclarealias{dbplainlong}{dbplainlong}{nullalonga}{nullalonga}
+
+
+% dboshortt
+\pgfarrowsdeclarecombine*[-.5\pgflinewidth]%offset
+{dboshortt}{dboshortt}{o}{o}{nulla}{nulla}
+
+% dboshort
+\pgfarrowsdeclarecombine*[-.5\pgflinewidth]%offset
+{dboshort}{dboshort}{o}{o}{nullalonga}{nullalonga}
+
+% dbo
+\pgfarrowsdeclarecombine*[-1\pgflinewidth]%offset
+{dbo}{dbo}{dboshort}{dboshort}{nulla}{nulla}
+
+% dbolong
+\pgfarrowsdeclarecombine*[-1\pgflinewidth]%offset
+{dbolong}{dbolong}{dboshort}{dboshort}{nullalonga}{nullalonga}
+
+% dbbar for nice combining
+\pgfarrowsdeclare{dbbar}{dbbar}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfarrowsleftextend{-.5\pgflinewidth}
+ \pgfarrowsrightextend{.5\pgflinewidth}
+}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfsetdash{}{0pt} % do not dash
+ \pgfsetroundjoin
+ \pgfsetroundcap
+ \pgfpathmoveto{\pgfpoint{0\arrowsize}{6\arrowsize}}
+ \pgfpathlineto{\pgfpoint{0\arrowsize}{-6\arrowsize}}
+ \pgfusepathqstroke
+}
+
+% db1
+\pgfarrowsdeclarecombine*[-.5\pgflinewidth]%offset
+{db1}{db1}{dbbar}{dbbar}{nulla}{nulla}
+
+% dbo1, starred to avoid stroking the o
+\pgfarrowsdeclarecombine*[-.5\pgflinewidth]%offset
+{dbo1}{dbo1}{dboshortt}{dboshortt}{db1}{db1}
+
+% db1o, * not to stroke |- in tight curves
+\pgfarrowsdeclarecombine*[-.5\pgflinewidth]%offset
+{db1o}{db1o}{db1}{db1}{dboshortt}{dboshortt}
+
+% dbmany
+\pgfarrowsdeclare{dbmany}{dbmany}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfarrowsleftextend{-.5\pgflinewidth}
+ \pgfarrowsrightextend{10.4\arrowsize+.5\pgflinewidth}
+}
+{
+ \arrowsize=0.2pt
+ \advance\arrowsize by .5\pgflinewidth
+ \pgfsetdash{}{0pt} % do not dash
+ \pgfsetroundjoin
+ \pgfsetroundcap
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{10.4\arrowsize}{6\arrowsize}}
+ \pgfusepathqstroke
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{10.4\arrowsize}{0\arrowsize}}
+ \pgfusepathqstroke
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{10.4\arrowsize}{-6\arrowsize}}
+ \pgfusepathqstroke
+}
+
+% dbomany
+\pgfarrowsdeclarecombine*[-1.5\pgflinewidth]%offset
+{dbomany}{dbomany}{dboshortt}{dboshortt}{dbmany}{dbmany}
+
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex
new file mode 100644
index 00000000000..c7fe6b8f5dd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/GrzegorzMurzynowski/pgfdatabasearrows.tex
@@ -0,0 +1,131 @@
+\documentclass[11pt]{article}
+\usepackage{pgfdatabasearrows}
+\usepackage{array}
+\usepackage[margin=2.5cm]{geometry}
+
+\begin{document}
+\pagestyle{empty}
+\raggedright
+\parskip\smallskipamount
+
+\noindent\hfill Warszawa,\\
+\noindent\hfill March 16, 2006,\\
+\noindent\hfill December 16, 2006 (next try).
+
+\medskip
+
+Prof.\ Dr.\ \textbf{Till Tantau}\\
+\texttt{tantau at users.sourceforge.net}
+
+\bigskip\bigskip
+Dear Sir,
+
+\medskip
+Here are some arrow tips for drawing database entity
+diagrams.
+
+\medskip
+(The first attempt to send you them I~made on March 16, 2006 but the
+mail was rejected due to overfull of your mailbox.)
+
+(At \emph{this} attempt the \textsf{sourceforge.net} server rejects
+mails with .zip attachments :-))
+
+(At the project's site I~didn't see any encouragement for contributions
+other than becoming a~Developer which is not the case here, I~suppose.
+
+I~mean, if you'd be interested in these arrow tips and wanted me to
+describe them a~bit more, I'd still remain just a~\textsf{tikz} user.)
+
+
+\bigskip
+\newcommand*\dbarrowtest[2]{%
+ #1 & \raisebox{.5ex}{\tikz[thick] \draw[#2-#2] (0,0.2) --
+ (2,0.2);\ \ \tikz[thin] \draw[#2-#2] (0,0.2) --
+ (2,0.2);}\\}
+
+
+\begin{tabular}{>{\ttfamily}r@{:\ \ }l}
+
+\dbarrowtest{dbplain {\normalfont alias} nulla}{nulla}
+\dbarrowtest{dbplainlong {\normalfont alias} nullalonga}{nullalonga}
+
+\dbarrowtest{dboshortt}{dboshortt}
+\dbarrowtest{dboshort}{dboshort}
+\dbarrowtest{dbo}{dbo}
+\dbarrowtest{dbolong}{dbolong}
+
+\dbarrowtest{dbbar {\normalfont (for combining)}}{dbbar}
+\dbarrowtest{db1}{db1}
+\dbarrowtest{dbo1}{dbo1}
+\dbarrowtest{db1o}{db1o}
+\dbarrowtest{dbmany}{dbmany}
+\dbarrowtest{dbomany}{dbomany}
+\end{tabular}
+%
+\quad
+%
+\begin{minipage}{.3\textwidth}
+
+And with curves:
+
+\medskip
+\newcommand*\dbarrowtestic[1]{\tikz\draw[rotate=-90,thin,#1-#1] (1,1) .. controls
+(0.4,1) and (0.6,0) .. (0,0);\ }
+
+\dbarrowtestic{nulla}
+\dbarrowtestic{nullalonga}
+\dbarrowtestic{dboshortt}
+\dbarrowtestic{dboshort}
+
+\dbarrowtestic{dbo}
+\dbarrowtestic{dbolong}
+\dbarrowtestic{dbbar}
+\dbarrowtestic{db1}
+
+\dbarrowtestic{dbo1}
+\dbarrowtestic{db1o}
+\dbarrowtestic{dbmany}
+\dbarrowtestic{dbomany}
+
+\tikz\draw[rotate=-90,thin,angle 60-angle 60] (0.5,1) .. controls
+(0.3,1) and (0.2,0) .. (0,0);
+
+\end{minipage}
+
+\bigskip
+
+I~think they may be useful for someone else.
+If there's no such arrow tips defined yet
+it would be an honour for me to see this humble package included into
+the \textsf{pgf} bundle.
+
+\medskip
+\noindent\leftline{\textbf{The `nulla' arrow tip advisability}}
+I~think something like \texttt{nulla} arrow would be useful in general
+(like Zero or Null are sometimes useful ;-) e.g., to straighten an
+ending of a~curve (compare my arrows with \texttt{angle 60} drawn last
+above).
+
+\medskip
+I~think there could be some standard arrow tips defined with a~straight
+segment in their middle so that they not look like last arrowcurve
+above but like this:
+%
+\tikz\draw[rotate=-90,thin,angle 60-angle 60] (0.5,.5) -- ++(-.1,0) .. controls
++(-.2,0) and +(0.2,0) .. (.1,0) -- (0,0);
+
+\medskip
+Once again thanks for a~good work.
+
+\medskip
+Yours sincerely and \TeX nically,\\
+\emph{Natror (Grzegorz Murzynowski)}\\
+\texttt{natror at o2.pl}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.pdf b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.pdf
new file mode 100644
index 00000000000..7e2a07930b2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.tex
new file mode 100644
index 00000000000..f194c9eaf56
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/basics.tex
@@ -0,0 +1,125 @@
+% Some basic examples for signal flow diagrams.
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+\documentclass{article}
+\usepackage{signalflowdiagram}
+
+\begin{document}
+
+%
+% Basic definitions of the symbols used in a signal flow diagram
+%
+
+% - input terminal
+\begin{signalflow}{Input terminal}
+ \node[input] (in) {$x(t)$};
+ \node[coordinate] (c) [right from=in] {};
+ % signal path
+ \path[r>] (in) -- (c);
+\end{signalflow}
+
+% - output terminal
+\begin{signalflow}{Output terminal}
+ \node[output] (out) {$y(t)$};
+ \node[coordinate] (c) [left from=out] {};
+ % signal path
+ \path[r>] (c) -- (out);
+\end{signalflow}
+
+% - branching node
+\begin{signalflow}{Branching node}
+ \node[input] (in) {$x(t)$};
+ \node[node] (nd) [right from=in] {};
+ \node[output] (out1) [above right from=nd] {$x(t)$};
+ \node[output] (out2) [below right from=nd] {$x(t)$};
+ % signal paths
+ \path[r>] (in) -- (nd);
+ \path[r>] (nd) |- (out1);
+ \path[r>] (nd) |- (out2);
+\end{signalflow}
+
+% - multiplier
+\begin{signalflow}{Multiplier}
+ \node[input] (in) {$x(t)$};
+ \node[multiplier] (mul) [right from=in] {\nodepart{above}{$\alpha$}};
+ \node[output] (out) [right from=mul] {$\alpha x(t)$};
+ % signal paths
+ \path[r>] (in) -- (mul);
+ \path[r>] (mul) -- (out);
+\end{signalflow}
+
+% - adder
+\begin{signalflow}{Adder}
+ \node[adder] (add) {};
+ \node[input] (in1) [above left from=add] {$x_1(t)$};
+ \node[input] (in2) [below left from=add] {$x_2(t)$};
+ \node[output] (out) [right from=add] {$x_1(t)+x_2(t)$};
+ % signal paths
+ \path[r>] (in1) -| (add);
+ \path[r>] (in2) -| (add);
+ \path[r>] (add) -- (out);
+\end{signalflow}
+
+% - modulator
+\begin{signalflow}{Modulator}
+ \node[modulator] (mul) {};
+ \node[input] (in1) [above left from=mul] {$x_1(t)$};
+ \node[input] (in2) [below left from=mul] {$x_2(t)$};
+ \node[output] (out) [right from=mul] {$x_1(t)x_2(t)$};
+ % signal paths
+ \path[r>] (in1) -| (mul);
+ \path[r>] (in2) -| (mul);
+ \path[r>] (mul) -- (out);
+\end{signalflow}
+
+% - delay element
+\begin{signalflow}{Delay element}
+ \node[input] (in) {$x(t)$};
+ \node[delay] (del) [right from=in] {$T$};
+ \node[output] (out) [right from=del] {$x(t-T)$};
+ % signal paths
+ \path[r>] (in) -- (del);
+ \path[r>] (del) -- (out);
+\end{signalflow}
+
+% - filter
+\begin{signalflow}{Filter}
+ \node[input] (in) {$x(t)$};
+ \node[filter] (fil) [right from=in] {$q(t)$};
+ \node[output] (out) [right from=fil] {$x(t)\ast q(t)$};
+ % signal paths
+ \path[r>] (in) -- (fil);
+ \path[r>] (fil) -- (out);
+\end{signalflow}
+
+% - building block
+\begin{signalflow}{Building block of a minimum shift keying modulator}
+ \node[input] (in) {$x(t)$};
+ \node[block] (msk) [right from=in] {Minimum shift keying modulator};
+ \node[output](out) [right from=msk] {$z(t)$};
+ % signal paths
+ \path[r>] (in) -- (msk);
+ \path[r>] (msk) -- (out);
+\end{signalflow}
+
+% - MSK symbol encoder
+\begin{signalflow}{Minimum shift keying symbol encoder}
+ \node[input] (in) {$x(t)$};
+ \node[modulator] (mod) [right from=in] {};
+ \node[multiplier] (mul) [below from=mod] {$\mathrm{j}$};
+ \node[delay] (del) [right from=mod] {$T$};
+ \node[node] (nd) [right from=del] {};
+ \node[output] (out) [right from=nd] {$y(t)$};
+ % signal paths
+ \path[c>] (in) -- (mod);
+ \path[c>] (mod) -- (del);
+ \path[c>] (del) -- (nd);
+ \path[c>] (nd) |- (mul);
+ \path[c>] (mul) -- (mod);
+ \path[c>] (nd) -- (out);
+\end{signalflow}
+
+
+\end{document}
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.pdf b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.pdf
new file mode 100644
index 00000000000..f9719f7e450
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.tex
new file mode 100644
index 00000000000..4a8af171c61
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/fir.tex
@@ -0,0 +1,61 @@
+% Example for an interconnection of signal flow diagrams.
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+\documentclass{article}
+\usepackage{signalflowdiagram}
+
+\begin{document}
+
+% An FIR filter
+\begin{signalflow}[node distance=9mm]{Finite impulse response filter of order $n$}%
+ % building blocks
+ \tikzgrid{
+ \node[input] (in) {$x(t)$} &
+ \node[node] (n0) {} &
+ \node[delay] (d1) {$T$} &
+ \node[node] (n1) {} &
+ \node[delay] (d2) {$T$} &
+ \node[node] (n2) {} &
+ \node[coordinate] (c1) {} &
+ \node[coordinate] (c3) {} &
+ \node[delay] (dn) {$T$} &
+ \\ &
+ \node[multiplier] (m0) {$\alpha_0$} & &
+ \node[multiplier] (m1) {$\alpha_1$} & &
+ \node[multiplier] (m2) {$\alpha_2$} & & & &
+ \node[multiplier] (mn) {$\alpha_n$}
+ \\ & & &
+ \node[adder] (a1) {} & &
+ \node[adder] (a2) {} &
+ \node[coordinate] (c2) {} &
+ \node[coordinate] (c4) {} & &
+ \node[adder] (an) {} &
+ \node[output] (out) {$y(t)$}
+ }
+ % signal paths
+ \path[r>] (in) -- (n0);
+ \path[r>] (n0) -- (d1);
+ \path[r>] (d1) -- (n1);
+ \path[r>] (n1) -- (d2);
+ \path[r>] (d2) -- (n2);
+ \path[r>] (n2) -- (c1); % continuation
+ \path[r.] (c1) -- (c3); % continuation
+ \path[r>] (c3) -- (dn); % continuation
+ \path[r>] (n0) -- (m0);
+ \path[r>] (n1) -- (m1);
+ \path[r>] (n2) -- (m2);
+ \path[r>] (dn) -| (mn);
+ \path[r>] (m0) |- (a1);
+ \path[r>] (m1) -- (a1);
+ \path[r>] (m2) -- (a2);
+ \path[r>] (mn) -- (an);
+ \path[r>] (a1) -- (a2);
+ \path[r>] (a2) -- (c2); % continuation
+ \path[r.] (c2) -- (c4); % continuation
+ \path[r>] (c4) -- (an); % continuation
+ \path[r>] (an) -- (out);
+\end{signalflow}
+
+\end{document}
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdf b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdf
new file mode 100644
index 00000000000..1092c9ba2d6
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex
new file mode 100644
index 00000000000..1bc3072d70d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/interconnection.tex
@@ -0,0 +1,25 @@
+% Example for an interconnection of signal flow diagrams.
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+\documentclass{article}
+\usepackage{signalflowdiagram}
+\usepackage{macros}
+
+\begin{document}
+
+% interconnection of an MSK symbol encoder with a pulse shaper
+\begin{signalflow}{Minimum shift keying modulator}%
+ \node[input] (in) {$x(t)$};
+ \mskCoder {mC} {right from=in} {};
+ \pulseShaper {pS} {right from=mC-out} {};
+ \node[output] (out) [right from=pS-out] {$z(t)$};
+ % signal paths
+ \path[c>] (in) -- (mC-in);
+ \path[c>] (mC-out) -- (pS-in);
+ \path[c>] (pS-out) -- (out);
+ \textaboveof{mC-out}{$y(t)$}
+\end{signalflow}
+
+\end{document}
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/macros.sty b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/macros.sty
new file mode 100644
index 00000000000..024b248cc76
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/macros.sty
@@ -0,0 +1,46 @@
+% Some macros for signal flow diagrams.
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{tikz}
+\RequirePackage{signalflowdiagram}
+\ProvidesPackage{macros}
+ [2007/01/05 v0.1 Some user-defined macros for signal flow diagrams]
+
+%
+% Creates the signal flow diagram of a minimum shift keying coder.
+%
+% #1 = global label
+% #2 = parameter for placement
+\newcommand{\mskCoder}[3]{%
+ % building blocks
+ \node[modulator] (#1-in) [#2] {};
+ \node[multiplier] (mul) [below from=#1-in] {$\mathrm{j}$};
+ \node[delay] (del) [right from=#1-in] {$T$};
+ \node[node] (#1-out) [right from=del] {};
+ % signal paths
+ \path[c>] (#1-in) -- (del);
+ \path[c>] (del) -- (#1-out);
+ \path[c>] (#1-out) |- (mul);
+ \path[c>] (mul) -- (#1-in);
+}%
+
+
+% Creates the signal flow diagram of a pulse shaper.
+%
+% #1 = global label
+% #2 = parameter for placement
+\newcommand{\pulseShaper}[4]{%
+ % building blocks
+ \node[modulator] (#1-in) [#2] {};
+ \node[coordinate] (pam)
+ [above from = #1-in,
+ label=above:$\sum\limits_{\nu=-\infty}^{\infty} \delta(t-t_\nu)$] {};
+ \node[filter] (#1-out) [right from = #1-in] {$q(t)$};
+ % signal paths
+ \path[r>] (pam) -- (#1-in);
+ \path[c>] (#1-in) -- (#1-out);
+}%
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex
new file mode 100644
index 00000000000..da8a6ea3848
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowarrows.code.tex
@@ -0,0 +1,31 @@
+% pgf/tikz library
+% for signal flow diagrams
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+
+
+% Styles for real and complex signal tips.
+\newcommand{\pgfarrowsextend}[1]{%
+ \pgfsetcolor{\pathdrawcolor}%
+ \@tempdima=#1\pgflinewidth%
+ \pgfarrowsleftextend{-2\@tempdima}
+ \pgfarrowsrightextend{2\@tempdima}
+}
+\newcommand{\pgfarrowsarrowtip}[1]{%
+ \pgfsetcolor{\pathdrawcolor}%
+ \@tempdima=#1\pgflinewidth%
+ \pgfpathmoveto{\pgfpoint{2\@tempdima}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\@tempdima}{\@tempdima}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{-\@tempdima}{-\@tempdima}}
+ \pgfusepathqfill
+}
+\pgfarrowsdeclare{real tip}{real tip}{\pgfarrowsextend{3}}{\pgfarrowsarrowtip{3}}
+\pgfarrowsdeclarereversed{real tip reversed}{real tip reversed}{real tip}{real tip}
+\pgfarrowsdeclare{complex tip}{complex tip}{\pgfarrowsextend{1}}{\pgfarrowsarrowtip{1}}
+\pgfarrowsdeclarereversed{complex tip reversed}{complex tip reversed}{complex tip}{complex tip}
+
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex
new file mode 100644
index 00000000000..0a7410cc443
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowblocks.code.tex
@@ -0,0 +1,469 @@
+% pgf/tikz library
+% for signal flow diagrams
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+
+% Known bugs: - Anchors of source shape are not precisely positioned.
+% - Anchor border of source shape is a rectangle.
+% - The bounding box of standard text label is ignored.
+
+
+%
+% Styles for nodes, terminals, and operators.
+%
+% - building blocks
+\tikzstyle{block color}%
+ = [draw=\blockdrawcolor,
+ fill=\blockfillcolor]
+\tikzstyle{block style}%
+ = [block color,
+ line width=\blocklinewidth,
+ text centered]
+\tikzstyle{block}%
+ = [rectangle,
+ block style,
+ minimum width=\blockwidth,
+ minimum height=\blockheight,
+ text width=\blocktextwidth]
+\tikzstyle{filter}%
+ = [rectangle,
+ block style,
+ minimum width=\filterwidth,
+ minimum height=\filterheight,
+ text width=\filtertextwidth]
+\tikzstyle{source}%
+ = [source shape,
+ operator style]
+\tikzstyle{serial parallel converter}%
+ = [serial parallel converter shape,
+ block style,
+ minimum width=10mm,
+ minimum height=20mm,
+ inner sep=2mm]
+\tikzstyle{parallel serial converter}%
+ = [parallel serial converter shape,
+ block style,
+ minimum width=10mm,
+ minimum height=20mm,
+ inner sep=2mm]
+\tikzstyle{symbol mapper}%
+ = [symbol mapper shape,
+ block style,
+ text centered,
+ minimum size=20mm,
+ text width=18mm]
+\tikzstyle{inverse symbol mapper}%
+ = [inverse symbol mapper shape,
+ block style,
+ text centered,
+ minimum size=20mm,
+ text width=18mm]
+
+
+%
+% Shape of a source.
+%
+\newbox\pgfnodeparttextbox
+\pgfdeclareshape{source shape}
+{
+ \savedanchor\westpoint{
+ \pgf@x=\wd\pgfnodeparttextbox%
+ \advance\pgf@x by\pgfshapeouterxsep%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by-.5\dp\pgfnodeparttextbox%
+ }
+ \saveddimen\radius{
+ \setlength\pgf@x{\pgfshapeminwidth}
+ }
+ \anchor{west}{\westpoint}
+ \anchor{north west}{
+ \pgf@process{\westpoint}
+ \advance\pgf@y by\radius
+ }
+ \anchor{north}{%
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius\advance\pgf@x by+0.5\pgf@xa
+ \pgf@ya=\radius\advance\pgf@y by+0.866025\pgf@ya
+ }
+ \anchor{north east}{%
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius\advance\pgf@x by+0.866025\pgf@xa
+ \pgf@ya=\radius\advance\pgf@y by+0.5\pgf@ya
+ }
+ \anchor{east}{
+ \pgf@process{\westpoint}
+ \advance\pgf@x by\radius
+ \advance\pgf@x by0.5\pgflinewidth
+ }
+ \anchor{south east}{%
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius\advance\pgf@x by+0.866025\pgf@xa
+ \pgf@ya=\radius\advance\pgf@y by-0.5\pgf@ya
+ }
+ \anchor{south}{%
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius\advance\pgf@x by+0.5\pgf@xa
+ \pgf@ya=\radius\advance\pgf@y by-0.866025\pgf@ya
+ }
+ \anchor{south west}{
+ \pgf@process{\westpoint}
+ \advance\pgf@y by-\radius
+ }
+ \anchor{center}{
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius\advance\pgf@x by+0.5\pgf@xa
+ }
+ % node part
+ \nodeparts{text}
+ \anchor{text}{
+ \pgf@process{\westpoint}
+ \pgf@xa=\radius
+ \advance\pgf@y by-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@x by-\wd\pgfnodeparttextbox%
+ \advance\pgf@x by-0.5mm
+ }
+ \anchorborder{%
+ \pgf@xb=\pgf@x% xb/yb is target
+ \pgf@yb=\pgf@y%
+ % southwest
+ \westpoint\advance\pgf@y by-\radius
+ \pgf@xa=\pgf@x% xa/ya is se
+ \pgf@ya=\pgf@y%
+ % northeast
+ \westpoint\advance\pgf@x by\radius\advance\pgf@y by\radius%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \pgf@xc=.5\pgf@x% x/y is half width/height
+ \pgf@yc=.5\pgf@y%
+ \advance\pgf@xa by\pgf@xc% xa/ya becomes center
+ \advance\pgf@ya by\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpointborderrectangle
+ {\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}
+ {\noexpand\pgfpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ }%
+ \pgf@process{\pgf@marshal}%
+ \advance\pgf@x by\pgf@xa%
+ \advance\pgf@y by\pgf@ya%
+ }
+ % Background path
+ \backgroundpath{
+ {\pgftransformreset{\pgfnodeparttextbox}}
+ \westpoint \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \advance\pgf@y by\radius
+ \pgfmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
+ \pgfpatharc{90}{-90}{\radius}
+ \pgfclosepath
+ }
+}
+
+
+%
+% Shape of a serial to parallel converter.
+%
+\newbox\pgfnodepartSbox
+\newbox\pgfnodepartPbox
+\pgfdeclareshape{serial parallel converter shape}
+{
+ % inherit from rectangle
+ \inheritsavedanchors[from=rectangle]
+ \inheritanchor[from=rectangle]{center}
+ \inheritanchor[from=rectangle]{north}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{east}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritanchor[from=rectangle]{south}
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{west}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchorborder[from=rectangle]
+ \inheritanchorborder[from=rectangle]
+ \inheritbackgroundpath[from=rectangle]
+ % terminal anchors
+ \anchor{in}{%
+ \northeast
+ \pgf@ya=0.5\pgf@y
+ \southwest
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by+\pgf@ya%
+ }
+ \anchor{out1}{
+ \southwest
+ \pgf@ya=0.9\pgf@y
+ \northeast
+ \pgf@y=0.1\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{out2}{
+ \southwest
+ \pgf@ya=0.7\pgf@y
+ \northeast
+ \pgf@y=0.3\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{outl}{
+ \southwest
+ \pgf@ya=0.1\pgf@y
+ \northeast
+ \pgf@y=0.9\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{dots}{
+ \southwest
+ \pgf@ya=0.4\pgf@y
+ \northeast
+ \pgf@y=0.6\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ \setlength{\pgf@xa}{\xspace}
+ \advance\pgf@x by.5\pgf@xa%
+ }
+ % node parts
+ \nodeparts{S,P}
+ \anchor{S}{
+ \southwest
+ \pgf@xa=\pgf@x
+ \northeast
+ \pgf@x=\pgf@xa
+ \advance\pgf@y by-\ht\pgfnodepartSbox%
+ \advance\pgf@y by-.5\dp\pgfnodepartSbox%
+ \advance\pgf@x by+\pgfshapeinnerxsep%
+ \advance\pgf@y by-\pgfshapeinnerysep%
+ }
+ \anchor{P}{
+ \northeast
+ \pgf@xa=\pgf@x
+ \southwest
+ \pgf@x=\pgf@xa
+ \advance\pgf@x by-\wd\pgfnodepartPbox%
+ \advance\pgf@x by-\pgfshapeinnerxsep%
+ \advance\pgf@y by+\pgfshapeinnerysep%
+ }
+ % diagonal line S/P
+ \foregroundpath{%
+ \pgfpathmoveto{\pgfpointadd{\southwest}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}
+ \pgfpathlineto{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}}
+ }
+}
+
+%
+% Shape of a parallel to serial converter.
+%
+\newbox\pgfnodepartSbox
+\newbox\pgfnodepartPbox
+\pgfdeclareshape{parallel serial converter shape}
+{
+ % inherit from rectangle
+ \inheritsavedanchors[from=rectangle]
+ \inheritanchor[from=rectangle]{center}
+ \inheritanchor[from=rectangle]{north}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{east}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritanchor[from=rectangle]{south}
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{west}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchorborder[from=rectangle]
+ \inheritanchorborder[from=rectangle]
+ \inheritbackgroundpath[from=rectangle]
+ % terminal anchors
+ \anchor{out}{%
+ \southwest
+ \pgf@ya=0.5\pgf@y
+ \northeast
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by+\pgf@ya%
+ }
+ \anchor{in1}{
+ \northeast
+ \pgf@ya=0.1\pgf@y
+ \southwest
+ \pgf@y=0.9\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{in2}{
+ \northeast
+ \pgf@ya=0.3\pgf@y
+ \southwest
+ \pgf@y=0.7\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{inl}{
+ \northeast
+ \pgf@ya=0.9\pgf@y
+ \southwest
+ \pgf@y=0.1\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{dots}{
+ \northeast
+ \pgf@ya=0.6\pgf@y
+ \southwest
+ \pgf@y=0.4\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ \setlength{\pgf@xa}{\xspace}
+ \advance\pgf@x by-.5\pgf@xa%
+ }
+ % node parts
+ \nodeparts{P,S}
+ \anchor{P}{
+ \southwest
+ \pgf@xa=\pgf@x
+ \northeast
+ \pgf@x=\pgf@xa
+ \advance\pgf@y by-\ht\pgfnodepartPbox%
+ \advance\pgf@y by-.5\dp\pgfnodepartPbox%
+ \advance\pgf@x by+\pgfshapeinnerxsep%
+ \advance\pgf@y by-\pgfshapeinnerysep%
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@xa=\pgf@x
+ \southwest
+ \pgf@x=\pgf@xa
+ \advance\pgf@x by-\wd\pgfnodepartSbox%
+ \advance\pgf@x by-\pgfshapeinnerxsep%
+ \advance\pgf@y by+\pgfshapeinnerysep%
+ }
+ % diagonal line S/P
+ \foregroundpath{%
+ \pgfpathmoveto{\pgfpointadd{\southwest}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}
+ \pgfpathlineto{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}}
+ }
+}
+
+
+%
+% Shape of a symbol mapper.
+%
+\pgfdeclareshape{symbol mapper shape}
+{
+ % rectangle anchors
+ \inheritsavedanchors[from=rectangle]
+ \inheritanchor[from=rectangle]{center}
+ \inheritanchor[from=rectangle]{north}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{east}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritanchor[from=rectangle]{south}
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{west}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchorborder[from=rectangle]
+ % terminal anchors
+ \anchor{out}{%
+ \southwest
+ \pgf@ya=0.5\pgf@y
+ \northeast
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by+\pgf@ya%
+ }
+ \anchor{in1}{
+ \northeast
+ \pgf@ya=0.1\pgf@y
+ \southwest
+ \pgf@y=0.9\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{in2}{
+ \northeast
+ \pgf@ya=0.3\pgf@y
+ \southwest
+ \pgf@y=0.7\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{dots}{
+ \northeast
+ \pgf@ya=0.6\pgf@y
+ \southwest
+ \pgf@y=0.4\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ \setlength{\pgf@xa}{\xspace}
+ \advance\pgf@x by-.5\pgf@xa%
+ }
+ \anchor{inl}{
+ \northeast
+ \pgf@ya=0.9\pgf@y
+ \southwest
+ \pgf@y=0.1\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ % rectangle shaped frame
+ \backgroundpath{
+ \pgfpathrectanglecorners
+ {\pgfpointadd{\southwest}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}
+ {\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}}
+ }
+
+ \inheritbackgroundpath[from=rectangle]
+}
+
+
+%
+% Shape of an inverse symbol mapper.
+%
+\pgfdeclareshape{inverse symbol mapper shape}
+{
+ % rectangle anchors
+ \inheritsavedanchors[from=rectangle]
+ \inheritanchor[from=rectangle]{center}
+ \inheritanchor[from=rectangle]{north}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{east}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritanchor[from=rectangle]{south}
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{west}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchorborder[from=rectangle]
+ % terminal anchors
+ \anchor{in}{%
+ \northeast
+ \pgf@ya=0.5\pgf@y
+ \southwest
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by+\pgf@ya%
+ }
+ \anchor{out1}{
+ \southwest
+ \pgf@ya=0.9\pgf@y
+ \northeast
+ \pgf@y=0.1\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{out2}{
+ \southwest
+ \pgf@ya=0.7\pgf@y
+ \northeast
+ \pgf@y=0.3\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{outl}{
+ \southwest
+ \pgf@ya=0.1\pgf@y
+ \northeast
+ \pgf@y=0.9\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ }
+ \anchor{dots}{
+ \southwest
+ \pgf@ya=0.4\pgf@y
+ \northeast
+ \pgf@y=0.6\pgf@y
+ \advance\pgf@y by\pgf@ya%
+ \setlength{\pgf@xa}{\xspace}
+ \advance\pgf@x by.5\pgf@xa%
+ }
+ % rectangle shaped frame
+ \backgroundpath{
+ \pgfpathrectanglecorners
+ {\pgfpointadd{\southwest}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}
+ {\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}}
+ }
+
+ \inheritbackgroundpath[from=rectangle]
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex
new file mode 100644
index 00000000000..37e3608ac8d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowdiagram.code.tex
@@ -0,0 +1,60 @@
+% pgf/tikz library
+% for signal flow diagrams
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+
+%
+% Extended general shape options, cf. tikz.code.tex
+%
+% #1 = source node
+% Remark: The node distance is used
+% for the distance between the borders of two nodes
+\tikzoption{below from}{\tikz@from{#1}{1}{-90}{south}{north}}%
+\tikzoption{right from}{\tikz@from{#1}{1}{0}{east}{west}}%
+\tikzoption{above from}{\tikz@from{#1}{1}{90}{north}{south}}%
+\tikzoption{left from}{\tikz@from{#1}{1}{180}{west}{east}}%
+\tikzoption{below left from}{\tikz@from{#1}{1.414214}{-135}{south west}{north east}}%
+\tikzoption{below right from}{\tikz@from{#1}{1.414214}{-45}{south east}{north west}}%
+\tikzoption{above right from}{\tikz@from{#1}{1.414214}{45}{north east}{south west}}%
+\tikzoption{above left from}{\tikz@from{#1}{1.414214}{135}{north west}{south east}}%
+\def\tikz@from#1#2#3#4#5{%
+ \def\tikz@anchor{#5}%
+ \let\tikz@do@auto@anchor=\relax%
+ \tikz@addtransform{\pgftransformshift{\pgfpointscale{#2}{\pgfpointpolar{#3}{\tikz@node@distance}}}}%
+ \def\tikz@node@at{\pgfpointanchor{#1}{#4}}}
+
+
+%
+% Styles for real and complex signal paths.
+%
+\tikzstyle{dotted path}
+ = [loosely dotted,
+ shorten >= 2mm,
+ shorten <= 2mm]
+\tikzstyle{r}
+ = [line width=\pathlinewidth,
+ >= real tip,
+ draw]
+\tikzstyle{r>}
+ = [r,->]
+\tikzstyle{<r}
+ = [r,<-]
+\tikzstyle{r.}
+ = [r,dotted path]
+\tikzstyle{c}
+ = [line width=\pathlinewidth,
+ double=\pathfillcolor,
+ double distance=\pathlinewidth,
+ >= complex tip,
+ draw,shorten <=-\pathlineextend]
+\tikzstyle{c>}
+ = [c,->]
+\tikzstyle{<c}
+ = [c,<-]
+\tikzstyle{c.}
+ = [c,dotted path]
+
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex
new file mode 100644
index 00000000000..f94f0a8f8a7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/pgflibrarytikzsignalflowoperators.code.tex
@@ -0,0 +1,259 @@
+% pgf/tikz library
+% for signal flow diagrams
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+
+
+%
+% Styles for nodes, terminals, and operators.
+%
+% - nodes and terminals
+\tikzstyle{node style}%
+ = [draw=\pathdrawcolor,
+ fill=\pathdrawcolor,
+ minimum size=\nodesize]
+\tikzstyle{terminal style}%
+ = [draw=\pathdrawcolor,
+ fill=\pathfillcolor,
+ line width=\pathlinewidth,
+ minimum size=\terminalsize]
+\tikzstyle{node}%
+ = [node shape,
+ node style]
+\tikzstyle{input}%
+ = [input terminal shape,
+ terminal style]
+\tikzstyle{output}%
+ = [output terminal shape,
+ terminal style]
+% - operators
+\tikzstyle{operator color}%
+ = [draw=\operatordrawcolor,
+ fill=\operatorfillcolor]
+\tikzstyle{operator style}%
+ = [operator color,
+ line width=\operatorlinewidth,
+ minimum size=\operatorsize]
+\tikzstyle{multiplier}%
+ = [multiplier shape,
+ operator style]
+\tikzstyle{modulator}%
+ = [modulator shape,
+ operator style]
+\tikzstyle{adder}%
+ = [adder shape,
+ operator style]
+\tikzstyle{delay}%
+ = [rectangle,
+ operator style,
+ minimum size=\delaysize]
+
+
+%
+% Circular shapes of operator symbols.
+%
+% #1 = additional inner symbol
+\newcommand{\circularshape}[1]{%
+ \savedanchor\centerpoint{\pgfpointorigin}
+ % radius is half of maximum of \pgfshapeminwidth and \pgfshapeminheight
+ \saveddimen\radius{%
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \ifdim\pgf@xa>\pgf@ya
+ \pgf@x=.5\pgf@xa
+ \else
+ \pgf@x=.5\pgf@ya
+ \fi
+ }
+ \inheritanchor[from=circle]{center}
+ \inheritanchorborder[from=circle]
+ \inheritanchor[from=circle]{north}
+ \inheritanchor[from=circle]{north east}
+ \inheritanchor[from=circle]{east}
+ \inheritanchor[from=circle]{south east}
+ \inheritanchor[from=circle]{south}
+ \inheritanchor[from=circle]{south west}
+ \inheritanchor[from=circle]{west}
+ \inheritanchor[from=circle]{north west}
+ \inheritanchor[from=circle]{mid}
+ \inheritanchor[from=circle]{mid west}
+ \inheritanchor[from=circle]{mid east}
+ \inheritanchor[from=circle]{base}
+ \inheritanchor[from=circle]{base west}
+ \inheritanchor[from=circle]{base east}
+ % circular shaped frame
+ \inheritbackgroundpath[from=circle]
+ % additional inner symbol
+ \foregroundpath{
+ \centerpoint%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \@tempdima=\radius%
+ #1
+ }
+ % no text
+ \nodeparts{}
+}
+
+
+%
+% Anchors for default text box, see below.
+%
+\newcommand{\stdaboveanchor}{%
+ \anchor{text}{%
+ \centerpoint
+ \advance\pgf@x by-0.5\wd\pgfnodeparttextbox%
+ \advance\pgf@y by\radius
+ \advance\pgf@y by+0.5mm
+ }
+}
+\newcommand{\stdrightanchor}{%
+ \anchor{text}{%
+ \centerpoint
+ \advance\pgf@x by\radius
+ \advance\pgf@x by+0.5mm
+ \advance\pgf@y by-0.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+0.5\dp\pgfnodeparttextbox%
+ }
+}
+\newcommand{\stdbelowanchor}{%
+ \anchor{text}{%
+ \centerpoint
+ \advance\pgf@x by-0.5\wd\pgfnodeparttextbox%
+ \advance\pgf@y by-\ht\pgfnodeparttextbox%
+ \advance\pgf@y by-\radius
+ \advance\pgf@y by-0.5mm
+ }
+}
+\newcommand{\stdleftanchor}{%
+ \anchor{text}{%
+ \centerpoint
+ \advance\pgf@x by-\radius
+ \advance\pgf@x by-\wd\pgfnodeparttextbox%
+ \advance\pgf@x by-0.5mm
+ \advance\pgf@y by-0.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+0.5\dp\pgfnodeparttextbox%
+ }
+}
+
+
+%
+% Circular shapes of operator symbols with default text box.
+%
+% #1 = place of the default text box
+\newbox\pgfnodepartabovebox
+\newbox\pgfnodepartrightbox
+\newbox\pgfnodepartbelowbox
+\newbox\pgfnodepartleftbox
+\newcommand{\labelledcircularshape}[1]{%
+ % node parts
+ \nodeparts{text,above,right,below,left}
+ % anchors
+ \savedanchor\centerpoint{\pgfpointorigin}
+ % radius is half of maximum of \pgfshapeminwidth and \pgfshapeminheight
+ \saveddimen\radius{%
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \ifdim\pgf@xa>\pgf@ya
+ \pgf@x=.5\pgf@xa
+ \else
+ \pgf@x=.5\pgf@ya
+ \fi
+ }
+ \inheritanchor[from=circle]{center}
+ \inheritanchorborder[from=circle]
+ \inheritanchor[from=circle]{north}
+ \inheritanchor[from=circle]{north east}
+ \inheritanchor[from=circle]{east}
+ \inheritanchor[from=circle]{south east}
+ \inheritanchor[from=circle]{south}
+ \inheritanchor[from=circle]{south west}
+ \inheritanchor[from=circle]{west}
+ \inheritanchor[from=circle]{north west}
+ \inheritanchor[from=circle]{mid}
+ \inheritanchor[from=circle]{mid west}
+ \inheritanchor[from=circle]{mid east}
+ \inheritanchor[from=circle]{base}
+ \inheritanchor[from=circle]{base west}
+ \inheritanchor[from=circle]{base east}
+ #1
+ \anchor{above}{%
+ \centerpoint
+ \advance\pgf@x by-0.5\wd\pgfnodepartabovebox%
+ \advance\pgf@y by\radius
+ \advance\pgf@y by+0.5mm
+ }
+ \anchor{right}{%
+ \centerpoint
+ \advance\pgf@x by\radius
+ \advance\pgf@x by+0.5mm
+ \advance\pgf@y by-0.5\ht\pgfnodepartrightbox%
+ \advance\pgf@y by+0.5\dp\pgfnodeparttextbox%
+ }
+ \anchor{below}{%
+ \centerpoint
+ \advance\pgf@x by-0.5\wd\pgfnodepartbelowbox%
+ \advance\pgf@y by-\ht\pgfnodepartbelowbox%
+ \advance\pgf@y by-\radius
+ \advance\pgf@y by-0.5mm
+ }
+ \anchor{left}{%
+ \centerpoint
+ \advance\pgf@x by-\radius
+ \advance\pgf@x by-\wd\pgfnodepartleftbox%
+ \advance\pgf@x by-0.5mm
+ \advance\pgf@y by-0.5\ht\pgfnodepartleftbox%
+ \advance\pgf@y by+0.5\dp\pgfnodeparttextbox%
+ }
+ % circular shaped frame
+ \inheritbackgroundpath[from=circle]
+}
+
+
+%
+% Shape of a node.
+%
+\pgfdeclareshape{node shape}{\labelledcircularshape{\stdaboveanchor}}%
+
+%
+% Shape of an input terminal.
+%
+\pgfdeclareshape{input terminal shape}{\labelledcircularshape{\stdleftanchor}}%
+%
+% Shape of an output terminal.
+%
+\pgfdeclareshape{output terminal shape}{\labelledcircularshape{\stdrightanchor}}%
+%
+% Shape of a multiplier.
+%
+\pgfdeclareshape{multiplier shape}{\labelledcircularshape{\stdleftanchor}}%
+%
+% Shape of a modulator.
+%
+\pgfdeclareshape{modulator shape}{\circularshape{%
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{-0.707107\@tempdima}{-0.707107\@tempdima}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{0.707107\@tempdima}{0.707107\@tempdima}}}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{0.707107\@tempdima}{-0.707107\@tempdima}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{-0.707107\@tempdima}{0.707107\@tempdima}}}
+}}%
+%
+% Shape of an adder.
+%
+\pgfdeclareshape{adder shape}{\circularshape{%
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{-0.5\@tempdima}{0\@tempdima}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{0.5\@tempdima}{0\@tempdima}}}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{0\@tempdima}{-0.5\@tempdima}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpoint{0\@tempdima}{0.5\@tempdima}}}
+}}%
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.pdf b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.pdf
new file mode 100644
index 00000000000..c06b5d79f08
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.tex b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.tex
new file mode 100644
index 00000000000..ec65a53b7d0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/placement.tex
@@ -0,0 +1,28 @@
+% Placement example of from command,
+% which is an extension of the of command,
+% cf. tikz.code.tex of Till Tantau.
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+\documentclass{article}
+\usepackage{signalflowdiagram}
+\usepackage{macros}
+
+\begin{document}
+
+%
+% Basic placement example using my "from" command.
+%
+\begin{signalflow}{Placement example}
+ \node[block] (bc) {center};
+ \node[block] (bl) [left from=bc] {left};
+ \node[block] (br) [right from=bc] {right};
+ \node[block] (ba) [above from=bc] {above};
+ \node[block] (bb) [below from=bc] {below};
+ \node[block] (bal) [above left from=bc] {above\\left};
+ \node[block] (bbl) [below left from=bc] {below\\left};
+ \node[block] (bal) [above right from=bc] {above\\right};
+ \node[block] (bbl) [below right from=bc] {below\\right};
+\end{signalflow}
+\end{document}
diff --git a/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty
new file mode 100644
index 00000000000..c258eb7a9d9
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/incoming/KarlheinzOchs/signalflowdiagram.sty
@@ -0,0 +1,138 @@
+% A simple library for signal flow diagrams
+% based on the pgf/tikz package of Till Tantau
+%
+% Author: Dr. Karlheinz Ochs, Ruhr-University of Bochum, Germany
+% Version: 0.1
+% Date: 2007/01/05
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{tikz}
+\ProvidesPackage{signalflowdiagram}
+ [2006/12/30 v0.1 Signal flow diagrams]
+
+%
+% Libraries for signal flow diagrams.
+%
+\usetikzlibrary{signalflowdiagram,signalflowarrows,signalflowoperators,signalflowblocks}
+
+
+%
+% Colors
+%
+\newcommand{\pathdrawcolor}{\blockdrawcolor} % draw color of signal paths
+\newcommand{\pathfillcolor}{\blockfillcolor} % fill color of signal paths
+\newcommand{\operatordrawcolor}{\blockdrawcolor} % draw color of operators
+\newcommand{\operatorfillcolor}{\blockfillcolor} % fill color of operators
+\newcommand{\blockdrawcolor}{black} % draw color of blocks
+\newcommand{\blockfillcolor}{white} % fill color of blocks
+
+%
+% line widths of
+%
+\newcommand{\diagramlinewidth}{0.5mm} % signal flow diagram frames
+\newcommand{\pathlinewidth}{0.3mm} % signal paths
+\newcommand{\operatorlinewidth}{0.3mm} % operator frames
+\newcommand{\blocklinewidth}{0.5mm} % building block styles
+
+%
+% line widths, sizes, etc.
+%
+\newcommand{\nodesize}{1.5mm} % size of nodes
+\newcommand{\terminalsize}{\nodesize} % size of terminals
+\newcommand{\operatorsize}{3mm} % size of circular shaped operator symbols
+\newcommand{\delaysize}{6mm} % minimum size of delay elements
+\newcommand{\blockwidth}{24mm} % minimum width of blocks
+\newcommand{\blockheight}{12mm} % minimum height of blocks
+\newcommand{\blocktextwidth}{22mm} % minimum text width of blocks
+\newcommand{\filterwidth}{12mm} % minimum width of filters
+\newcommand{\filterheight}{8mm} % minimum height of filters
+\newcommand{\filtertextwidth}{6mm} % minimum text width of filters
+
+%
+% misc.
+%
+\newcommand{\pathlineextend}{0.025mm} % shortens the end of the signal paths
+\newcommand{\vbullets}[1]{% vertical bullets
+\node[rectangle,anchor=center,at=(#1),text width=2ex]{%
+$\bullet$\\[-1ex] $\bullet$\\[-1ex] $\bullet$}
+}%
+
+
+%
+% Signal flow diagram.
+%
+% #1 = optional parameter(s)
+% #2 = title text
+\tikzstyle{signal flow diagram} =
+ [rectangle,
+ sharp corners,
+ line width=\diagramlinewidth,
+ draw=black,
+ inner sep=3mm]
+\newenvironment{signalflow}[2][]{%
+\begin{center}
+ \begin{tikzpicture}
+ \node[% title
+ signal flow diagram,
+ fill=blue!90!black,
+ text=white] (title) {#2};% title text
+ \node at (title.south west) [%
+ signal flow diagram,
+ fill=blue!20!white,
+ anchor=north west,
+ yshift=\pgflinewidth]
+ \bgroup
+ \begin{minipage}{0.9\textwidth}
+ \centering
+ \begin{tikzpicture}[%
+ node distance=8mm,
+ pin distance=8mm,
+ label distance=-0.5mm,
+ inner sep=1mm,
+ anchor=center,
+ text centered,
+ #1]% optional parameter(s)
+}{%
+ \end{tikzpicture}
+ \end{minipage}
+ \egroup;
+ \end{tikzpicture}
+\end{center}
+}%
+
+
+%
+% Positioning of node text.
+%
+% #1 = node label
+% #2 = label text
+\newcommand{\textaboveof}[2]{\pgftext[bottom,at=\pgfpointanchor{#1}{north},y=+1mm]{#2}}%
+\newcommand{\textrightof}[2]{\pgftext[left, at=\pgfpointanchor{#1}{east}, x=+1mm]{#2}}%
+\newcommand{\textbelowof}[2]{\pgftext[top ,at=\pgfpointanchor{#1}{south},y=-1mm]{#2}}%
+\newcommand{\textleftof} [2]{\pgftext[right, at=\pgfpointanchor{#1}{west}, x=-1mm]{#2}}%
+
+\makeatletter
+\newcounter{r}
+\newcommand{\tikzgrid}{%
+ \pgfsetxvec{\pgfpoint{\tikz@node@distance}{0mm}}%
+ \pgfsetyvec{\pgfpoint{0mm}{\tikz@node@distance}}%
+ \tikz@matrix%
+}
+\newcommand{\tikz@matrix}[1]{\tikz@@matrix#1@}%
+\def\tikz@@matrix#1@{\do@rows#1\\@\\}%
+\def\do@rows#1\\{%
+ \ifx#1@%
+ \else%
+ \setcounter{r}{0}%
+ \do@columns#1&@&%
+ \pgftransformshift{\pgfpointxy{-\ther}{-1}}%
+ \expandafter\do@rows%
+ \fi}%
+\def\do@columns#1&{%
+ \if#1@%
+ \else%
+ \stepcounter{r}%
+ \pgftransformshift{\pgfpointxy{1}{0}}%
+ #1;%
+ \expandafter\do@columns%
+ \fi}%
+\makeatother
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/external/Makefile b/Master/texmf-dist/source/latex/pgf/testsuite/external/Makefile
new file mode 100644
index 00000000000..0ba43c08570
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/external/Makefile
@@ -0,0 +1,18 @@
+
+all: tikzexternaltest.pdf tikzexternaltestmakefile.pdf
+
+
+tikzexternaltest.pdf: FORCE
+ pdflatex -shell-escape tikzexternaltest.tex
+
+tikzexternaltestmakefile.pdf: FORCE
+ pdflatex tikzexternaltestmakefile.tex
+ $(MAKE) -f tikzexternaltestmakefile.makefile
+ pdflatex tikzexternaltestmakefile.tex
+ $(MAKE) -f tikzexternaltestmakefile.makefile
+ pdflatex tikzexternaltestmakefile.tex
+
+FORCE:
+
+clean:
+ rm -f *.aux *.auxlock *.log *.pdf *.dpth *.dep *.makefile *.figlist *.out
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex
new file mode 100644
index 00000000000..8a200fcf991
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.code.tex
@@ -0,0 +1,41 @@
+\parskip=1cm
+\parindent=0pt
+
+A small image with a filled circle follows here (with baseline): \tikz[baseline] \fill[red] (0,1cm) circle(2pt);
+
+\tikzsetnextfilename{\tikzexternalrealjob-setnextfilename}
+The next one uses
+\begin{tikzpicture}[baseline]
+ \draw (0,0) grid (4,4);
+\end{tikzpicture}
+an explizit file name.
+
+\begin{tikzpicture}
+ \node[draw,rounded corners] {A node with a ref (\ref{eq:1})};
+\end{tikzpicture}
+
+\begin{equation}
+ 1+1=3
+ \label{eq:1}
+\end{equation}
+
+\begin{tikzpicture}
+ \node[draw,rounded corners] {A node which contains a label\label{a:label:in:a:picture}};
+\end{tikzpicture}
+
+The label inside of a node is on page~\pageref{a:label:in:a:picture}.
+
+\expandafter\ifx\csname pgfplotslegendfromname\endcsname\relax
+\else
+The following picture exports a legend to the aux file (if possible).
+\begin{tikzpicture}
+ \begin{axis}[legend entries={1,2,3,4},legend to name=legend:name]
+ \addplot {x};
+ \addplot {x+1};
+ \addplot {x+2};
+ \addplot {x+3};
+ \end{axis}
+\end{tikzpicture}
+
+Here is the legend: \pgfplotslegendfromname{legend:name}.
+\fi
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex
new file mode 100644
index 00000000000..87e94f899eb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex
@@ -0,0 +1,20 @@
+\documentclass[a4paper]{article}
+\usepackage[utf8]{inputenc}
+
+\usepackage{tikz}
+\usepackage{hyperref}
+
+\IfFileExists{pgfplots.sty}{%
+ \usepackage{pgfplots}
+}{}%
+
+\IfFileExists{tikzlibraryexternal.code.tex}{%
+ \usetikzlibrary{external}
+}{%
+ \message{TEST IS RUNNING IN COMPATIBILITY MODE}%
+ % a test to check for pgf 2.00 compatibility, to check whether the
+ % external library copy shipped with pgfplots works:
+ \usepgfplotslibrary{external}
+}%
+
+\pgfkeys{/pgf/images/include external/.code={\href{file:#1}{\pgfimage{#1}}}}
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.tex b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.tex
new file mode 100644
index 00000000000..2aaef55effe
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltest.tex
@@ -0,0 +1,12 @@
+\input tikzexternaltest.sharedpreamble.tex
+
+\tikzexternalize{tikzexternaltest}
+
+\author{Christian Feuers\"anger}
+\title{Test with default config and Provided Basefilename}
+
+\begin{document}
+\maketitle
+\input{tikzexternaltest.code.tex}
+\end{document}
+
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex
new file mode 100644
index 00000000000..232489823ec
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/external/tikzexternaltestmakefile.tex
@@ -0,0 +1,12 @@
+\input tikzexternaltest.sharedpreamble.tex
+
+\tikzexternalize[mode=list and make]
+
+\author{Christian Feuers\"anger}
+\title{Test with mode list and make, automatic Basefilename}
+
+\begin{document}
+\maketitle
+\input{tikzexternaltest.code.tex}
+\end{document}
+
diff --git a/Master/texmf-dist/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex b/Master/texmf-dist/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex
new file mode 100644
index 00000000000..7ae80434c2d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pgf/testsuite/mathtest/pgfmathtestsuite.tex
@@ -0,0 +1,1073 @@
+\documentclass[a4paper]{article}
+
+\usepackage[intlimits]{amsmath}
+\usepackage{amssymb}
+\usepackage{amsfonts}
+\usepackage{ifpdf}
+
+\ifpdf
+ \usepackage{hyperref}
+\else
+ \def\pgfsysdriver{pgfsys-dvipdfm.def}
+ \usepackage[dvipdfm]{hyperref}
+\fi
+\usepackage{pgf}
+\usepackage{fp}
+
+\makeatletter
+\pgfutil@ifundefined{pgfmathdeclarefunction}{
+ % load pgfplots with its pgf 2.00 compatibility code:
+ \usepackage{pgfplots}
+}{
+ \usepgflibrary{fpu}
+}
+\makeatother
+
+
+
+\parindent=0pt
+
+
+\author{Christian Feuers\"anger}
+\title{Test cases for pgffloatmath.code.tex}
+
+\def\testsection#1{\message{---------- STARTING TEST SECTION '#1'}\section{#1}}
+\def\testsubsection#1{\message{-------STARTING TEST SUBSECTION '#1'}\subsection{#1}}
+\def\testsubsubsection#1{\message{------STARTING TEST SUBSUBSECTION '#1'}\subsubsection{#1}}
+
+
+\def\compare#1#2{%
+ \begingroup
+ \message{COMPUTING LOG(#1)}%
+ \pgfmathlog{#1}%
+ \let\actual=\pgfmathresult
+ \def\expected{#2}%
+ \pgfmathsubtract\actual\expected%
+ \let\abserr=\pgfmathresult
+ \pgfmathdivide\abserr\expected
+ \let\relerr=\pgfmathresult
+ \noindent
+ log(#1)\hfill=
+ \expected;\hfill%
+ actual=\actual;\hfill%
+ abserr=\abserr;\hfill%
+ relerr=\relerr;\hfill%
+ \endgroup
+ \par
+}%
+%--------------------------------------------------
+% \def\showlowlevelfloat#1#2e#3\relax{%
+% \ensuremath{[#1] \cdot #2 \cdot 10^{#3}}%
+% }%
+%--------------------------------------------------
+\long\def\showlowlevelfloatmacro#1{#1}
+
+\long\def\showlowlevelfloatmacrolong#1{%
+ #1 is decomposed into
+
+ {%
+ \gdef\testerror{}%
+ \pgfmathfloattoregisters{#1}{\count0 }{\dimen0 }{\count1 }%
+ pgfmathfloattoregisters: flags \the\count0; M=\the\dimen0; E=\the\count1
+ \ifx\testerror\empty
+ \else
+ \par (caught \texttt{\testerror})%
+ \fi
+ }%
+
+ {%
+ \gdef\testerror{}%
+ pgfmathfloattoregisterstok: \pgfmathfloattoregisterstok{#1}{\count0 }{\toks0 }{\count1 }%
+ flags \the\count0; M=\the\toks0; E=\the\count1
+ \ifx\testerror\empty
+ \else
+ \par (caught \texttt{\testerror})%
+ \fi
+ }%
+
+ {%
+ \gdef\testerror{}%
+ pgfmathfloatgetflags \pgfmathfloatgetflags{#1}{\count0 }
+ flags \the\count0;
+ \ifx\testerror\empty
+ \else
+ \par (caught \texttt{\testerror})%
+ \fi
+ }%
+
+ \medskip
+ %\expandafter\showlowlevelfloat#1\relax
+}%
+
+\def\showsinglenumberparsing#1{%
+%\tracingmacros=2\tracingcommands=2
+ \begingroup
+ \message{PARSING NUMBER #1...}%
+ \gdef\testerror{}%
+ \pgfmathfloatparsenumber{#1}%
+ \let\resultasfloat=\pgfmathresult
+ \pgfmathfloattofixed\resultasfloat
+ \let\resultasfixed=\pgfmathresult
+ \[ #1 \mapsto \resultasfloat = \showlowlevelfloatmacro\resultasfloat \mapsto \resultasfixed
+ \]
+ \ifx\testerror\empty
+ \else
+ \par (caught \texttt{\testerror})%
+ \fi
+ \endgroup
+%\tracingmacros=0\tracingcommands=0
+}
+
+\def\pretty#1{%
+ \message{Pretty-printing #1...}%
+ \pgfmathprintnumberto{#1}\result
+ {\pgfkeys{/pgf/number format/showpos}\pgfmathprintnumberto{#1}\resultpos\global\let\resultpos=\resultpos}%
+ \[ #1 \mapsto \pgfmathprintnumber{#1} [=\resultpos] \]
+ \message{#1 mapsto \meaning\result}%
+}
+
+\begin{document}
+\maketitle
+
+
+%--------------------------------------------------
+% \showit{2.8128}
+% log(12)=\pgfmathlog{1.2}\pgfmathadd{\pgfmathresult}{2.30258}\pgfmathresult\par
+% \showit{1.2}
+% \showit{4.0}
+% log(1200)=\pgfmathlog{1.2}\pgfmathadd{\pgfmathresult}{6.9077}\pgfmathresult\par
+% log(6.241e-7)=\pgfmathlog{6.241}\pgfmathadd{\pgfmathresult}{-16.11809}\pgfmathresult\par
+%--------------------------------------------------
+
+\testsection{Conversion to normalised floating point numbers basis 10}
+\showsinglenumberparsing{123.41251}%
+\showsinglenumberparsing{1023.52}
+\showsinglenumberparsing{123412.51}%
+\showsinglenumberparsing{12341251.0}%
+\showsinglenumberparsing{-12341251.0}%
+\showsinglenumberparsing{1.2341251}%
+\showsinglenumberparsing{8.02410024}
+\showsinglenumberparsing{8.024100}
+\showsinglenumberparsing{0001234.3100}
+\showsinglenumberparsing{0001234.00001}
+\showsinglenumberparsing{0001000.00001}
+\showsinglenumberparsing{0001000.00001000}
+\showsinglenumberparsing{0.12341251}%
+\showsinglenumberparsing{0.0012341251}%
+\showsinglenumberparsing{0.00000012341251}%
+\showsinglenumberparsing{-0.00000012341251}%
+\showsinglenumberparsing{10}
+\showsinglenumberparsing{100.351}
+\showsinglenumberparsing{100.35100}
+\showsinglenumberparsing{100.35100234}
+\showsinglenumberparsing{100.0035100234}
+\showsinglenumberparsing{100}
+\showsinglenumberparsing{99999}
+\showsinglenumberparsing{999.000}
+
+%\tracingmacros=2 \tracingcommands=2
+\showsinglenumberparsing{8.31160034e-02}%
+\showsinglenumberparsing{2.54685628e-02}%
+\showsinglenumberparsing{7.40715288e-03}%
+\showsinglenumberparsing{2.10192154e-03}%
+\showsinglenumberparsing{5.87352989e-04}%
+\showsinglenumberparsing{-1.62269942e-04}%
+\showsinglenumberparsing{4.44248889e-05}%
+\showsinglenumberparsing{1.20714122e-05}%
+\showsinglenumberparsing{3.26101452e-06}%
+\showsinglenumberparsing{3261.01452e-06}%
+\showsinglenumberparsing{0.000326101452e-06}%
+\showsinglenumberparsing{1.2345e-12}%
+\showsinglenumberparsing{1.2345e+12}%
+
+\message{SPECIAL CASE 0}%
+\showsinglenumberparsing{0}
+\showsinglenumberparsing{-0}
+\showsinglenumberparsing{-0.000}
+\showsinglenumberparsing{+0.000}
+\showsinglenumberparsing{+0}
+\showsinglenumberparsing{-1}
+\showsinglenumberparsing{1.0e1}
+\showsinglenumberparsing{1e1}
+\showsinglenumberparsing{1141}
+\showsinglenumberparsing{-53e-5}
+
+\testsubsection{Error handling}
+{
+ \pgfkeys{
+ /pgf/fpu/handlers/empty number/.code 2 args={%
+ \gdef\testerror{handlers/empty number=\{#1\}\{#2\}}%
+ },
+ /pgf/fpu/handlers/invalid number/.code 2 args={%
+ \gdef\testerror{handlers/invalid number=\{#1\}\{#2\}}%
+ },
+ /pgf/fpu/handlers/wrong lowlevel format/.code 2 args={%
+ \gdef\testerror{handlers/wrong lowlevel format=\{#1\}\{#2\}}%
+ },
+ }
+ \showsinglenumberparsing{-53e-5 not terminated}
+ %\showsinglenumberparsing{-53e-}
+ \showsinglenumberparsing{}
+ \showsinglenumberparsing{ ASDZ@414e12}
+
+ This one has trailing spaces and should work:
+ \showsinglenumberparsing{10 }
+
+ This one has leading spaces and should work:
+ \showsinglenumberparsing{ 10}
+
+ \testsubsection{Error handling of decompose routines}
+
+ \pgfmathfloatparsenumber{100}
+ \showlowlevelfloatmacrolong{\pgfmathresult}
+
+ \showlowlevelfloatmacrolong{132}
+
+ \showlowlevelfloatmacrolong{Z}
+}
+
+\testsection{logarithms, compared with PGF arithmetics}
+
+\compare{0.1}{-2.30259}
+\compare{0.12}{-2.12026}
+\compare{0.2}{-1.60944}
+\compare{0.3}{-1.20397}
+\compare{0.4}{-0.916291}
+\compare{0.5}{-0.693147}
+\compare{0.6}{-0.510826}
+\compare{0.7}{-0.356675}
+\compare{0.75}{-0.287682}
+\compare{0.8}{-0.223144}
+\compare{0.823}{-0.194799}
+\compare{0.9}{-0.105361}
+\compare{0.96}{-0.040822}
+\compare{1.2}{0.182322}
+\compare{1.5}{0.405465}
+\compare{1.6}{0.470004}
+\compare{9.0}{2.1972245773}
+\compare{9.2}{2.2192034}
+\compare{9.3}{2.23001440}
+\compare{9.7}{2.27212588}
+\compare{10.0}{2.302585092}
+\compare{100.0}{4.605170185}
+\compare{1351.0}{7.208600337}
+\compare{9752.0}{9.185227671}
+\compare{9600.0}{9.169518377}
+
+\vskip1cm
+\compare{0.000142}{-8.8596835}
+\compare{0.0054124}{-5.219062661}
+\compare{0.000912697124}{-6.9991064}
+
+\vskip1cm
+\compare{8.31160034e-02}{-2.48751801563782}%
+\compare{2.54685628e-02}{-3.67031041875206}%
+\compare{7.40715288e-03}{-4.90530914022879}%
+\compare{2.10192154e-03}{-6.16490333357987}%
+\compare{5.87352989e-04}{-7.43988457474844}%
+\compare{1.62269942e-04}{-8.72624930084187}%
+\compare{4.44248889e-05}{-10.0217106847708}%
+\compare{1.20714122e-05}{-11.3246705288704}%
+\compare{3.26101452e-06}{-12.6334722085451}%
+
+\vskip1cm
+\compare{5}{1.6094379124341}%
+\compare{17}{2.83321334405622}%
+\compare{39}{3.66356164612965}%
+\compare{49}{3.89182029811063}%
+\compare{129}{4.85981240436167}%
+\compare{321}{5.77144112313002}%
+\compare{769}{6.64509096950564}%
+\compare{1793}{7.49164547360513}%
+\compare{4097}{8.31801027754687}%
+\compare{9217}{9.12880488399366}%
+
+
+\testsection{Test for prettyprinter}
+%\tracingmacros=2\tracingcommands=2
+\message{PRETTY PRINTING}
+{
+\twocolumn
+\def\prettytest{%
+ \pretty{1}
+ \pretty{1.0}
+ \pretty{-1.02311}
+ \pretty{-11241.02311}
+ \pretty{-11241}
+ \pretty{8124.99999}
+ \pretty{8124.849999}
+ \pretty{8124.843333}
+ \pretty{8.82}
+ \pretty{8.5}
+ \pretty{9.}
+ \pretty{5.9}
+ \pretty{-0.00001}
+ \pretty{-1.00001}
+ \pretty{-0.559}
+ \pretty{-0.554}
+ \pretty{-0.00000141}
+ \pretty{1.234e10}
+ \pretty{123456781}
+ \pretty{1234}
+ \pretty{8}
+ \pretty{-9.995}
+ \pretty{-0.015}
+ \pretty{-0.1}
+ \pretty{-0.15}
+ \pretty{0.15}
+ \pretty{-0}
+ \pretty{0}
+ \pretty{9.00}
+ \pretty{200.01}
+ \pretty{200.0000}
+ \pretty{1.5e-7}
+ \pretty{0.00035}
+ \pretty{0.00005}
+ \pretty{nan}
+ \pretty{inf}
+ \pretty{-inf}
+ \pretty{10}
+ \pretty{100}
+ \pretty{200}
+ \pretty{500}
+ \pretty{1000}
+ \pretty{30000}
+ \pretty{600000}
+ \pretty{1000000}
+ \pretty{30000000}
+ \pretty{600000000}
+ \pretty{1000000000}
+ \pretty{-10}
+ \pretty{-100}
+ \pretty{-200}
+ \pretty{-500}
+ \pretty{-1000}
+ \pretty{-30000}
+ \pretty{-600000}
+ \pretty{-1000000}
+ \pretty{-30000000}
+ \pretty{-600000000}
+ \pretty{-1000000000}
+}
+
+\testsubsection{STD format}
+\pgfqkeys{/pgf/number format}{std}
+\prettytest
+
+{
+\testsubsubsection{precision 0}
+\pgfqkeys{/pgf/number format}{precision=0}
+\prettytest
+}
+
+{
+\testsubsection{FIXED format}
+\testsubsubsection{with period}
+\pgfqkeys{/pgf/number format}{fixed,use period}
+\prettytest
+
+{
+\testsubsubsection{precision 0}
+\pgfqkeys{/pgf/number format}{precision=0}
+\prettytest
+}
+{
+\testsubsubsection{skip 0.=true}
+\pgfqkeys{/pgf/number format}{skip 0.=true}
+\prettytest
+}
+
+{
+\testsubsubsection{1000 sep; min exponent for 1000 sep=4}
+\pgfqkeys{/pgf/number format}{1000 sep=',min exponent for 1000 sep=4}
+\prettytest
+}
+
+\testsubsubsection{with comma}
+\pgfqkeys{/pgf/number format}{fixed,use comma}
+\prettytest
+}
+
+
+{
+\testsubsection{FIXED ZEROFILL format}
+\testsubsubsection{with period}
+\pgfqkeys{/pgf/number format}{fixed,fixed zerofill,use period}
+\prettytest
+
+{
+\testsubsubsection{precision 0}
+\pgfqkeys{/pgf/number format}{precision=0}
+\prettytest
+}
+
+\testsubsubsection{with comma}
+\pgfqkeys{/pgf/number format}{fixed,fixed zerofill,use comma}
+%\tracingmacros=2\tracingcommands=2
+\prettytest
+%\tracingmacros=0\tracingcommands=0
+}
+
+{
+\testsubsection{sci format}
+\testsubsubsection{with period}
+\pgfqkeys{/pgf/number format}{sci,use period}
+\prettytest
+
+{
+\testsubsubsection{precision 0}
+\pgfqkeys{/pgf/number format}{precision=0}
+\prettytest
+}
+
+\testsubsubsection{with comma}
+\pgfqkeys{/pgf/number format}{sci,use comma}
+\prettytest
+
+%\testsubsection{may skip mantisse}
+%\pgfqkeys{/pgf/number format}{sci may skip mantisse=true}
+%\prettytest
+
+}{
+\testsubsection{sci format zerofill}
+\testsubsubsection{with period}
+\pgfqkeys{/pgf/number format}{sci,sci zerofill,use period}
+\prettytest
+
+\testsubsubsection{with comma}
+\pgfqkeys{/pgf/number format}{sci,sci zerofill,use comma}
+\prettytest
+
+\testsubsubsection{e-style}
+\pgfqkeys{/pgf/number format}{sci e}
+\prettytest
+
+\testsubsubsection{subscript-style}
+\pgfqkeys{/pgf/number format}{sci subscript}
+\prettytest
+
+\testsubsubsection{subscript-style + period + no zero fill}
+\pgfqkeys{/pgf/number format}{sci subscript,use period,sci}
+\prettytest
+
+\testsubsubsection{subscript-style precision 4}
+\pgfqkeys{/pgf/number format}{sci subscript,precision=4}
+\prettytest
+}
+
+\testsubsection{int trunc format}
+\pgfqkeys{/pgf/number format}{int trunc}
+\prettytest
+
+\testsubsection{int detect format}
+\pgfqkeys{/pgf/number format}{int detect}
+\prettytest
+
+\testsubsection{frac}
+\pgfqkeys{/pgf/number format}{frac}
+\pretty{0.333333333333333}
+\pretty{0.5}
+\pretty{2.133333333333325e-01}%
+\pretty{0.12}
+\pretty{2.666666666666646e-02}%
+\pretty{-1.333333333333334e-02}%
+\pretty{7.200000000000000e-01}%
+\pretty{6.666666666666667e-02}%
+\pretty{1.333333333333333e-01}%
+\pretty{-1.333333333333333e-02}%
+\pretty{8.533333333333298e-01}
+\pretty{8.533333e-01}
+}
+\onecolumn
+
+\begingroup
+\testsection{testing pgfmathfloatadd}
+\def\testfloataddnonsymmetric#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\first=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\second=\pgfmathresult
+ \message{computing #1 + #2; \first + \second}%
+ \pgfmathfloatadd\first\second
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \let\resultfixed=\pgfmathresult
+ \[ \text{pgfmathfloatadd: } \showlowlevelfloatmacro\first + \showlowlevelfloatmacro\second = \showlowlevelfloatmacro\result \; \bigl( #1 + #2 = \resultfixed \bigr). \]
+}%
+\def\testfloatadd#1#2{%
+ \testfloataddnonsymmetric{#1}{#2}%
+ \testfloataddnonsymmetric{#2}{#1}%
+}%
+
+\testfloatadd{1}{100}
+\testfloatadd{100}{100}
+\testfloatadd{1}{2}
+\testfloatadd{1}{0}
+\testfloatadd{9.999999}{0}
+\testfloatadd{9.9999}{0.0001}
+\testfloatadd{9.9999e-5}{0.0001e-5}
+\testfloatadd{1e6}{1e5}
+\testfloatadd{1e6}{1e3}
+\testfloatadd{1e6}{1}
+\testfloatadd{1e6}{0.1}
+
+\testfloatadd{1}{-100}
+\testfloatadd{100}{-100}
+\testfloatadd{1}{-2}
+\testfloatadd{1e6}{-1e5}
+\testfloatadd{1e6}{-1e3}
+\testfloatadd{1e6}{-1}
+\testfloatadd{1e6}{-0.1}
+
+\testfloatadd{1e-3}{0}
+
+\testfloatadd{inf}{0}
+\testfloatadd{inf}{5}
+\testfloatadd{nan}{5}
+\testfloatadd{0}{0}
+\testfloatadd{-inf}{inf}
+\testfloatadd{-inf}{40}
+\endgroup
+
+\begingroup
+\testsection{testing pgfmathfloatmultiplyfixed}
+\def\testfloatmultiplyfixed#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\first=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \pgfmathfloattofixed\pgfmathresult
+ \let\second=\pgfmathresult
+ \message{computing #1 * #2; \first * \second}%
+ \pgfmathfloatmultiplyfixed\first\second
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \let\resultfixed=\pgfmathresult
+ \[ \text{pgfmathfloatmultiplyfixed: } \showlowlevelfloatmacro\first \cdot \second = \showlowlevelfloatmacro\result \; \bigl( #1 \cdot #2 = \resultfixed \bigr). \]
+}%
+
+\testfloatmultiplyfixed{1}{100}
+\testfloatmultiplyfixed{100}{100}
+\testfloatmultiplyfixed{1}{2}
+\testfloatmultiplyfixed{5}{2}
+\testfloatmultiplyfixed{5e4}{10}
+\testfloatmultiplyfixed{1}{0}
+\testfloatmultiplyfixed{9.999999}{0}
+\testfloatmultiplyfixed{9.9999}{0.0001}
+\testfloatmultiplyfixed{9.9999e-5}{0.001}
+\testfloatmultiplyfixed{1e6}{4}
+\testfloatmultiplyfixed{1e6}{100}
+\testfloatmultiplyfixed{1e6}{1}
+\testfloatmultiplyfixed{1e6}{0.1}
+
+\testfloatmultiplyfixed{1}{-100}
+\testfloatmultiplyfixed{100}{-100}
+\testfloatmultiplyfixed{1}{-2}
+\testfloatmultiplyfixed{1e6}{-9}
+\testfloatmultiplyfixed{1e6}{-100}
+\testfloatmultiplyfixed{1e6}{-1}
+\testfloatmultiplyfixed{1e6}{-0.1}
+
+\testfloatmultiplyfixed{1e-3}{0}
+
+\testfloatmultiplyfixed{inf}{0}
+\testfloatmultiplyfixed{inf}{5}
+\testfloatmultiplyfixed{nan}{5}
+\testfloatmultiplyfixed{0}{0}
+\testfloatmultiplyfixed{-inf}{40}
+\endgroup
+
+
+\testsection{testing pgfmathfloatlessthan}
+\def\testfloatlessthan#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\first=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\second=\pgfmathresult
+ \message{checking #1 <= #2; \first <= \second}%
+ \pgfmathfloatlessthan\first\second
+ \ifpgfmathfloatcomparison
+ \def\result{<}%
+ \else
+ \def\result{\ge}%
+ \fi
+ \[ \text{pgfmathfloatlessthan: } \bigl( \showlowlevelfloatmacro\first \bigr)\; = #1 \result #2\; \bigl( = \showlowlevelfloatmacro\second \big). \]
+}%
+
+\testfloatlessthan{4}{5}
+\testfloatlessthan{0}{2}
+\testfloatlessthan{91751123}{241924}
+\testfloatlessthan{-1}{-1}
+\testfloatlessthan{-1231}{0}
+\testfloatlessthan{10}{-5}
+\testfloatlessthan{0}{0}
+\testfloatlessthan{-0}{-0}
+\testfloatlessthan{0}{14}
+\testfloatlessthan{114812}{-123124123}
+\testfloatlessthan{114812}{1241231451}
+\testfloatlessthan{-141285}{29}
+\testfloatlessthan{-141285}{0}
+\testfloatlessthan{-141285}{-50}
+\testfloatlessthan{-141285}{-12498149012}
+
+\testsection{float to fixed test}
+\def\testpgfmathfloattofixed#1{%
+ \pgfmathfloatparsenumber{#1}%
+%\tracingmacros=2\tracingcommands=2
+ \let\argument=\pgfmathresult
+ \message{converting #1 = \argument\ to fixed point}%
+ \pgfmathfloattofixed\argument
+ \let\result=\pgfmathresult
+ \message{-> \result}%
+%\tracingmacros=0\tracingcommands=0
+ \[ \bigl( \showlowlevelfloatmacro\argument \bigr)\; = #1 \mapsto \result \]
+}%
+\testpgfmathfloattofixed{0}
+\testpgfmathfloattofixed{5}
+\testpgfmathfloattofixed{5.520241}
+\testpgfmathfloattofixed{124.10241}
+\testpgfmathfloattofixed{-121.248}
+\testpgfmathfloattofixed{-12e-5}
+\testpgfmathfloattofixed{412e3}
+\testpgfmathfloattofixed{0.0001}
+\testpgfmathfloattofixed{0.0}
+\testpgfmathfloattofixed{-0.012125}
+\testpgfmathfloattofixed{1.2e-1}
+\testpgfmathfloattofixed{1.2e-2}
+\testpgfmathfloattofixed{1.2e4}
+\testpgfmathfloattofixed{1.2345e4}
+\testpgfmathfloattofixed{1.234567e4}
+\testpgfmathfloattofixed{1.51234e0}
+\testpgfmathfloattofixed{15}
+\testpgfmathfloattofixed{-20}
+
+\testsection{Testing pgfmathfloatmin and pgfmathfloatmax}
+\def\testfloatminmax#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\first=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\second=\pgfmathresult
+%\tracingmacros=2\tracingcommands=2
+ \message{computing min/max #1 and #2}%
+ \pgfmathfloatmin\first\second
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \[ \min\{#1,#2\} = \min\{ \showlowlevelfloatmacro\first, \showlowlevelfloatmacro\second \} \; = \showlowlevelfloatmacro\result = \pgfmathresult \]
+ %
+ \pgfmathfloatmax\first\second
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \[ \max\{#1,#2\} = \max\{ \showlowlevelfloatmacro\first, \showlowlevelfloatmacro\second \} \; = \showlowlevelfloatmacro\result = \pgfmathresult \]
+}%
+\testfloatminmax{42}{56}
+\testfloatminmax{-4122}{1256}
+\testfloatminmax{1e12}{5.235412e24}
+\testfloatminmax{-12}{-145}
+
+\testsection{Testing pgfmathfloatshift}
+\def\pgfmathfloatshifttest#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argument=\pgfmathresult
+ \message{computing mathshift #1 by #2}%
+ \pgfmathfloatshift\argument{#2}%
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \[ #1 \cdot 10^{#2} = \showlowlevelfloatmacro\argument \cdot 10^{#2} = \showlowlevelfloatmacro\result = \pgfmathresult \]
+}%
+\pgfmathfloatshifttest{4}{1}
+\pgfmathfloatshifttest{4}{2}
+\pgfmathfloatshifttest{4}{-1}
+\pgfmathfloatshifttest{4}{-2}
+\pgfmathfloatshifttest{0}{-2}
+\pgfmathfloatshifttest{1.1415130}{-2}
+\pgfmathfloatshifttest{1.1415130}{5}
+
+\testsection{Testing pgfmathfloatmultiply}
+\begingroup
+\def\pgfmathfloatmultiplytest#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\argumentb=\pgfmathresult
+ \message{computing mathmultiply #1 by #2}%
+ \pgfmathfloatmultiply\argumenta\argumentb%
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \[ #1 \cdot #2 = \showlowlevelfloatmacro\result = \pgfmathresult \]
+}%
+\def\tests{%
+ \pgfmathfloatmultiplytest{4}{1}
+ \pgfmathfloatmultiplytest{4}{2}
+ \pgfmathfloatmultiplytest{4}{-1}
+ \pgfmathfloatmultiplytest{4}{-2}
+ \pgfmathfloatmultiplytest{0}{-2}
+ \pgfmathfloatmultiplytest{1.1415130}{-2}
+ \pgfmathfloatmultiplytest{1.1415130}{5}
+ \pgfmathfloatmultiplytest{10}{10}
+ \pgfmathfloatmultiplytest{100}{100}
+ \pgfmathfloatmultiplytest{9999999}{9999999}
+ gnuplot for $\cdot$: $99999980000001.0$
+ \pgfmathfloatmultiplytest{-10}{10}
+ \pgfmathfloatmultiplytest{-90}{3}
+ \pgfmathfloatmultiplytest{-90}{-3}
+ \pgfmathfloatmultiplytest{-inf}{nan}
+ \pgfmathfloatmultiplytest{-inf}{+inf}
+ \pgfmathfloatmultiplytest{1}{0}
+ \pgfmathfloatmultiplytest{1}{0}
+ \pgfmathfloatmultiplytest{1}{-0}
+ \pgfmathfloatmultiplytest{3.14159265358979}{2}
+}%
+\tests
+
+\testsection{Testing pgfmathfloatdivide}
+
+\def\pgfmathfloatmultiplytest#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\argumentb=\pgfmathresult
+ \message{computing mathdivide #1 by #2}%
+ \pgfmathfloatdivide\argumenta\argumentb%
+ \let\result=\pgfmathresult
+ \pgfmathfloattofixed\result
+ \[ #1 / #2 = \showlowlevelfloatmacro\result = \pgfmathresult \]
+}%
+\tests
+\endgroup
+
+
+{
+\testsection{Testing pgfmathfloatsqrt}
+% #1 : number
+% #2 : the reference, sqrt (#1)
+\def\pgfmathfloatsqrttest#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\reference=\pgfmathresult
+ \message{computing sqrt(#1)}%
+ \pgfmathfloatsqrt\argumenta%
+ \let\resultfloat=\pgfmathresult
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \pgfmathfloatrelerror\resultfloat\reference
+ \pgfmathfloattosci\pgfmathresult
+ \[ \sqrt{#1} = \result\quad (\text{rel. error } \pgfmathresult)\]
+}%
+\def\tests{%
+ \pgfmathfloatsqrttest{0}{0}
+ \pgfmathfloatsqrttest{1}{1}
+ \pgfmathfloatsqrttest{2}{1.414213562373}
+ \pgfmathfloatsqrttest{4}{2}
+ \pgfmathfloatsqrttest{16}{4}
+ \pgfmathfloatsqrttest{10}{3.162277660168}
+ \pgfmathfloatsqrttest{1000000}{1000}
+ \pgfmathfloatsqrttest{123456789}{1.111111106055556e+04}
+}%
+\tests
+}
+
+{
+\testsection{Testing pgfmathfloatint}
+% #1 : number
+\def\pgfmathfloatinttest#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \message{computing int(#1)}%
+ \pgfmathfloatint\argumenta%
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \[ int(#1) = \result \]
+ %
+ \pgfmathfloatparsenumber{-#1}%
+ \let\argumenta=\pgfmathresult
+ \message{computing int(-#1)}%
+ \pgfmathfloatint\argumenta%
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \[ int(-#1) = \result \]
+}%
+\def\tests{%
+ \pgfmathfloatinttest{1.23}
+ \pgfmathfloatinttest{12.34}
+ \pgfmathfloatinttest{123.4}
+ \pgfmathfloatinttest{1234.}
+ \pgfmathfloatinttest{1234.1}
+ \pgfmathfloatinttest{1e-2}
+ \pgfmathfloatinttest{0}
+ \pgfmathfloatinttest{3.456789e4}
+ \pgfmathfloatinttest{3.456789e10}
+}%
+\tests
+}
+
+{
+\testsection{Testing pgfmathfloatexp}
+% #1 : number
+% #2 : the reference, sqrt (#1)
+\def\pgfmathfloattest#1#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\reference=\pgfmathresult
+ \message{computing (#1)}%
+ \pgfmathfloatexp\argumenta%
+ \let\resultfloat=\pgfmathresult
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \pgfmathfloatrelerror\resultfloat\reference
+ \pgfmathfloattosci\pgfmathresult
+ \[ \exp(#1) = \result\quad (\text{error/r to }#2 = \pgfmathresult)\]
+}%
+%\tracingmacros=2\tracingcommands=2
+ \pgfmathfloattest{-700}{9.85967654375977e-305}
+ \pgfmathfloattest{-1.0000000e+02}{3.7200760e-44}
+ \pgfmathfloattest{-9.5918367e+01}{2.2038516e-42}
+ \pgfmathfloattest{-9.1836735e+01}{1.3056083e-40}
+ \pgfmathfloattest{-8.7755102e+01}{7.7346991e-39}
+ \pgfmathfloattest{-8.3673469e+01}{4.5821992e-37}
+ \pgfmathfloattest{-7.9591837e+01}{2.7145916e-35}
+ \pgfmathfloattest{-7.5510204e+01}{1.6081814e-33}
+ \pgfmathfloattest{-7.1428571e+01}{9.5272065e-32}
+ \pgfmathfloattest{-6.7346939e+01}{5.6441184e-30}
+ \pgfmathfloattest{-6.3265306e+01}{3.3436950e-28}
+ \pgfmathfloattest{-5.9183673e+01}{1.9808756e-26}
+ \pgfmathfloattest{-5.5102041e+01}{1.1735125e-24}
+ \pgfmathfloattest{-5.1020408e+01}{6.9521362e-23}
+ \pgfmathfloattest{-4.6938776e+01}{4.1185924e-21}
+ \pgfmathfloattest{-4.2857143e+01}{2.4399411e-19}
+ \pgfmathfloattest{-3.8775510e+01}{1.4454727e-17}
+ \pgfmathfloattest{-3.4693878e+01}{8.5632855e-16}
+ \pgfmathfloattest{-3.0612245e+01}{5.0730713e-14}
+ \pgfmathfloattest{-2.6530612e+01}{3.0053946e-12}
+ \pgfmathfloattest{-2.2448980e+01}{1.7804593e-10}
+ \pgfmathfloattest{-1.8367347e+01}{1.0547817e-08}
+ \pgfmathfloattest{-1.4285714e+01}{6.2487495e-07}
+ \pgfmathfloattest{-1.0204082e+01}{3.7018912e-05}
+ \pgfmathfloattest{-6.1224490e+00}{2.1930786e-03}
+ \pgfmathfloattest{-2.0408163e+00}{1.2992261e-01}
+ \pgfmathfloattest{2.0408163e+00}{7.6968898e+00}
+ \pgfmathfloattest{6.1224490e+00}{4.5598001e+02}
+ \pgfmathfloattest{1.0204082e+01}{2.7013219e+04}
+ \pgfmathfloattest{1.4285714e+01}{1.6003202e+06}
+ \pgfmathfloattest{1.8367347e+01}{9.4806349e+07}
+ \pgfmathfloattest{2.2448980e+01}{5.6165284e+09}
+ \pgfmathfloattest{2.6530612e+01}{3.3273501e+11}
+ \pgfmathfloattest{3.0612245e+01}{1.9711925e+13}
+ \pgfmathfloattest{3.4693878e+01}{1.1677761e+15}
+ \pgfmathfloattest{3.8775510e+01}{6.9181522e+16}
+ \pgfmathfloattest{4.2857143e+01}{4.0984595e+18}
+ \pgfmathfloattest{4.6938776e+01}{2.4280140e+20}
+ \pgfmathfloattest{5.1020408e+01}{1.4384068e+22}
+ \pgfmathfloattest{5.5102041e+01}{8.5214258e+23}
+ \pgfmathfloattest{5.9183673e+01}{5.0482727e+25}
+ \pgfmathfloattest{6.3265306e+01}{2.9907034e+27}
+ \pgfmathfloattest{6.7346939e+01}{1.7717559e+29}
+ \pgfmathfloattest{7.1428571e+01}{1.0496256e+31}
+ \pgfmathfloattest{7.5510204e+01}{6.2182039e+32}
+ \pgfmathfloattest{7.9591837e+01}{3.6837954e+34}
+ \pgfmathfloattest{8.3673469e+01}{2.1823582e+36}
+ \pgfmathfloattest{8.7755102e+01}{1.2928751e+38}
+ \pgfmathfloattest{9.1836735e+01}{7.6592653e+39}
+ \pgfmathfloattest{9.5918367e+01}{4.5375106e+41}
+ \pgfmathfloattest{1.0000000e+02}{2.6881171e+43}
+ \pgfmathfloattest{700}{1.014232054735e+304}
+}
+
+{
+\testsection{Testing pgfmathfloatmod}
+% #1 : operand 1
+% #2 : operand 2
+% #3 : the reference, #1 mod #2
+\def\pgfmathfloattest#1#2#3{%
+ \pgfmathfloatparsenumber{#1}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\argumentb=\pgfmathresult
+ \pgfmathfloatparsenumber{#3}%
+ \let\reference=\pgfmathresult
+ \message{computing #1 mod #2}%
+ \pgfmathfloatmod\argumenta\argumentb%
+ \let\resultfloat=\pgfmathresult
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \pgfmathfloatrelerror\resultfloat\reference
+ \pgfmathfloattosci\pgfmathresult
+ \[ #1\text{ mod }#2 = \result\quad (\text{error/r to }#3 = \pgfmathresult)\]
+}%
+%\tracingmacros=2\tracingcommands=2
+ \pgfmathfloattest{4}{3}{1}
+ \pgfmathfloattest{10}{10}{0}
+ \pgfmathfloattest{20}{6}{2}
+ \pgfmathfloattest{-100}{30}{-10}
+ \pgfmathfloattest{10.5}{5}{0.5}
+ \pgfmathfloattest{300.63}{360}{300.63}
+ \pgfmathfloattest{-20}{30}{-20}
+}
+
+{
+\testsection{Testing Trigonometric functions}
+% #1 : operator
+% #2 : operand
+% #3 : the reference, #2(#1)
+\def\pgfmathfloattest#1#2#3{%
+ \pgfmathfloatparsenumber{#2}%
+ \let\argumenta=\pgfmathresult
+ \pgfmathfloatparsenumber{#3}%
+ \let\reference=\pgfmathresult
+ \message{computing \string#1(#2)}%
+ #1\argumenta%
+ \let\resultfloat=\pgfmathresult
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \pgfmathfloatrelerror\resultfloat\reference
+ \pgfmathfloattosci\pgfmathresult
+ \[ \string#1(#2) = \result\quad (\text{error/r to }#3 = \pgfmathresult)\]
+}%
+%\tracingmacros=2\tracingcommands=2
+\testsubsection{SIN}
+ \pgfmathfloattest\pgfmathfloatsin{-7.2000000e+02}{4.8985872e-16}
+ \pgfmathfloattest\pgfmathfloatsin{-6.5454545e+02}{9.0963200e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-5.8909091e+02}{7.5574957e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-5.2363636e+02}{-2.8173256e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-4.5818182e+02}{-9.8982144e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-3.9272727e+02}{-5.4064082e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-3.2727273e+02}{5.4064082e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-2.6181818e+02}{9.8982144e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-1.9636364e+02}{2.8173256e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-1.3090909e+02}{-7.5574957e-01}
+ \pgfmathfloattest\pgfmathfloatsin{-6.5454545e+01}{-9.0963200e-01}
+ \pgfmathfloattest\pgfmathfloatsin{0.0000000e+00}{0.0000000e+00}
+ \pgfmathfloattest\pgfmathfloatsin{6.5454545e+01}{9.0963200e-01}
+ \pgfmathfloattest\pgfmathfloatsin{1.3090909e+02}{7.5574957e-01}
+ \pgfmathfloattest\pgfmathfloatsin{1.9636364e+02}{-2.8173256e-01}
+ \pgfmathfloattest\pgfmathfloatsin{2.6181818e+02}{-9.8982144e-01}
+ \pgfmathfloattest\pgfmathfloatsin{3.2727273e+02}{-5.4064082e-01}
+ \pgfmathfloattest\pgfmathfloatsin{3.9272727e+02}{5.4064082e-01}
+ \pgfmathfloattest\pgfmathfloatsin{4.5818182e+02}{9.8982144e-01}
+ \pgfmathfloattest\pgfmathfloatsin{5.2363636e+02}{2.8173256e-01}
+ \pgfmathfloattest\pgfmathfloatsin{5.8909091e+02}{-7.5574957e-01}
+ \pgfmathfloattest\pgfmathfloatsin{6.5454545e+02}{-9.0963200e-01}
+ \pgfmathfloattest\pgfmathfloatsin{7.2000000e+02}{-4.8985872e-16}
+
+
+
+\testsubsection{COS}
+ \pgfmathfloattest\pgfmathfloatcos{-7.2000000e+02}{1.0000000e+00}
+ \pgfmathfloattest\pgfmathfloatcos{-6.5454545e+02}{4.1541501e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-5.8909091e+02}{-6.5486073e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-5.2363636e+02}{-9.5949297e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-4.5818182e+02}{-1.4231484e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-3.9272727e+02}{8.4125353e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-3.2727273e+02}{8.4125353e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-2.6181818e+02}{-1.4231484e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-1.9636364e+02}{-9.5949297e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-1.3090909e+02}{-6.5486073e-01}
+ \pgfmathfloattest\pgfmathfloatcos{-6.5454545e+01}{4.1541501e-01}
+ \pgfmathfloattest\pgfmathfloatcos{0.0000000e+00}{1.0000000e+00}
+ \pgfmathfloattest\pgfmathfloatcos{6.5454545e+01}{4.1541501e-01}
+ \pgfmathfloattest\pgfmathfloatcos{1.3090909e+02}{-6.5486073e-01}
+ \pgfmathfloattest\pgfmathfloatcos{1.9636364e+02}{-9.5949297e-01}
+ \pgfmathfloattest\pgfmathfloatcos{2.6181818e+02}{-1.4231484e-01}
+ \pgfmathfloattest\pgfmathfloatcos{3.2727273e+02}{8.4125353e-01}
+ \pgfmathfloattest\pgfmathfloatcos{3.9272727e+02}{8.4125353e-01}
+ \pgfmathfloattest\pgfmathfloatcos{4.5818182e+02}{-1.4231484e-01}
+ \pgfmathfloattest\pgfmathfloatcos{5.2363636e+02}{-9.5949297e-01}
+ \pgfmathfloattest\pgfmathfloatcos{5.8909091e+02}{-6.5486073e-01}
+ \pgfmathfloattest\pgfmathfloatcos{6.5454545e+02}{4.1541501e-01}
+ \pgfmathfloattest\pgfmathfloatcos{7.2000000e+02}{1.0000000e+00}
+
+
+\testsubsection{TAN}
+ \pgfmathfloattest\pgfmathfloattan{-7.2000000e+02}{4.8985872e-16}
+ \pgfmathfloattest\pgfmathfloattan{-6.5454545e+02}{2.1896946e+00}
+ \pgfmathfloattest\pgfmathfloattan{-5.8909091e+02}{-1.1540615e+00}
+ \pgfmathfloattest\pgfmathfloattan{-5.2363636e+02}{2.9362649e-01}
+ \pgfmathfloattest\pgfmathfloattan{-4.5818182e+02}{6.9551528e+00}
+ \pgfmathfloattest\pgfmathfloattan{-3.9272727e+02}{-6.4266098e-01}
+ \pgfmathfloattest\pgfmathfloattan{-3.2727273e+02}{6.4266098e-01}
+ \pgfmathfloattest\pgfmathfloattan{-2.6181818e+02}{-6.9551528e+00}
+ \pgfmathfloattest\pgfmathfloattan{-1.9636364e+02}{-2.9362649e-01}
+ \pgfmathfloattest\pgfmathfloattan{-1.3090909e+02}{1.1540615e+00}
+ \pgfmathfloattest\pgfmathfloattan{-6.5454545e+01}{-2.1896946e+00}
+ \pgfmathfloattest\pgfmathfloattan{0.0000000e+00}{0.0000000e+00}
+ \pgfmathfloattest\pgfmathfloattan{6.5454545e+01}{2.1896946e+00}
+ \pgfmathfloattest\pgfmathfloattan{1.3090909e+02}{-1.1540615e+00}
+ \pgfmathfloattest\pgfmathfloattan{1.9636364e+02}{2.9362649e-01}
+ \pgfmathfloattest\pgfmathfloattan{2.6181818e+02}{6.9551528e+00}
+ \pgfmathfloattest\pgfmathfloattan{3.2727273e+02}{-6.4266098e-01}
+ \pgfmathfloattest\pgfmathfloattan{3.9272727e+02}{6.4266098e-01}
+ \pgfmathfloattest\pgfmathfloattan{4.5818182e+02}{-6.9551528e+00}
+ \pgfmathfloattest\pgfmathfloattan{5.2363636e+02}{-2.9362649e-01}
+ \pgfmathfloattest\pgfmathfloattan{5.8909091e+02}{1.1540615e+00}
+ \pgfmathfloattest\pgfmathfloattan{6.5454545e+02}{-2.1896946e+00}
+ \pgfmathfloattest\pgfmathfloattan{7.2000000e+02}{-4.8985872e-16}
+
+
+
+}
+
+{
+\testsection{Testing the FPU library (and math parser)}
+\pgfkeys{/pgf/fpu}
+% #1 : expression
+% #2 : the reference
+\def\pgfmathfloattest#1#2{%
+ \pgfmathfloatparsenumber{#2}%
+ \let\reference=\pgfmathresult
+ \message{parsing expression #1...}%
+ \pgfmathparse{#1}%
+ \let\argumenta=\pgfmathresult
+ \let\resultfloat=\pgfmathresult
+ \pgfmathfloattosci\pgfmathresult
+ \let\result=\pgfmathresult
+ \pgfmathfloatrelerror\resultfloat\reference
+ \pgfmathfloattosci\pgfmathresult
+ \[ #1 = \result \quad[= \resultfloat] \quad (\text{error/r to }#2 = \pgfmathresult)\]
+}%
+%\tracingmacros=2\tracingcommands=2
+
+ \pgfmathfloattest{1+1}{2}
+ \pgfmathfloattest{1234567*4}{4938268}
+ \pgfmathfloattest{exp(200)}{7.22597376812575e+86}
+ \pgfmathfloattest{rad(360)}{6.28318530717959}
+ \pgfmathfloattest{rad(180)}{3.14159265358979}
+ \pgfmathfloattest{deg(2*pi)}{360}
+ \pgfmathfloattest{deg(pi)}{180}
+ \pgfmathfloattest{ln(1)}{0}
+ \pgfmathfloattest{round(1.5)}{2}
+ \pgfmathfloattest{round(-1.5)}{-2}
+ \pgfmathfloattest{- (1.5)}{-1.5}
+ \pgfmathfloattest{(1e4 - 1e3) * 1e5}{900000000.0}
+ \pgfmathfloattest{4^2}{16}
+ \pgfmathfloattest{4^3}{64}
+ \pgfmathfloattest{4^-3}{0.015625}
+ \pgfmathfloattest{4^-6}{0.000244140625}
+ \pgfmathfloattest{111^4}{151807041}
+ \pgfmathfloattest{8^10}{1073741824}
+ \pgfmathfloattest{3^1.5}{5.19615242270663}
+ \pgfmathfloattest{16^5.5}{4194304}
+ \pgfmathfloattest{15^-0.25}{0.508132748154615}
+ \pgfmathfloattest{sec(45)}{1.4142136e+00}
+ \pgfmathfloattest{cot(30)}{1.7320508e+00}
+ \pgfmathfloattest{asin(7.0710678e-01)}{45}
+ \pgfmathfloattest{acos(8.6602540e-01)}{30}
+ \pgfmathfloattest{atan(5.7735027e-01)}{30}
+ \pgfmathfloattest{atan(16000)}{89.9964}
+ \pgfmathfloattest{atan(1e6)}{8.9999943e+01}
+ \pgfmathfloattest{atan(-1e6)}{-8.9999943e+01}
+ \pgfmathfloattest{-12^2}{-144}%
+ \pgfmathfloattest{0-12^2}{-144}%
+ \pgfmathfloattest{-(12)^2}{-144}%
+ \pgfmathfloattest{exp(-12^2)}{2.8946e-63}%
+ \pgfmathfloattest{round(98.8)}{99}%
+ \pgfmathfloattest{-pi}{-3.14159265358979}%
+ \pgfmathfloattest{2*(-pi)}{-6.28318530717959}%
+ \pgfmathfloattest{2*(-3)}{-6}%
+ \pgfmathfloattest{veclen(1,1)}{1.414213562373095}%
+ \pgfmathfloattest{veclen(1e5,6e5)}{6.082762530298220e+05}%
+ \pgfmathfloattest{cosh(5)}{74.20994852478784}%
+ \pgfmathfloattest{sinh(0.6)}{0.636653582148241}%
+ \pgfmathfloattest{tanh(0.6)}{0.537049566998035}%
+% \pgfmathfloattest{ceil(1.5)}{2}
+}
+\end{document}
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgf.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgf.tex
index eab81dec5b4..eab81dec5b4 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgf.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgf.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbim.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbim.tex
index 7e1cad0623f..7e1cad0623f 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbim.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbim.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbla.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbla.tex
index 982d83e4d58..982d83e4d58 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbla.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbla.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbma.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbma.tex
index a326d049025..a326d049025 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbma.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbma.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpl.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpl.tex
index be25da0217d..be25da0217d 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpl.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpl.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpt.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpt.tex
index ce33b46c67d..ce33b46c67d 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbpt.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbpt.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsh.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsh.tex
index e7d83ce0c41..e7d83ce0c41 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsh.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsh.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsn.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsn.tex
index 037108b1d69..037108b1d69 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfbsn.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfbsn.tex
diff --git a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfcor.tex b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfcor.tex
index 6b4eab5c212..172019d86da 100644
--- a/Master/texmf-dist/tex/context/pgf/basiclayer/t-pgfcor.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/basiclayer/t-pgfcor.tex
@@ -23,6 +23,7 @@
\catcode`\|=12
\catcode`\!=12
+
\input pgfcore.code.tex
\catcode`\@=\pgfcoreatcode
@@ -49,4 +50,4 @@
\fi
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/context/pgf/frontendlayer/t-tikz.tex b/Master/texmf-dist/tex/context/third/pgf/frontendlayer/t-tikz.tex
index d3fc269d385..d3fc269d385 100644
--- a/Master/texmf-dist/tex/context/pgf/frontendlayer/t-tikz.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/frontendlayer/t-tikz.tex
diff --git a/Master/texmf-dist/tex/context/pgf/math/t-pgfmat.tex b/Master/texmf-dist/tex/context/third/pgf/math/t-pgfmat.tex
index 45fc7606906..45fc7606906 100644
--- a/Master/texmf-dist/tex/context/pgf/math/t-pgfmat.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/math/t-pgfmat.tex
diff --git a/Master/texmf-dist/tex/context/pgf/systemlayer/t-pgfsys.tex b/Master/texmf-dist/tex/context/third/pgf/systemlayer/t-pgfsys.tex
index 8b2453b094f..8b2453b094f 100644
--- a/Master/texmf-dist/tex/context/pgf/systemlayer/t-pgfsys.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/systemlayer/t-pgfsys.tex
diff --git a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfcal.tex b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfcal.tex
index 693a3826fee..8d74ee6db5a 100644
--- a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfcal.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfcal.tex
@@ -26,4 +26,4 @@
\fi
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/context/pgf/utilities/t-pgffor.tex b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgffor.tex
index 0cfe2d94132..8fea962d972 100644
--- a/Master/texmf-dist/tex/context/pgf/utilities/t-pgffor.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgffor.tex
@@ -13,6 +13,7 @@
\let\pgffordefined=\relax
\input t-pgfrcs.tex
+\input t-pgfkey.tex
\edef\pgfforatcode{\the\catcode`\@}
\edef\pgfforbarcode{\the\catcode`\|}
diff --git a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfkey.tex b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfkey.tex
index dbc393a8276..dbc393a8276 100644
--- a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfkey.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfkey.tex
diff --git a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfmod.tex b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfmod.tex
index ab7b456f5c7..ab7b456f5c7 100644
--- a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfmod.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfmod.tex
diff --git a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfrcs.tex b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfrcs.tex
index a0a12dd47be..a0a12dd47be 100644
--- a/Master/texmf-dist/tex/context/pgf/utilities/t-pgfrcs.tex
+++ b/Master/texmf-dist/tex/context/third/pgf/utilities/t-pgfrcs.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
index b76772cc4ac..8a7ab4a2862 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.6 2008/01/15 10:27:34 tantau Exp $
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.7 2010/04/11 07:09:19 ludewich Exp $
\newif\ifpgf@draftmode
@@ -29,4 +29,7 @@
\input pgfcoretransparency.code.tex
\input pgfcorepatterns.code.tex
+\pgfutil@ifundefined{pgf@texdist@protect}{%
+ \def\pgf@texdist@protect{}%
+}{}
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
index bdf4906c1be..19e73e0b44e 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.8 2007/06/07 07:41:10 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.11 2008/04/23 14:59:01 tantau Exp $
% Sets the end arrow
@@ -89,7 +89,7 @@
% Called when an arrow needs to be rendered
\def\pgf@arrow@call#1{%
- \expandafter\ifx\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname\relax%
+ \expandafter\ifx\csname\pgf@arrow@full@name{#1}\endcsname\relax%
\pgfsysprotocol@getcurrentprotocol\pgf@arrow@temp%
{%
\pgfinterruptpath%
@@ -105,13 +105,15 @@
\global\let\pgf@@arrow@temp=\pgf@@arrow@temp%
\endpgfinterruptpath%
\expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\pgfsys@invoke\expandafter{\pgf@@arrow@temp}}%
- \expandafter\global\expandafter\let\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname=\pgf@temp%
+ \expandafter\global\expandafter\let\csname\pgf@arrow@full@name{#1}\endcsname=\pgf@temp%
}%
\pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp%
\fi%
- \csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname%
+ \csname\pgf@arrow@full@name{#1}\endcsname%
}
+\def\pgf@arrow@full@name#1{pgf@arrow@prot@#1@\the\pgflinewidth @\pgfinnerlinewidth @\pgfgetarrowoptions{#1}}
+
\def\pgf@arrow@code@{} % dummy
\def\pgf@nousepath@here#1{%
@@ -119,6 +121,41 @@
}
+% Get options for an arrow
+%
+% #1 = arrow tip name
+%
+% Description:
+%
+% For every arrow tip certain options can be set, which may influence
+% the appearance of the arrow tip. How the options are used is up the
+% arrow tip code. This command will expand to the current value of
+% the options for this tip. The default is 0.
+
+\def\pgfgetarrowoptions#1{%
+ \expandafter\ifx\csname pgf@arrow@opt@#1\endcsname\relax0\else\csname pgf@arrow@opt@#1\endcsname\fi%
+}
+
+
+% Set options for an arrow
+%
+% #1 = arrow tip name
+% #2 = options
+%
+% Description:
+%
+% Sets the arrow tip options for an arrow. The options should be a
+% normal string and will be used to detect whether an arrow should be
+% recached. For instance, when you set the arrow tip options of
+% "myarrow" to "1", the arrow will be rendered in a certain way. Then,
+% when you set the options to "2", the arrow will be rerendered.
+
+\def\pgfsetarrowoptions#1#2{%
+ \expandafter\def\csname pgf@arrow@opt@#1\endcsname{#2}%
+}
+
+
+
% Define an arrow type.
%
@@ -374,13 +411,21 @@
\pgfarrowsdeclare{stealth}{stealth}
{
\pgfutil@tempdima=0.28pt%
- \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfutil@tempdimb=\pgflinewidth%
+ \ifdim\pgfinnerlinewidth>0pt%
+ \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}%
+ \fi%
+ \advance\pgfutil@tempdima by.3\pgfutil@tempdimb%
\pgfarrowsleftextend{+-3\pgfutil@tempdima}
\pgfarrowsrightextend{+5\pgfutil@tempdima}
}
{
\pgfutil@tempdima=0.28pt%
- \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfutil@tempdimb=\pgflinewidth%
+ \ifdim\pgfinnerlinewidth>0pt%
+ \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}%
+ \fi%
+ \advance\pgfutil@tempdima by.3\pgfutil@tempdimb%
\pgfpathmoveto{\pgfqpoint{5\pgfutil@tempdima}{0pt}}
\pgfpathlineto{\pgfqpoint{-3\pgfutil@tempdima}{4\pgfutil@tempdima}}
\pgfpathlineto{\pgfpointorigin}
@@ -464,13 +509,21 @@
\pgfarrowsdeclare{latex}{latex}
{
\pgfutil@tempdima=0.28pt%
- \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfutil@tempdimb=\pgflinewidth%
+ \ifdim\pgfinnerlinewidth>0pt%
+ \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}%
+ \fi%
+ \advance\pgfutil@tempdima by.3\pgfutil@tempdimb%
\pgfarrowsleftextend{+-1\pgfutil@tempdima}
\pgfarrowsrightextend{+9\pgfutil@tempdima}
}
{
\pgfutil@tempdima=0.28pt%
- \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfutil@tempdimb=\pgflinewidth%
+ \ifdim\pgfinnerlinewidth>0pt%
+ \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}%
+ \fi%
+ \advance\pgfutil@tempdima by.3\pgfutil@tempdimb%
\pgfpathmoveto{\pgfqpoint{9\pgfutil@tempdima}{0pt}}
\pgfpathcurveto
{\pgfqpoint{6.3333\pgfutil@tempdima}{.5\pgfutil@tempdima}}
@@ -509,5 +562,24 @@
}
+% A space arrow
+%
+% This arrow can be combined with other arrows to add "space" around
+% them.
+%
+% Example:
+%
+% \pgfarrowsdeclarecombine{my<}{my>}{<}{>}{space}{space}
+
+\pgfarrowsdeclare{space}{space}
+{
+ \pgfutil@tempdima=0.88pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfarrowsleftextend{0pt}
+ \pgfarrowsrightextend{\pgfutil@tempdima}
+}
+{}
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
new file mode 100644
index 00000000000..d8eaca5aee7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
@@ -0,0 +1,501 @@
+% Copyright 2006 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.17 2010/09/01 08:56:40 ludewich Exp $
+
+
+
+\newif\ifpgfexternal@aux@in@dpth
+\newif\ifpgfexternal@info
+
+\pgfkeys{
+ /pgf/images/include external/.code={\pgfimage{#1}},
+ /pgf/images/aux in dpth/.is if=pgfexternal@aux@in@dpth,
+ /pgf/images/aux in dpth/.default=true,
+ /pgf/images/trim external/.code n args={4}{%
+ \def\pgf@external@kern@left{#1}%
+ \def\pgf@external@kern@bottom{#2}%
+ \def\pgf@external@kern@right{#3}%
+ \def\pgf@external@kern@top{#4}%
+ \ifx\pgf@external@kern@left\pgfutil@empty\def\pgf@external@kern@left{0sp}\fi%
+ \ifx\pgf@external@kern@bottom\pgfutil@empty\def\pgf@external@kern@bottom{0sp}\fi%
+ \ifx\pgf@external@kern@right\pgfutil@empty\def\pgf@external@kern@right{0sp}\fi%
+ \ifx\pgf@external@kern@top\pgfutil@empty\def\pgf@external@kern@top{0sp}\fi%
+ },
+ /pgf/images/trim external={1truein}{1truein}{1truein}{1truein},
+ /pgf/images/external info/.is if=pgfexternal@info,
+ /pgf/images/external info/.default=true,
+}
+
+% The external read/write mechanism is used as follows:
+%
+% In your document, you put a number or all of your pgfpicture (or
+% tikzpicture) environments inside a pair of \beginpgfexternal and
+% \endpgfexternal. The \beginpgfexternal gets one parameter called the
+% graphics name.
+%
+% Once this is done, the next step is to declare the names of your
+% graphics in the document at the beginning using the
+% \pgfdeclaregraphicname command.
+%
+% Now, when you typeset your document, each time a \beginpgfexternal
+% command is encountered, it will be checked whether the corresponding
+% graphics file exists. If this is the case, it will be included and
+% the code between \beginpgfexternal and \endpgfexternal is
+% ignored. Otherwise, the code is executed normally.
+%
+% Things change when you run tex on your file with the \jobname set to
+% the name of a decalred graphics name. In this case, only your
+% graphic will be typeset, the rest of the document will be "thrown away".
+% To be more precise, everything is gobbled up to the beginning
+% of the first \beginpgfexternal with the given graphics name. Then,
+% the content of the "environment" is put in a box (this "environment"
+% need not contain a graphics, it may contain anything that can be put
+% in a box). Then a single page is output whose size is exactly the
+% size of the picture.
+%
+% So, once you have run tex repeatedly, each time with the jobname set
+% to each of the graphics, you can then run tex on the whole document
+% and this will cause all graphics to be included rather than begin
+% typeset.
+%
+% Finally, once all the graphics have been created, you can also say
+% \input pgfexternal.tex instead of including pgf/TikZ.
+
+
+\newif\ifpgfexternalreadmainaux
+\pgfexternalreadmainauxtrue
+
+% Tells pgf which jobname is the name of the real file
+%
+% #1 = name
+%
+% Description:
+%
+% This command is used to tell pgf that the file named #1 should be
+% typeset normally. If \jobname is not equal to #1, only
+% the graphic called \jobname will be typeset.
+%
+% Example:
+%
+% \pgfrealjobname{survey}
+%
+% Note that afterwards, \jobname will be set to the argument. In our
+% example, \jobname will be 'survey'. This is to accomplish
+% compatibility with aux-file generation.
+
+\def\pgfrealjobname#1{%
+ \global\let\pgfactualjobname=\jobname
+ \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}%
+ \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}%
+ \ifx\pgf@tempa\pgf@tempb%
+ \else%
+ \pgf@external@grabshipouttrue%
+ \pgfexternal@nofiles% see also \pgf@external@init@aux@in@dpth
+ \ifpgfexternalreadmainaux
+ % and reset the jobname. This should allow to handle any
+ % \label/\ref constructions which are stored in \jobname.aux (and
+ % which won't be found otherwise)
+ \gdef\jobname{#1}%
+ \fi
+ \ifpgfexternal@aux@in@dpth
+ \csname newwrite\endcsname\w@pgfexternal@auxout
+ \fi
+ \fi%
+ \gdef\pgfrealjobname##1{}% avoid multiple calls.
+}
+
+\def\pgfexternal@nofiles{%
+ % replace \relax. The \nofiles macros does
+ % \let\makeglossary=\relax
+ % but the glossary.sty calls \renewcommand\makeglossary (which
+ % will fail if \makeglossary=\relax). Stupid, but it works.
+ \let\pgfexternal@nofiles@=\relax
+ \def\relax{\relax}%
+ %
+ % suppress generation of LaTeX .aux, .toc etc files.
+ % generation of these files is not thread-safe.
+ % the \csname \endcsname yields \relax if \nofiles doesn't exist.
+ \csname nofiles\endcsname
+ %
+ \let\relax=\pgfexternal@nofiles@
+}%
+
+\newif\ifpgf@external@grabshipout
+\newbox\pgfexternal@startupbox
+
+\pgfutil@ifundefined{AtBeginDocument}{}{%
+ \AtBeginDocument{%
+ \ifpgf@external@grabshipout%
+ \global\let\pgfexternal@originalshipout=\shipout%
+ \global\def\shipout{\setbox\pgfpic=}%
+ \maxdeadcycles=10000%
+ % Ok, gather everything we have seen up to now in a box. This box
+ % will contain any specials that have been used.
+ {%
+ \output{\global\setbox\pgfexternal@startupbox=\vbox{\csname @begindvi\endcsname\unvbox255}}%
+ \hbox{}\eject%
+ }%
+ \fi%
+ }
+}%
+
+\pgfutil@ifundefined{AtEndDocument}{}{%
+ \AtEndDocument{%
+ \ifpgf@external@grabshipout
+ \pgfutil@ifundefined{pgfexternal@did@a@shipout}{%
+ \pgfexternal@error@no@shipout
+ }{}%
+ \fi
+ }%
+}
+
+% This will be overwritten by the tikz external lib if it is loaded.
+\def\pgfexternal@error@no@shipout{%
+ \PackageError{pgf}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname'. Perhaps there was a typo somewhere? Please check that your document contains '\string\beginpgfgraphicnamed{\pgfactualjobname} ... \string\endpgfgraphicnamed'}%
+}%
+
+
+% "Environment" for an external graphic.
+%
+% #1 = graphic name
+%
+% Example:
+%
+% \beginpgfgraphicnamed{main-graphic2}
+% \begin{tikzpicture}
+% ...
+% \end{tikzpicture}
+% \endpgfgraphicnamed
+
+\def\pgf@externalbegin#1{%
+ % First, check whether we wish to grab this graphic:
+ \let\pgf@next=\pgf@external@normal%
+ \ifpgf@external@grabshipout%
+ \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}%
+ \edef\pgf@tempb{\expandafter\string\csname\pgfactualjobname\endcsname}%
+ \ifx\pgf@tempa\pgf@tempb%
+ \let\pgf@next=\pgf@external@grab%
+ \fi%
+ \fi%
+ \pgf@next{#1}%
+}
+
+
+\AtBeginDocument{
+ \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary
+ \let\endpgfgraphicnamed=\unskip
+}
+
+
+% Normal operation: Include an external graphic instead of the
+% picture, if such an external picture exists.
+\def\pgf@external@normal#1{%
+ \let\pgf@filename=\pgfutil@empty%
+ \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#1}%
+ \ifx\pgf@filename\pgfutil@empty%
+ % Ok, no such image... Just typeset the picture normally.
+ \let\pgf@next=\relax%
+ \else%
+ \let\pgf@next=\pgf@replacepicturebygraphic%
+ \fi%
+ \pgf@next%
+}
+
+\long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{%
+ \expandafter\pgfincludeexternalgraphics\expandafter{\pgf@filename}\unskip
+}
+
+% This is almost the same as \includegraphics{#1}, but it checks
+% whether '#1.dpth' exists. In such case, it restores the boxes depth
+% stored in #1.dpth.
+%
+% Furthermore, the .dpth file may contain .aux related information
+% collected for the external graphics (references). They start after
+% the first line (if any).
+\def\pgfincludeexternalgraphics#1{%
+ \begingroup
+ \pgfexternalreaddpth{#1}%
+ \pgfkeysifdefined{/pgf/images/include external/#1/.@cmd}{%
+ \pgfkeysgetvalue{/pgf/images/include external/#1/.@cmd}\pgf@tempa
+ \pgfkeyslet{/pgf/images/include external/.@cmd}\pgf@tempa
+ }{}%
+ \setbox1=\hbox{\pgfkeysvalueof{/pgf/images/include external/.@cmd}{#1}\pgfeov}%
+ \ifdim\pgfexternaltrimleft=0sp \else \kern\pgfexternaltrimleft\relax \fi
+ \ifdim\pgfexternaldepth=0pt
+ \box1
+ \else
+ \dimen0=\pgfexternaldepth\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \ifdim\pgfexternaltrimright=0sp \else \kern\pgfexternaltrimright\relax \fi
+ \endgroup
+}
+
+% Defines \pgfexternaldepth to be the depth of the external picture
+% '#1' and \pgfexternaltrimleft / \pgfexternaltrimright to be the 'hbaseline' shift.
+%
+%
+% Furthermore, it handles any auxiliary information stored in the
+% .dpth file (it appends it to the main aux file).
+%
+\def\pgfexternalreaddpth#1{%
+ % no \begingroup. Handle that manually:
+ \edef\pgfexternalreaddpth@restore{%
+ \noexpand\endlinechar=\the\endlinechar\space
+ \noexpand\catcode`\noexpand\@=\the\catcode`\@\space
+ }%
+ %
+ \def\pgfexternaldepth{0sp}%
+ \def\pgfexternaltrimleft{0sp}%
+ \def\pgfexternaltrimright{0sp}%
+ \endlinechar=-1 % suppress white space at end
+ \catcode`\@=11
+ \openin\r@pgf@reada=#1.dpth
+ \pgfincludeexternalgraphics@read@dpth
+ %
+ \pgfexternalreaddpth@restore
+}%
+%
+% The .dpth consists of 0-N lines, where each is either a single
+% dimension (the box' depth) or something which belongs to the .aux
+% file (such lines will always start with a macro).
+\def\pgfincludeexternalgraphics@read@dpth{%
+ \ifeof\r@pgf@reada
+ \closein\r@pgf@reada
+ \else
+ \read\r@pgf@reada to\pgfincludeexternalgraphics@auxline
+ \ifx\pgfincludeexternalgraphics@auxline\pgfutil@empty
+ \else
+ \expandafter\pgfincludeexternalgraphics@read@dpth@line\pgfincludeexternalgraphics@auxline\pgfincludeexternalgraphics@read@dpth@line@EOI
+ \fi
+ \expandafter\pgfincludeexternalgraphics@read@dpth
+ \fi
+}%
+
+\def\pgfexternal@restore#1{#1}%
+
+\long\def\pgfincludeexternalgraphics@read@dpth@line@getfirst#1#2\pgfincludeexternalgraphics@read@dpth@line@EOI{%
+ \def\pgf@first{#1}%
+}%
+\long\def\pgfincludeexternalgraphics@read@dpth@line#1\pgfincludeexternalgraphics@read@dpth@line@EOI{%
+ \pgfincludeexternalgraphics@read@dpth@line@getfirst#1\pgfincludeexternalgraphics@read@dpth@line@EOI
+ \expandafter\ifcat\expandafter\noexpand\pgf@first\relax
+ % Ah -- the first token is a control sequence. It belongs to
+ % the .aux file.
+ %
+ \expandafter\ifx\pgf@first\pgfexternal@restore
+ #1%
+ \else
+ % do NOT execute #1! many LaTeX commands don't support it (\label for example)
+ \pgfutil@ifundefined{if@filesw}{%
+ % sorry, .aux file support only for latex
+ }{%
+ % append to main .aux file (for forward references)
+ \if@filesw
+ {%
+ \toks0={#1}%
+ % believe it or not, but the
+ % \def\dpthimport{...}\dpthimport *makes* a
+ % difference! In ensures any occuring `##' characters are properly expanded to `#'.
+ \immediate\write\@auxout{%
+ \noexpand\def\noexpand\dpthimport{\the\toks0}\noexpand\dpthimport}%
+ }%
+ \fi
+ }%
+ \fi
+ \else% it is the depth (which is simply a number for backwards compatibility)
+ \def\pgfexternaldepth{#1}%
+ \fi
+}%
+
+% Stores '#1' (expanded!) into the .dpth file of the currently
+% exported image.
+%
+% This command has only an effect if an image is being exported.
+%
+% The stored contents will be read in the context where
+% /pgf/images/include external is active (i.e. by
+% \pgfexternalreaddpth).
+%
+\def\pgfexternalstorecommand#1{%
+}%
+\def\pgfexternalstorecommand@isexporting#1{%
+ \immediate\write\w@pgfexternal@auxout{\noexpand\pgfexternal@restore{#1}}%
+}%
+
+
+
+% Grab operation: If jobname matches the graphic name, typeset this
+% picture normall.
+% REMARK:
+% this method is also invoked from within the tikz external library.
+\def\pgf@external@grab#1{%
+ \def\pgf@filename{#1}%
+ \ifpgfexternal@aux@in@dpth
+ \begingroup
+ \pgf@external@init@aux@in@dpth
+ \let\G@refundefinedtrue=\pgf@external@grab@refundefinedtrue
+ \fi
+ \gdef\pgf@trimleft@final{0sp}%
+ \gdef\pgf@trimright@final{0sp}%
+ \setbox\pgfpic=\hbox\bgroup\bgroup%
+ \let\endpgfgraphicnamed=\pgf@externalend%
+}
+
+{\catcode`\^=12 \gdef\pgfexternal@hat{^}}
+
+\expandafter\let\expandafter\pgf@external@grab@refundefinedtrue@orig\csname G@refundefinedtrue\endcsname
+
+\def\pgf@external@grab@refundefinedtrue{%
+ \pgf@external@grab@refundefinedtrue@orig
+ \begingroup
+ \def\n{\pgfexternal@hat\pgfexternal@hat J}%
+ \pgfexternalstorecommand{%
+ \noexpand\immediate\noexpand\write16{\pgf@external@grab@refundefinedtrue@warning}%
+ \noexpand\G@refundefinedtrue
+ }%
+ \endgroup
+}%
+\def\pgf@external@grab@refundefinedtrue@warning{%
+ LaTeX Warning: External picture `\pgfactualjobname' contains undefined references\noexpand\on@line.\n
+}%
+
+\let\pgf@external@@protected@write@orig=\protected@write
+\long\def\pgf@external@@protected@write@immediate#1#2#3{%
+ \begingroup
+ \let\pgf@write@=\write
+ \def\write{\noexpand\immediate\pgf@write@}%
+ \pgf@external@@protected@write@orig{#1}{#2}{#3}%
+ \endgroup
+}%
+
+\def\pgf@external@init@aux@in@dpth{%
+ \let\pgfexternalstorecommand=\pgfexternalstorecommand@isexporting
+ %
+ % tell LaTeX to write aux files...
+ \csname @fileswtrue\endcsname
+ % ... but redirect output to the .dpth file!
+ \immediate\openout\w@pgfexternal@auxout=\pgf@filename.dpth
+ \let\@auxout=\w@pgfexternal@auxout
+ % ... and disable the correct page numbers. I can't get that
+ % (because the correct page number is only available in the
+ % shipout routine). Use immediate output:
+ \let\protected@write=\pgf@external@@protected@write@immediate
+}%
+
+\def\pgf@externalend@storeshifts#1{%
+ \immediate\write#1{\the\dp\pgfpic}% store the depth simply as number for backw. compat.
+ \ifx\pgf@trimleft@final\pgfutil@empty\else
+ \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimleft{\pgf@trimleft@final}}}%
+ \fi
+ \ifx\pgf@trimright@final\pgfutil@empty\else
+ \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternaltrimright{\pgf@trimright@final}}}%
+ \fi
+ \ifpgfexternal@info
+ \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternalwidth{\the\wd\pgfpic}}}%
+ \immediate\write#1{\noexpand\pgfexternal@restore{\noexpand\def\noexpand\pgfexternalheight{\the\dimen0}}}%
+ \fi
+}
+% REMARK:
+% this method is also invoked from within the tikz external library.
+\def\pgf@externalend{%
+ \unskip\egroup\egroup%
+ {%
+ \def\pgf@external@trim{0}%
+ \def\pgf@external@store@dpth{0}%
+ %
+ \ifpgf@trim@lowlevel
+ \gdef\pgf@trimleft@final{}%
+ \gdef\pgf@trimright@final{}%
+ \else
+ \ifdim\pgf@trimleft@final=0sp \gdef\pgf@trimleft@final{} \else\def\pgf@external@trim{1}\fi
+ \ifdim\pgf@trimright@final=0sp \gdef\pgf@trimright@final{} \else\def\pgf@external@trim{1}\fi
+ \if1\pgf@external@trim
+ % UNDO the trimming! export to pdf doesn't supported trimmed
+ % bounding boxes (has to do with the mediabox/trimbox etc).
+ % I'll keep the bounding box intact and store the trim information
+ % into the .dpth file.
+ \setbox\pgfpic=\hbox{%
+ \ifx\pgf@trimleft@final\pgfutil@empty\else\kern-\pgf@trimleft@final\fi
+ \box\pgfpic
+ \ifx\pgf@trimright@final\pgfutil@empty\else\kern-\pgf@trimright@final\fi
+ }%
+ \def\pgf@external@store@dpth{1}%
+ \fi
+ \fi
+ %
+ \parindent0pt % leave the space
+% \leftmargin0pt%
+% \rightmargin0pt%
+ \hoffset=0pt % reset to default
+ \voffset=0pt
+ \dimen0\ht\pgfpic%
+ \advance\dimen0\dp\pgfpic%
+ \ifdim\dp\pgfpic=0pt\relax
+ \else% store the picture's depth. Otherwise, it would be lost.
+ \def\pgf@external@store@dpth{1}%
+ \fi
+ \ifpgfexternal@info
+ \def\pgf@external@store@dpth{1}%
+ \fi
+ %
+ \if1\pgf@external@store@dpth
+ \ifpgfexternal@aux@in@dpth
+ \pgf@externalend@storeshifts\@auxout
+ \immediate\closeout\@auxout
+ \else
+ \immediate\openout\pgf@plotwrite=\pgf@filename.dpth
+ \pgf@externalend@storeshifts\pgf@plotwrite
+ \immediate\closeout\pgf@plotwrite
+ \fi
+ \fi
+ \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}%
+ %
+ \setbox0=\vbox{%
+ % I admit that I don't know why there is this kerning:
+ \kern -\pgf@external@kern@top\relax%
+ \hbox{%
+ \kern -\pgf@external@kern@left\relax%
+ \hbox to0pt{%
+ \wd\pgfexternal@startupbox=0pt %
+ \ht\pgfexternal@startupbox=0pt %
+ \dp\pgfexternal@startupbox=0pt %
+ \box\pgfexternal@startupbox%
+ \pgfsys@atbegindocument\hss}%
+ \box\pgfpic%
+ \kern\pgf@external@kern@right\relax%
+ }%
+ \kern\pgf@external@kern@bottom\relax%
+ }%
+ %
+ % compatibility with eso-pic package: \nointerlineskip is not
+ % allowed here, but the eso-pic package uses \nointerlineskip in
+ % its shipout routine.
+ \let\pgfexternal@nointerlineskip@orig=\nointerlineskip
+ \let\nointerlineskip=\pgfexternal@nointerlineskip
+ %
+ \pgfexternal@originalshipout\box0 %
+ \gdef\pgfexternal@did@a@shipout{1}%
+ }%
+ \ifpgfexternal@aux@in@dpth
+ \endgroup
+ \fi
+}
+
+\def\pgfexternal@nointerlineskip{%
+ \ifvmode
+ \pgfexternal@nointerlineskip@orig
+ \else
+ \relax% \nointerlineskip in horizontal mode not allowed. Silently ignore the error message.
+ \fi
+}%
+
+\endinput
+% vi: tabstop=4 shiftwidth=2 expandtab
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
index b3a04e6cad0..eeb6c3e8635 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.8 2007/12/12 16:57:17 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.9 2008/04/22 17:03:26 tantau Exp $
% Globals
@@ -29,6 +29,45 @@
\ignorespaces}
+% Set the inner line width to #1.
+%
+% #1 = new inner line width.
+%
+% Description:
+%
+% The inner line width is the width of a second line that is drawn on
+% top of the main stroked line. If the inner line width is 0pt, no
+% inner line is drawn. The main use of inner lines is for creating
+% "double" lines.
+%
+% Inner lines are not drawn when a path is used for clipping.
+%
+% The inner line width is local to the current TeX group, it is not
+% part of the graphic state.
+%
+% Example:
+%
+% \pgfsetinnerlinewidth{1pt}
+
+\def\pgfsetinnerlinewidth#1{%
+ \pgfmathsetlength\pgf@x{#1}%
+ \edef\pgfinnerlinewidth{\the\pgf@x}%
+}
+\def\pgfinnerlinewidth{0pt}
+
+
+% Set the inner line color to #1.
+%
+% #1 = color for the inner line
+%
+% Example:
+%
+% \pgfsetinnerlinecolor{green} % yikes!
+
+\def\pgfsetinnerstrokecolor#1{\def\pgfinnerstrokecolor{#1}}
+\def\pgfinnerstrokecolor{white}
+
+
% Set the miter limit to #1.
%
% #1 = new miter limit factor.
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
index d74d3d1f84f..59a3699f70d 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.16 2010/03/25 20:57:13 ludewich Exp $
@@ -47,10 +47,10 @@
\PackageWarning{pgf}%
{File "#3" not found when defining image "#2".\MessageBreak
Tried all extensions in "\pgfsys@imagesuffixlist"}%
- \pgf@declaredraftimage{#2}%
+ \pgf@declaredraftimage{#2}{#3}%
\else%
\ifpgf@draftmode%
- \pgf@declaredraftimage{#2}%
+ \pgf@declaredraftimage{#2}{#3}%
\else%
\pgfsys@defineimage%
\fi%
@@ -58,10 +58,14 @@
\expandafter\global\expandafter\let\csname pgf@image@#2!\endcsname=\pgf@image%
}
+
+\pgfkeys{
+ /pgf/images/draft/.is if=pgf@draftmode,
+ /pgf/images/draft/.default=true}
\pgfkeys{/pgf/images/width/.estore in=\pgf@imagewidth}
\pgfkeys{/pgf/images/height/.estore in=\pgf@imageheight}
\pgfkeys{/pgf/images/page/.estore in=\pgf@imagepage}
-\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{/Interpolate #1},.default=true}
+\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{#1},.default=true}
\pgfkeys{/pgf/images/mask/.code=%
{%
\edef\pgf@imagemask{#1}%
@@ -71,10 +75,6 @@
{\PackageError{pgf}{Undefined mask "#1".}{}%
\edef\pgf@imagemask{}}%
{\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}%
- \ifx\pgf@imagemask\pgfutil@empty%
- \else
- \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}%
- \fi%
}%
\fi%
}}
@@ -88,13 +88,15 @@
\pgf@findfile#2+{#3}%
\fi}}
-\def\pgf@declaredraftimage#1{%
+% #1: image name
+% #2: file name
+\def\pgf@declaredraftimage#1#2{%
\ifx\pgf@imagewidth\pgfutil@empty%
- \PackageWarning{pgf}{Missing width for image "#1" in draft mode.\MessageBreak Using 1cm instead}%
+ \PackageWarning{pgf}{Missing width for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}%
\edef\pgf@imagewidth{1cm}%
\fi%
\ifx\pgf@imageheight\pgfutil@empty%
- \PackageWarning{pgf}{Missing height for image "#1" in draft mode.\MessageBreak Using 1cm instead}%
+ \PackageWarning{pgf}{Missing height for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}%
\edef\pgf@imageheight{1cm}%
\fi%
\ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi%
@@ -103,7 +105,7 @@
\vrule\kern-0.4pt%
\vbox to \pgf@imageheight{%
\hrule\vfil%
- \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\tiny#1\pgf@imagepage\hfil\hskip-10cm}%
+ \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\tiny#2\pgf@imagepage\hfil\hskip-10cm}%
\vfil\hrule}%
\kern-0.4pt\vrule}%
}%
@@ -143,7 +145,7 @@
{File "#3" not found when defining mask "#2".\MessageBreak
Tried all extensions in "\pgfsys@imagesuffixlist"}%
\else%
- \pgfsys@definemask%
+ \pgfsys@definemask{#2}%
\fi%
\expandafter\global\expandafter\let\csname pgf@mask@#2\endcsname=\pgf@mask%
}
@@ -236,173 +238,6 @@
\pgfuseimage{pgflastimage}}
-
-
-
-
-
-
-% The external read/write mechanism is used as follows:
-%
-% In your document, you put a number or all of your pgfpicture (or
-% tikzpicture) environments inside a pair of \beginpgfexternal and
-% \endpgfexternal. The \beginpgfexternal gets one parameter called the
-% graphics name.
-%
-% Once this is done, the next step is to declare the names of your
-% graphics in the document at the beginning using the
-% \pgfdeclaregraphicname command.
-%
-% Now, when you typeset your document, each time a \beginpgfexternal
-% command is encountered, it will be checked whether the corresponding
-% graphics file exists. If this is the case, it will be included and
-% the code between \beginpgfexternal and \endpgfexternal is
-% ignored. Otherwise, the code is executed normally.
-%
-% Things change when you run tex on your file with the \jobname set to
-% the name of a decalred graphics name. In this case, only your
-% graphic will be typeset, the rest of the document will be "thrown away".
-% To be more precise, everything is gobbled up to the beginning
-% of the first \beginpgfexternal with the given graphics name. Then,
-% the content of the "environment" is put in a box (this "environment"
-% need not contain a graphics, it may contain anything that can be put
-% in a box). Then a single page is output whose size is exactly the
-% size of the picture.
-%
-% So, once you have run tex repeatedly, each time with the jobname set
-% to each of the graphics, you can then run tex on the whole document
-% and this will cause all graphics to be included rather than begin
-% typeset.
-%
-% Finally, once all the graphics have been created, you can also say
-% \input pgfexternal.tex instead of including pgf/TikZ.
-
-
-
-% Tells pgf which jobname is the name of the real file
-%
-% #1 = name
-%
-% Description:
-%
-% This command is used to tell pgf that the file named #1 should be
-% typeset normally. If \jobname is not equal to #1, only
-% the graphic called \jobname will be typeset.
-%
-% Example:
-%
-% \pgfrealjobname{survey}
-
-\def\pgfrealjobname#1{%
- \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}%
- \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}%
- \ifx\pgf@tempa\pgf@tempb%
- \else%
- \pgf@external@grabshipouttrue%
- \fi%
-}
-
-
-\newif\ifpgf@external@grabshipout
-\newbox\pgfexternal@startupbox
-
-\AtBeginDocument{%
- \ifpgf@external@grabshipout%
- \global\let\pgfexternal@originalshipout=\shipout%
- \global\def\shipout{\setbox\pgfpic=}%
- \maxdeadcycles=10000%
- % Ok, gather everything we have seen up to now in a box. This box
- % will contain any specials that have been used.
- {%
- \output{\global\setbox\pgfexternal@startupbox=\vbox{\csname @begindvi\endcsname\unvbox255}}%
- \hbox{}\eject%
- }%
- \fi%
-}
-
-
-% "Environment" for an external graphic.
-%
-% #1 = graphic name
-%
-% Example:
-%
-% \beginpgfgraphicnamed{main-graphic2}
-% \begin{tikzpicture}
-% ...
-% \end{tikzpicture}
-% \endpgfgraphicnamed
-
-\def\pgf@externalbegin#1{%
- % First, check whether we wish to grab this graphic:
- \let\pgf@next=\pgf@external@normal%
- \ifpgf@external@grabshipout%
- \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}%
- \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}%
- \ifx\pgf@tempa\pgf@tempb%
- \let\pgf@next=\pgf@external@grab%
- \fi%
- \fi%
- \pgf@next{#1}%
-}
-
-
-\AtBeginDocument{
- \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary
- \let\endpgfgraphicnamed=\unskip
-}
-
-
-% Normal operation: Include an external graphic instead of the
-% picture, if such an external picture exists.
-\def\pgf@external@normal#1{%
- \let\pgf@filename=\pgfutil@empty%
- \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#1}%
- \ifx\pgf@filename\pgfutil@empty%
- % Ok, no such image... Just typeset the picture normally.
- \let\pgf@next=\relax%
- \else%
- \let\pgf@next=\pgf@replacepicturebygraphic%
- \fi%
- \pgf@next%
-}
-
-\long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{\includegraphics{\pgf@filename}\unskip}
-
-
-% Grab operation: If jobname matches the graphic name, typeset this
-% picture normall.
-
-\def\pgf@external@grab#1{%
- \setbox\pgfpic=\hbox\bgroup\bgroup%
- \let\endpgfgraphicnamed=\pgf@externalend%
-}
-
-\def\pgf@externalend{%
- \unskip\egroup\egroup%
- {%
- \parindent0pt%
- \leftmargin0pt%
- \rightmargin0pt%
- \dimen0\ht\pgfpic%
- \advance\dimen0\dp\pgfpic%
- \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}%
- \setbox0=\vbox{%
- \kern -1truein%
- \hbox{%
- \kern -1truein%
- \hbox to0pt{%
- \wd\pgfexternal@startupbox=0pt%
- \ht\pgfexternal@startupbox=0pt%
- \dp\pgfexternal@startupbox=0pt%
- \box\pgfexternal@startupbox%
- \pgfsys@atbegindocument\hss}%
- \box\pgfpic%
- \kern 1truein}%
- \kern1truein}%
- \pgfexternal@originalshipout\box0%
- }%
-}
-
+\input pgfcoreexternal.code.tex
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
index d1e464fb7b7..e18aea0cde9 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.2 2010/08/27 12:51:47 ludewich Exp $
% Creates a new pgf layer
@@ -50,7 +50,7 @@
%
% Note:
%
-% You cannot anything to the ``main'' layer using this command.
+% You cannot add anything to the ``main'' layer using this command.
%
% Example:
%
@@ -59,11 +59,17 @@
% \end{pgfonlayer}
\def\pgfonlayer#1{%
- \expandafter\global\expandafter%
- \setbox\csname pgf@layerbox@#1\endcsname=\hbox to 0pt%
- \bgroup%
- \expandafter\box\csname pgf@layerbox@#1\endcsname%
- \begingroup%
+ \pgfutil@ifundefined{pgf@layerbox@#1}{%
+ \PackageError{pgf}{Sorry, the requested layer '#1' could not be found. Maybe you misspelled it?}{}%
+ \bgroup
+ \begingroup
+ }{%
+ \expandafter\global\expandafter%
+ \setbox\csname pgf@layerbox@#1\endcsname=\hbox to 0pt%
+ \bgroup%
+ \expandafter\box\csname pgf@layerbox@#1\endcsname%
+ \begingroup%
+ }%
}
\def\endpgfonlayer{%
\endgroup%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
index b96d766b081..db62f73b6bf 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
@@ -7,13 +7,14 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.14 2008/02/13 15:10:06 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.24 2010/08/03 12:27:36 ludewich Exp $
\newdimen\pgf@path@lastx
\newdimen\pgf@path@lasty
-
+\let\pgfgetpath=\pgfsyssoftpath@getcurrentpath
+\let\pgfsetpath=\pgfsyssoftpath@setcurrentpath
% Replace corners by arcs.
%
@@ -98,14 +99,14 @@
\ifdim#1>\pgf@picmaxx\global\pgf@picmaxx#1\fi%
\ifdim#2<\pgf@picminy\global\pgf@picminy#2\fi%
\ifdim#2>\pgf@picmaxy\global\pgf@picmaxy#2\fi%
+ \ifpgf@size@hooked%
+ \let\pgf@size@hook@x#1\let\pgf@size@hook@y#2\pgf@path@size@hook%
+ \fi%
\fi%
\ifdim#1<\pgf@pathminx\global\pgf@pathminx#1\fi%
\ifdim#1>\pgf@pathmaxx\global\pgf@pathmaxx#1\fi%
\ifdim#2<\pgf@pathminy\global\pgf@pathminy#2\fi%
\ifdim#2>\pgf@pathmaxy\global\pgf@pathmaxy#2\fi%
- \ifpgf@size@hooked%
- \let\pgf@size@hook@x#1\let\pgf@size@hook@y#2\pgf@path@size@hook%
- \fi%
}
\newif\ifpgf@size@hooked
\let\pgf@path@size@hook=\pgfutil@empty%
@@ -176,7 +177,7 @@
}
-% Append a bezier spline from the current point to #3 with control
+% Append a cubic bezier spline from the current point to #3 with control
% points #1 and #2 to the current path.
%
% #1 = first control point
@@ -185,8 +186,8 @@
%
% Example:
%
-% \pgfpathmoveto{\pgfxy(0,0)}
-% \pgfpathcurveto{\pgfxy(0,1)}{\pgfxy(1,1)}{\pgfxy(1,2)}
+% \pgfpathmoveto{\pgfpointxy{0}{0}}
+% \pgfpathcurveto{\pgfpointxy{0}{1}}{\pgfpointxy{1}{1}}{\pgfpointxy{1}{2}}
% \pgfstroke
\def\pgfpathcurveto#1#2#3{%
@@ -207,6 +208,46 @@
}
+
+% Append a quadratic bezier spline from the current point to #2 with
+% control point #1 to the current path.
+%
+% #1 = control point
+% #2 = end point
+%
+% Example:
+%
+% \pgfpathmoveto{\pgfpointxy{0}{0}}
+% \pgfpathquadraticcurveto{\pgfpointxy{1}{1}}{\pgfpointxy{2}{0}}
+% \pgfstroke
+
+\def\pgfpathquadraticcurveto#1#2{%
+ \pgfpointtransformed{#2}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgfpointtransformed{#1}%
+ \pgf@xc=.6666666\pgf@x%
+ \pgf@yc=.6666666\pgf@y%
+ % compute second control point:
+ \pgf@xa=.33333333\pgf@xb%
+ \pgf@ya=.33333333\pgf@yb%
+ \advance\pgf@xa by\pgf@xc%
+ \advance\pgf@ya by\pgf@yc%
+ \pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
+ % compute first control point
+ \advance\pgf@xc by.3333333\pgf@path@lastx%
+ \advance\pgf@yc by.3333333\pgf@path@lasty%
+ \pgf@protocolsizes{\pgf@xc}{\pgf@yc}%
+ \pgf@roundcornerifneeded%
+ \pgfsyssoftpath@curveto{\the\pgf@xc}{\the\pgf@yc}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}%
+ \global\pgf@path@lastx=\pgf@xb%
+ \global\pgf@path@lasty=\pgf@yb%
+}
+
+
+
+
% Append an arc to the current point, where the current point is at
% angle #1 and the end is at angle #2. If #2 > #1, the arc is drawn
% counter-clockwise, otherwise it is clockwise.
@@ -233,19 +274,6 @@
\fi%
\pgf@arc@local@angle@a=\pgf@temp@a pt%
\pgf@arc@local@angle@b=\pgf@temp@b pt%
- \relax%
- \ifdim\pgf@arc@local@angle@a>360pt\relax%
- \advance\pgf@arc@local@angle@a by-360pt\relax%
- \fi%
- \ifdim\pgf@arc@local@angle@a<-360pt\relax%
- \advance\pgf@arc@local@angle@a by360pt\relax%
- \fi%
- \ifdim\pgf@arc@local@angle@b>360pt\relax%
- \advance\pgf@arc@local@angle@b by-360pt\relax%
- \fi%
- \ifdim\pgf@arc@local@angle@b<-360pt\relax%
- \advance\pgf@arc@local@angle@b by360pt\relax%
- \fi%
\loop%
\pgfutil@tempdima=\pgf@arc@local@angle@a%
\advance\pgfutil@tempdima by-\pgf@arc@local@angle@b\relax%
@@ -292,40 +320,22 @@
\def\pgf@arc{%
{%
- % \pgfmathsetlength{\pgfutil@tempdima}{#3}%
- % \pgfmathsetlength{\pgfutil@tempdimb}{#4}%
\pgfutil@tempdima=\pgf@arc@radius@a pt%
\pgfutil@tempdimb=\pgf@arc@radius@b pt%
%
\pgf@xa=\pgf@arc@local@angle@a\relax%
\pgf@xb=\pgf@arc@local@angle@b\relax%
- % \pgfutil@tempcnta=#1\relax%
- % \pgfutil@tempcntb=#2\relax%
\advance\pgf@xb by-\pgf@xa\relax%
\ifdim\pgf@xb<0pt\relax%
\pgf@xb=-\pgf@xb\relax%
\fi%
- \ifdim\pgf@xb>85pt\relax% hackery to correct the control points
- \pgfutil@tempdima=0.0555\pgfutil@tempdima\relax%
- \pgfutil@tempdimb=0.0555\pgfutil@tempdimb\relax%
+ \ifdim\pgf@xb=90.0pt%
+ \def\pgfmathresult{0.55228475}%
\else%
- \ifdim\pgf@xb>75pt\relax%
- \pgfutil@tempdima=0.055\pgfutil@tempdima\relax%
- \pgfutil@tempdimb=0.055\pgfutil@tempdimb\relax%
- \else%
- \ifdim\pgf@xb>60pt\relax%
- \pgfutil@tempdima=0.0545\pgfutil@tempdima\relax%
- \pgfutil@tempdimb=0.0545\pgfutil@tempdimb\relax%
- \else%
- \pgfutil@tempdima=0.054\pgfutil@tempdima\relax%
- \pgfutil@tempdimb=0.054\pgfutil@tempdimb\relax%
- \fi%
- \fi%
- \fi
- \pgfutil@tempdima=\pgf@sys@tonumber{\pgf@xb}\pgfutil@tempdima\relax%
- \divide\pgfutil@tempdima by 9\relax%
- \pgfutil@tempdimb=\pgf@sys@tonumber{\pgf@xb}\pgfutil@tempdimb\relax%
- \divide\pgfutil@tempdimb by 9\relax%
+ \pgfmathparse{1.333333333*tan(.25*\pgf@sys@tonumber{\pgf@xb})}% many thanks to Ken Starks
+ \fi%
+ \pgfutil@tempdima=\pgfmathresult\pgfutil@tempdima%
+ \pgfutil@tempdimb=\pgfmathresult\pgfutil@tempdimb%
%.. controls +(\pgf@xa+90:\pgfutil@tempdima) and +(\pgf@xb-90:\pgfutil@tempdima) .. +(-(#1:#3)+(#2:#3))%
% store first support vector in xa/ya:
\pgf@xa=\pgf@arc@local@angle@a\relax%
@@ -373,6 +383,7 @@
}%
}
+
% Append an arc to the current point, where the arc is on an ellipse
% given by two axis vectors.
%
@@ -396,6 +407,466 @@
+% Append an arc to the current point that ends at a given position.
+%
+% #1 = x-radius
+% #2 = y-radius
+% #3 = x-axis-rotation (in degrees)
+% #4 = large-arc-sweep-flag (0 or 1)
+% #5 = sweep-flag (0 or 1)
+% #6 = target point
+%
+% Description:
+%
+% This command implements an arc drawing where a given target
+% coordinate (#6) is given and the task is to draw an arc of an
+% ellipse with the given radii. The center point of the ellipse is not
+% give, but computed automatically.
+%
+% This kind of "endpoint parameterization" of an arc is exactly the
+% same as the one specified by the SVG-specification for the "A" and
+% "a" path commands. Please see the SVG-specification for details.
+%
+% Note that the problem is internally converted to drawing an arc
+% using \pgfpatharc. This means that there may be a heavy loss of
+% accuracy.
+%
+% Example:
+%
+% \pgfpathmoveto{\pgfpoint{1cm}{1cm}}
+% \pgfpatharcto{1cm}{1cm}{0}{0}{0}{\pgfpoint{0cm}{2cm}}
+
+\def\pgfpatharcto#1#2#3#4#5#6{%
+ {%
+ % The following code is based on the transformation described in svg
+ % 1.1 specification Section F.6.5
+ %
+ % Step 1: store the simple parameters (xa=x1 since TeX does not
+ % allow numbers in names)
+ %
+ \pgfmathsetmacro\pgf@arcto@rx{abs(#1)}%
+ \pgfmathsetmacro\pgf@arcto@ry{abs(#2)}%
+ \ifdim\pgf@arcto@rx pt=0pt% special rule: zero radius=straight line
+ \gdef\pgf@marshal{\pgfpathlineto{#6}}%
+ \else
+ \ifdim\pgf@arcto@ry pt=0pt% special rule: zero radius=straight line
+ \gdef\pgf@marshal{\pgfpathlineto{#6}}%
+ \else
+ \pgfmathsetmacro\pgf@arcto@phi{#3}%
+ \pgfmathsetmacro\pgf@arcto@fA{#4}%
+ \ifdim\pgf@arcto@fA pt=0pt
+ \else
+ \pgfmathsetmacro\pgf@arcto@fA{1.0} % Special rule: every non-zero value is 1.
+ \fi
+ \pgfmathsetmacro\pgf@arcto@fS{#5}%
+ \ifdim\pgf@arcto@fS pt=0pt
+ \else
+ \pgfmathsetmacro\pgf@arcto@fS{1.0} % Special rule: every non-zero value is 1.
+ \fi
+ \pgf@process{#6}
+ \edef\pgf@arcto@xb{\the\pgf@x}%
+ \edef\pgf@arcto@yb{\the\pgf@y}%
+ %
+ % Step 2: x1,y1 is more complicated to compute: It is given by lastx
+ % and lasty, but these are transformed coordinates, we need the
+ % untransformed ones. So, we inverse the transformation (arghh...)
+ %
+ \pgftransforminvert%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@path@lastx}{\pgf@path@lasty}}}
+ \edef\pgf@arcto@xa{\the\pgf@x}
+ \edef\pgf@arcto@ya{\the\pgf@y}
+ \edef\pgf@temp@a{\pgf@arcto@xa,\pgf@arcto@ya}
+ \edef\pgf@temp@b{\pgf@arcto@xb,\pgf@arcto@yb}
+ \ifx\pgf@temp@a\pgf@temp@b% special rule: skip!
+ \global\let\pgf@marshal\pgfutil@empty
+ \else
+ %
+ % Ok, now we got all the parameters setup. Now comes the
+ % computation...
+ %
+ %
+ % Step 3: Start with a new coordinate system and rotate everything
+ % by the negated phi.
+ %
+ \pgftransformreset
+ \pgftransformrotate{-\pgf@arcto@phi}
+ % Ok, using \pgfpointtransformed we now get transformed points...
+ %
+ % Step 4: Compute x1' and y1' (xaprime and yaprime)
+ %
+ \pgf@process{
+ \pgfpointtransformed{\pgfpointscale{.5}{\pgfpointdiff
+ {\pgfqpoint{\pgf@arcto@xb}{\pgf@arcto@yb}}
+ {\pgfqpoint{\pgf@arcto@xa}{\pgf@arcto@ya}}
+ }
+ }
+ }
+ \edef\pgf@arcto@xaprime{\pgf@sys@tonumber\pgf@x}
+ \edef\pgf@arcto@yaprime{\pgf@sys@tonumber\pgf@y}
+ %
+ % Compute Lambda
+ %
+ \pgfmathsetmacro\pgf@arcto@frac@x{\pgf@arcto@xaprime/\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@frac@y{\pgf@arcto@yaprime/\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@lambda{
+ \pgf@arcto@frac@x*\pgf@arcto@frac@x+\pgf@arcto@frac@y*\pgf@arcto@frac@y
+ }
+ \ifdim\pgf@arcto@lambda pt>1pt%
+ \pgfmathsetmacro\pgf@arcto@sqrt@lambda{sqrt(\pgf@arcto@lambda)}
+ \pgfmathsetmacro\pgf@arcto@rx{\pgf@arcto@sqrt@lambda*\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@ry{\pgf@arcto@sqrt@lambda*\pgf@arcto@ry}
+ \fi
+ %
+ % Do some scaling
+ %
+ \pgfmathsetmacro\pgf@arcto@xaprime@abs{abs(\pgf@arcto@xaprime)}
+ \pgfmathsetmacro\pgf@arcto@yaprime@abs{abs(\pgf@arcto@yaprime)}
+ \pgfmathmax@{\pgf@arcto@rx,\pgf@arcto@ry,\pgf@arcto@xaprime@abs,\pgf@arcto@yaprime@abs}
+ \pgfmathsetmacro\pgf@arcto@scaling{20/\pgfmathresult}
+ \pgfmathsetmacro\pgf@arcto@rx@scaled{\pgf@arcto@scaling*\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@ry@scaled{\pgf@arcto@scaling*\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@xaprime@scaled{\pgf@arcto@scaling*\pgf@arcto@xaprime}
+ \pgfmathsetmacro\pgf@arcto@yaprime@scaled{\pgf@arcto@scaling*\pgf@arcto@yaprime}
+ %
+ % Step 5: Now comes the messy computation of c1' and c2'.
+ %
+ \ifdim\pgf@arcto@rx pt>\pgf@arcto@ry pt%
+ \pgfmathsetmacro\pgf@arcto@rx@over@ry{\pgf@arcto@rx/\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@ry@over@rx{\pgf@arcto@ry/\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@temp{\pgf@arcto@ry@over@rx*\pgf@arcto@xaprime@scaled}
+ \pgfmathsetmacro\pgf@arcto@numerator{
+ \pgf@arcto@ry@scaled*\pgf@arcto@ry@scaled-
+ \pgf@arcto@yaprime@scaled*\pgf@arcto@yaprime@scaled-
+ \pgf@arcto@temp*\pgf@arcto@temp
+ }
+ \pgfmathsetmacro\pgf@arcto@denominator{
+ \pgf@arcto@yaprime@scaled*\pgf@arcto@yaprime@scaled+
+ \pgf@arcto@temp*\pgf@arcto@temp
+ }
+ \else
+ \pgfmathsetmacro\pgf@arcto@rx@over@ry{\pgf@arcto@rx/\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@ry@over@rx{\pgf@arcto@ry/\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@temp{\pgf@arcto@rx@over@ry*\pgf@arcto@yaprime@scaled}
+ \pgfmathsetmacro\pgf@arcto@numerator{
+ \pgf@arcto@rx@scaled*\pgf@arcto@rx@scaled-
+ \pgf@arcto@xaprime@scaled*\pgf@arcto@xaprime@scaled-
+ \pgf@arcto@temp*\pgf@arcto@temp
+ }
+ \pgfmathsetmacro\pgf@arcto@denominator{
+ \pgf@arcto@xaprime@scaled*\pgf@arcto@xaprime@scaled+
+ \pgf@arcto@temp*\pgf@arcto@temp
+ }
+ \fi
+ \pgfmathsetmacro\pgf@arcto@frac{
+ \pgf@arcto@numerator/\pgf@arcto@denominator
+ }
+ \ifdim\pgf@arcto@frac pt<0pt
+ \pgfmathsetmacro\pgf@arcto@factor{0}
+ \else
+ \pgfmathsetmacro\pgf@arcto@factor{sqrt(\pgf@arcto@frac)}
+ \fi
+ \ifx\pgf@arcto@fA\pgf@arcto@fS
+ \pgfmathsetmacro\pgf@arcto@factor{-\pgf@arcto@factor}
+ \fi
+ \pgfmathsetmacro\pgf@arcto@cxprime{
+ \pgf@arcto@factor*\pgf@arcto@rx@over@ry*\pgf@arcto@yaprime
+ }
+ \pgfmathsetmacro\pgf@arcto@cyprime{
+ -\pgf@arcto@factor*\pgf@arcto@ry@over@rx*\pgf@arcto@xaprime
+ }
+ %
+ % Step 6: Ok, now compute cx,cy
+ %
+ \pgftransformreset
+ \pgftransformrotate{\pgf@arcto@phi}
+ \pgf@process{
+ \pgfpointtransformed{\pgfqpoint{\pgf@arcto@cxprime pt}{\pgf@arcto@cyprime pt}}
+ }
+ \edef\pgf@arcto@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \pgf@process{\pgfpointadd{\pgf@arcto@temp}{
+ \pgfpointscale{.5}{
+ \pgfpointadd
+ {\pgfqpoint{\pgf@arcto@xa}{\pgf@arcto@ya}}
+ {\pgfqpoint{\pgf@arcto@xb}{\pgf@arcto@yb}} }
+ }
+ }
+ \edef\pgf@arcto@cx{\the\pgf@x}
+ \edef\pgf@arcto@cy{\the\pgf@y}
+ %
+ % Step 7: Compute start angle:
+ %
+ \pgfmathsetmacro\pgf@arcto@vec@x{(\pgf@arcto@xaprime-\pgf@arcto@cxprime)/\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@vec@y{(\pgf@arcto@yaprime-\pgf@arcto@cyprime)/\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@denominator{veclen(\pgf@arcto@vec@x,\pgf@arcto@vec@y)}
+ \pgfmathsetmacro\pgf@arcto@frac{\pgf@arcto@vec@x/\pgf@arcto@denominator}
+ \pgfmathsetmacro\pgf@arcto@theta@start{acos(\pgf@arcto@frac)}
+ \ifdim\pgf@arcto@vec@y pt<0pt
+ \pgfmathsetmacro\pgf@arcto@theta@start{-\pgf@arcto@theta@start}
+ \fi
+ %
+ % Step 8: Compute end angle:
+ %
+ \pgfmathsetmacro\pgf@arcto@vec@x{(-\pgf@arcto@xaprime-\pgf@arcto@cxprime)/\pgf@arcto@rx}
+ \pgfmathsetmacro\pgf@arcto@vec@y{(-\pgf@arcto@yaprime-\pgf@arcto@cyprime)/\pgf@arcto@ry}
+ \pgfmathsetmacro\pgf@arcto@denominator{veclen(\pgf@arcto@vec@x,\pgf@arcto@vec@y)}
+ \pgfmathsetmacro\pgf@arcto@frac{\pgf@arcto@vec@x/\pgf@arcto@denominator}
+ \pgfmathsetmacro\pgf@arcto@theta@end{acos(\pgf@arcto@frac)}
+ \ifdim\pgf@arcto@vec@y pt<0pt
+ \pgfmathsetmacro\pgf@arcto@theta@end{-\pgf@arcto@theta@end}
+ \fi
+ \pgfmathsetmacro\pgf@arcto@delta@theta{abs(\pgf@arcto@theta@start-\pgf@arcto@theta@end)}
+ \ifdim\pgf@arcto@fA pt=0pt%
+ \ifdim\pgf@arcto@delta@theta pt>180pt%
+ % Ok, we need to adjust the angle!
+ \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt
+ \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}
+ \else
+ \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}
+ \fi
+ \fi
+ \else
+ \ifdim\pgf@arcto@delta@theta pt<180pt%
+ % Ok, we need to adjust the angle!
+ \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt
+ \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}
+ \else
+ \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}
+ \fi
+ \fi
+ \fi
+ \xdef\pgf@marshal{\noexpand
+ \pgfpatharcaxes{\pgf@arcto@theta@start}{\pgf@arcto@theta@end}
+ {\noexpand\pgfpointpolar{\pgf@arcto@phi}{\pgf@arcto@rx}}
+ {\noexpand\pgfpointpolar{\pgf@arcto@phi+90}{\pgf@arcto@ry}}
+ }
+ \fi\fi\fi
+ }
+ \pgf@marshal
+}
+
+
+
+% the quality of arc approximation by means of Bezier splines is
+% controlled by a mesh width.
+%
+% The mesh width is provided in (full!) degrees. The smaller the mesh
+% width, the more precise the arc approximation.
+%
+% Use an empty value to disable spline approximation (uses a single
+% cubic polynomial for the complete arc).
+%
+% The value must be an integer!
+\def\pgfpatharctomaxstepsize{45}
+
+% A specialized arc operation for an arc on an (axis--parallel) ellipse.
+%
+% In contrast to \pgfpatharc, it explicitly interpolates start- and end points.
+%
+% In contrast to \pgfpatharcto, this routine is numerically stable and
+% quite fast since it relies on a lot of precomputed information.
+%
+% #1 center of ellipse
+% #2 angle of last path position inside of the ellipse
+% #3 end angle
+% #4 end point (a \pgfpoint)
+% #5 xradius
+% #6 yradius
+% #7 the ratio xradius/yradius of the ellipse
+% #8 the ratio yradius/xradius of the ellipse
+% Example:
+% \def\cx{1cm}% center x
+% \def\cy{1cm}% center y
+% \def\startangle{0}%
+% \def\endangle{45}%
+% \def\a{5cm}% xradius
+% \def\b{10cm}% yradius
+% \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult
+% \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult
+%
+% \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}%
+% \pgfpatharctoprecomputed
+% {\pgfpoint{\cx}{\cy}}
+% {\startangle}
+% {\endangle}
+% {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}%
+% {\a}
+% {\b}
+% {\abratio}
+% {\baratio}
+%
+\def\pgfpatharctoprecomputed#1#2#3#4#5#6#7#8{%
+ \begingroup
+ % Implementation idea:
+ %
+ % let
+ % m = center (#1)
+ % \gamma_0 = start angle
+ % \gamma_1 = end angle
+ % a = x radius
+ % b = y radius
+ %
+ % an axis parallel ellipse is parameterized by
+ % C(\gamma) = m + ( a cos(\gamma), b sin(\gamma) ), \gamma in [0,360].
+ %
+ % Now, consider the segment \gamma(t),
+ % \gamma:[0,1] -> [\gamma_0,\gamma_1],
+ % t -> \gamma_0 + t(\gamma_1 - \gamma_0)
+ % and
+ % C(\gamma(t)) which is defined on [0,1].
+ %
+ % I'd like to approximate the arc by one or more cubic bezier
+ % splines which interpolate through the last and first provided
+ % points.
+ %
+ % In general, a Bezier spline C:[0,1] -> \R of order n fulfills
+ % C'(0) = n ( P_1 - P_0 ),
+ % C'(1) = n ( P_n - P_{n-1} ).
+ % For n=3 and given P_0 and P_3, I can directly compute P_1 and P_2 once I know
+ % the derivatives at t=0 and t=1.
+ %
+ % The derivatives in our case are
+ % ( C \circ \gamma )'(t) = C'[\gamma(t)] * \gamma'(t)
+ % = ( -a pi/180 sin(\gamma(t)), b pi/180 cos(\gamma(t)) ) * (\gamma_1 - \gamma_0).
+ % The pi/180 comes into play since we are working with degrees.
+ %
+ % Expression (C\circ\gamma)'(0) using P_0 and (C \circ \gamma)'(1)
+ % using P_3 yields the expressions
+ % (C \circ \gamma)'(0) =
+ % pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_0^y - my), b/a (P_0^x - mx) ]
+ % (C \circ \gamma)'(1) =
+ % pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_3^y - my), b/a (P_3^x - mx) ]
+ %
+ % defining
+ % scaleA = a/b * pi / (3*180) * (\gamma_1 - \gamma_0)
+ % and
+ % scaleB = b/a * pi / (3*180) * (\gamma_1 - \gamma_0)
+ % yields the direct expressions for the intermediate bezier
+ % control points
+ %
+ % P_1 = [
+ % P_0^x - scaleA* ( P_0^y -my),
+ % P_0^y + scaleB* ( P_0^x -mx) ]
+ % and
+ % P_2 = [
+ % P_3^x + scaleA* ( P_3^y -my),
+ % P_3^y - scaleB* ( P_3^x -mx) ].
+ %
+ % This works fast, with few operations, if
+ % - a/b and b/a are known in advance
+ % - P_0 and P_3 are known in advance
+ % - \gamma_0 and \gamma_1 are known.
+ %
+ % It is also reliable if (\gamma_1 - \gamma_0) is small
+ %
+ \pgf@process{#1}%
+ \edef\pgfpath@center@x{\the\pgf@x}%
+ \edef\pgfpath@center@y{\the\pgf@y}%
+ \def\pgfpath@completearcend{#4}%
+ % compute scale (#3-#2) * pi/(3*180) = (#3 - #2) * pi/27 * 1/20
+ % splitting pi/(3*180) into two scales has higher TeX accuracy
+ \pgf@xa=#2pt
+ \pgf@xb=#3pt
+ \edef\pgfpath@startangle{#2pt}%
+ \edef\pgfpath@endangle{\pgf@sys@tonumber\pgf@xb}%
+ %
+ \pgf@ya=\pgf@xb
+ \advance\pgf@ya by-\pgf@xa
+ %
+ \ifx\pgfpatharctomaxstepsize\pgfutil@empty
+ \def\pgfpath@N{1}%
+ \pgf@xc=\pgf@ya
+ \else
+ \pgf@xc=\pgf@ya% compute N = floor((gamma_1 - gamma_0) / max) +1
+ \ifdim\pgf@xc<0pt
+ \multiply\pgf@xc by-1
+ \fi
+ \divide\pgf@xc by\pgfpatharctomaxstepsize\relax
+ \afterassignment\pgfutil@gobble@until@relax
+ \c@pgf@counta=\the\pgf@xc\relax
+ \advance\c@pgf@counta by1
+ \edef\pgfpath@N{\the\c@pgf@counta}%
+ %
+ \pgf@xc=\pgf@ya
+ \divide\pgf@xc by\c@pgf@counta
+ \fi
+ %
+ \edef\pgfpath@h{\pgf@sys@tonumber\pgf@xc}%
+ %
+%\message{pgfpathellipse: using N =\pgfpath@N\space spline points y0 = \pgfpath@startangle, y0+i*h, yN=\pgfpath@endangle, i=1,...,(\pgfpath@N-1), with h=\pgfpath@h\space mesh width (total arc angle \pgf@sys@tonumber\pgf@ya).}%
+ %
+ %
+ \pgf@xc=0.116355283466289\pgf@xc % pi/27
+ \divide\pgf@xc by20
+ \pgf@xa=#7\pgf@xc
+ \edef\pgfpath@scale@A{\pgf@sys@tonumber\pgf@xa}%
+ \pgf@xa=#8\pgf@xc
+ \edef\pgfpath@scale@B{\pgf@sys@tonumber\pgf@xa}%
+ %
+ % compute intermediate spline segments for
+ % i = 1,...,N-1
+ % this is a no-op for N=1.
+ \c@pgf@countd=1
+ \pgfutil@loop
+ \ifnum\c@pgf@countd<\pgfpath@N\relax
+ %
+ \pgf@xa=\pgfpath@startangle % compute \pgf@xa = y_0 + i*h
+ \pgf@xb=\pgfpath@h pt
+ \multiply\pgf@xb by\c@pgf@countd
+ \advance\pgf@xa by\pgf@xb
+ \edef\pgfpath@angle@i{\pgf@sys@tonumber\pgf@xa}%
+%\message{angle \the\c@pgf@countd: \pgfpath@angle@i...}%
+ %
+ \pgfpatharcofellipse@{%
+ \pgfpoint
+ {\pgfpath@center@x + #5*cos(\pgfpath@angle@i)}
+ {\pgfpath@center@y + #6*sin(\pgfpath@angle@i)}
+ }%
+ %
+ \advance\c@pgf@countd by1
+ \pgfutil@repeat
+ %
+ % compute final spline segment. It only differs insofar as the
+ % final point is already known explicitly and should be
+ % interpolated without additional math error.
+%\message{angle \pgfpath@N: \pgfpath@endangle...}%
+ \pgfpatharcofellipse@{\pgfpath@completearcend}%
+ \endgroup
+}%
+\def\pgfpatharcofellipse@#1{%
+ \begingroup
+ \pgf@process{#1}%
+ \edef\pgfpath@endpt{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
+ %
+ \pgfpathcurveto{
+ \begingroup
+ \global\pgf@x=\pgf@path@lastx
+ \global\pgf@y=\pgf@path@lasty
+ \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x
+ \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y
+ \global\advance\pgf@x by-\pgfpath@scale@A\pgf@ya
+ \global\advance\pgf@y by \pgfpath@scale@B\pgf@xa
+ \endgroup
+ }{%
+ \begingroup
+ \pgfpath@endpt
+ \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x
+ \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y
+ \global\advance\pgf@x by \pgfpath@scale@A\pgf@ya
+ \global\advance\pgf@y by-\pgfpath@scale@B\pgf@xa
+ \endgroup
+ }{%
+ \pgfpath@endpt
+ }%
+ \endgroup
+}
+
+
+
+
+
+
+
+
% Append an ellipse to the current path.
%
@@ -432,16 +903,16 @@
\pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}%
\pgf@protocolsizes{\pgf@xa}{\pgf@ya}%
}%
- \pgf@x=0.555\pgf@xb% first arc
- \pgf@y=0.555\pgf@yb%
+ \pgf@x=0.55228475\pgf@xb% first arc
+ \pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
\advance\pgf@y by\pgf@ya%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
\pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@x=0.555\pgf@xa%
- \pgf@y=0.555\pgf@ya%
+ \pgf@x=0.55228475\pgf@xa%
+ \pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
\advance\pgf@y by\pgf@yb%
{%
@@ -455,16 +926,16 @@
}%
\pgf@xa=-\pgf@xa% flip first axis
\pgf@ya=-\pgf@ya%
- \pgf@x=0.555\pgf@xa% second arc
- \pgf@y=0.555\pgf@ya%
+ \pgf@x=0.55228475\pgf@xa% second arc
+ \pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
\advance\pgf@y by\pgf@yb%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
\pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@x=0.555\pgf@xb%
- \pgf@y=0.555\pgf@yb%
+ \pgf@x=0.55228475\pgf@xb%
+ \pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
\advance\pgf@y by\pgf@ya%
{%
@@ -478,16 +949,16 @@
}%
\pgf@xb=-\pgf@xb% flip second axis
\pgf@yb=-\pgf@yb%
- \pgf@x=0.555\pgf@xb% third arc
- \pgf@y=0.555\pgf@yb%
+ \pgf@x=0.55228475\pgf@xb% third arc
+ \pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
\advance\pgf@y by\pgf@ya%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
\pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@x=0.555\pgf@xa%
- \pgf@y=0.555\pgf@ya%
+ \pgf@x=0.55228475\pgf@xa%
+ \pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
\advance\pgf@y by\pgf@yb%
{%
@@ -501,16 +972,16 @@
}%
\pgf@xa=-\pgf@xa% flip first axis once more
\pgf@ya=-\pgf@ya%
- \pgf@x=0.555\pgf@xa% fourth arc
- \pgf@y=0.555\pgf@ya%
+ \pgf@x=0.55228475\pgf@xa% fourth arc
+ \pgf@y=0.55228475\pgf@ya%
\advance\pgf@x by\pgf@xb%
\advance\pgf@y by\pgf@yb%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}%
\pgf@protocolsizes{\pgf@x}{\pgf@y}%
- \pgf@x=0.555\pgf@xb%
- \pgf@y=0.555\pgf@yb%
+ \pgf@x=0.55228475\pgf@xb%
+ \pgf@y=0.55228475\pgf@yb%
\advance\pgf@x by\pgf@xa%
\advance\pgf@y by\pgf@ya%
{%
@@ -887,4 +1358,110 @@
}
+
+% Draw part of a curve between two specified times s and t.
+%
+% #1 - a start time s.
+% #2 - an end time t.
+% #3 - start point of the curve
+% #4 - first control
+% #5 - second control
+% #6 - end point of the curve
+%
+% There are two versions, \pgfpathcurvebetweentime and
+% \pgfpathcurvebetweentimecontinue. The latter does not insert a
+% moveto to the first point.
+%
+\def\pgfpathcurvebetweentime{\pgf@ignoremovetofalse\pgf@@pathcurvebetweentime}
+\def\pgfpathcurvebetweentimecontinue{\pgf@ignoremovetotrue\pgf@@pathcurvebetweentime}
+\newif\ifpgf@ignoremoveto
+
+\def\pgf@@pathcurvebetweentime#1#2#3#4#5#6{%
+ \pgfmathparse{#1}%
+ \let\pgf@time@s=\pgfmathresult%
+ \pgfmathparse{#2}%
+ \let\pgf@time@t=\pgfmathresult%
+ \ifdim\pgf@time@s pt>\pgf@time@t pt\relax%
+ \pgfmathsetmacro\pgf@time@s{1-#1}%
+ \pgfmathsetmacro\pgf@time@t{1-#2}%
+ \pgf@@@pathcurvebetweentime{\pgf@time@t}{#6}{#5}{#4}{#3}%
+ \else%
+ \pgf@@@pathcurvebetweentime{\pgf@time@t}{#3}{#4}{#5}{#6}%
+ \fi%
+}
+
+\def\pgf@@@pathcurvebetweentime#1#2#3#4#5{%
+ % Q1 = P1.
+ \pgf@process{#2}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ % Q2 = P1 + t*(P2-P1).
+ \pgf@process{%
+ \pgf@process{#3}%
+ \pgf@xa=#1\pgf@x%
+ \pgf@ya=#1\pgf@y%
+ \pgf@process{#2}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \advance\pgf@x by-#1\pgf@xb%
+ \advance\pgf@y by-#1\pgf@yb%
+ \advance\pgf@x by\pgf@xa%
+ \advance\pgf@y by\pgf@ya%
+ }%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ % Q3 = Q2 + t*((P2 + t*(P3-P2)) - Q2).
+ \pgf@process{%
+ \pgf@process{#4}%
+ \pgf@xa=#1\pgf@x%
+ \pgf@ya=#1\pgf@y%
+ %
+ \pgf@process{#3}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xc by-#1\pgf@x%
+ \advance\pgf@yc by-#1\pgf@y%
+ %
+ \pgf@x=\pgf@xb%
+ \pgf@y=\pgf@yb%
+ \advance\pgf@x by#1\pgf@xa%
+ \advance\pgf@y by#1\pgf@ya%
+ \advance\pgf@x by-#1\pgf@xb%
+ \advance\pgf@y by-#1\pgf@yb%
+ \advance\pgf@x by#1\pgf@xc%
+ \advance\pgf@y by#1\pgf@yc%
+ }%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ % Q4 = (1-t)^3*P1 + 3*t(1-t)^2*P2 + 3*t^2(1-t)*P3 + t^3*P4.
+ \pgf@process{\pgfpointcurveattime{#1}{#2}{#3}{#4}{#5}}%
+ \ifx#1\pgf@time@t%
+ % First time round...
+ \pgfmathdivide@{\pgf@time@s}{\pgf@time@t}%
+ \pgfmathadd@{-\pgfmathresult}{1}%
+ \let\pgf@time@s=\pgfmathresult%
+ \edef\pgf@marshal{%
+ \noexpand\pgf@@@pathcurvebetweentime{\noexpand\pgf@time@s}%
+ {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ }%
+ \else%
+ % ...second time round.
+ \ifpgf@ignoremoveto%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ }%
+ \else%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpathmoveto{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ }%
+ \fi%
+ \fi%
+ \pgf@marshal%
+}
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
index a8da0ca9410..9bcfc739f56 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.7 2008/01/23 15:22:29 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.8 2008/10/09 16:46:56 tantau Exp $
@@ -301,8 +301,8 @@
\pgf@y=\pgf@yb%
\advance\pgf@x by-\pgf@xa%
\advance\pgf@y by-\pgf@ya%
- \advance\pgf@xa by 0.555\pgf@x%
- \advance\pgf@ya by 0.555\pgf@y%
+ \advance\pgf@xa by 0.5522847\pgf@x%
+ \advance\pgf@ya by 0.5522847\pgf@y%
\edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportatoken{\the\pgf@xa}{\the\pgf@ya}}%
\expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}%
}%
@@ -312,8 +312,8 @@
\pgf@y=\pgf@yb%
\advance\pgf@x by-\pgf@xc%
\advance\pgf@y by-\pgf@yc%
- \advance\pgf@xc by 0.555\pgf@x%
- \advance\pgf@yc by 0.555\pgf@y%
+ \advance\pgf@xc by 0.5522847\pgf@x%
+ \advance\pgf@yc by 0.5522847\pgf@y%
\edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportbtoken{\the\pgf@xc}{\the\pgf@yc}}%
\expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}%
}%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
index e14a4e44447..b803cce9caf 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.11 2008/01/23 13:15:28 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.12 2008/04/22 17:03:26 tantau Exp $
% Stroke/fill/clip/etc. the current path. Depending on the options,
@@ -96,12 +96,14 @@
\pgfsyssoftpath@invokecurrentpath%
\pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
\pgf@up@action%
+ \pgf@stroke@inner@line@if@needed%
\pgfsyssoftpath@setcurrentpath\pgfutil@empty%
\pgf@add@arrows@as@needed%
\else%
\pgfsyssoftpath@invokecurrentpath%
\pgfsyssoftpath@getcurrentpath\pgf@last@used@path%
\pgf@up@action%
+ \pgf@stroke@inner@line@if@needed%
\fi%
\fi%
\else%
@@ -117,6 +119,18 @@
\ignorespaces%
}
+\def\pgf@stroke@inner@line@if@needed{%
+ \ifdim\pgfinnerlinewidth>0pt\relax%
+ \pgfsys@beginscope%
+ {%
+ \pgfsys@setlinewidth{\pgfinnerlinewidth}%
+ \pgfsetstrokecolor{\pgfinnerstrokecolor}%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@stroke%
+ }%
+ \pgfsys@endscope%
+ \fi%
+}
% Shorten start/end of paths by a certain amount.
%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
index a3f6eb12502..b308c5aef8f 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
@@ -7,16 +7,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepatterns.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $
-
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepatterns.code.tex,v 1.3 2009/07/02 11:43:15 tantau Exp $
% Creates a new uncolored pattern
%
-% #1 = pattern name
-% #2 = lower left of bounding box
-% #3 = upper right of bounding box
-% #4 = step vector
-% #5 = pattern code
+% [#1] = optional list of variables.
+% #2 = pattern name
+% #3 = lower left of bounding box
+% #4 = upper right of bounding box
+% #5 = step vector
+% #6 = pattern code
%
% Description:
%
@@ -26,6 +26,8 @@
%
% See the pdf-manual for more details on uncolored patterns.
%
+% Specifying a variable list makes the pattern ``mutable''.
+%
% The bounding box must be a bounding box of the pattern cell.
%
% The step vector must provide the x- and y-step by which the cells
@@ -49,16 +51,21 @@
% \pgfpathclose%
% \pgfusepath{stroke}
% }
+%
+\def\pgfdeclarepatternformonly{%
+ \def\pgf@pattern@type{formonly}%
+ \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
+}
-\def\pgfdeclarepatternformonly#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{0}}
% Creates a new colored pattern
%
-% #1 = pattern name
-% #2 = lower left of bounding box
-% #3 = upper right of bounding box
-% #4 = step vector
-% #5 = pattern code
+% [#1] = optional list of variables.
+% #2 = pattern name
+% #3 = lower left of bounding box
+% #4 = upper right of bounding box
+% #5 = step vector
+% #6 = pattern code
%
% Description:
%
@@ -83,8 +90,38 @@
% \pgfpathclose%
% \pgfusepath{stroke,fill}
% }
+%
+\def\pgfdeclarepatterninherentlycolored{%
+ \def\pgf@pattern@type{inherentlycolored}%
+ \pgfutil@ifnextchar[{\pgf@declarepattern@checkarg}{\pgf@declarepattern@checkarg[]}%
+}
+
+
-\def\pgfdeclarepatterninherentlycolored#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{1}}
+
+
+\def\pgf@declarepattern@checkarg[#1]{%
+ \def\pgf@pattern@tempvars{#1}%
+ \ifx\pgf@pattern@tempvars\pgfutil@empty%
+ \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type\endcsname%
+ \else%
+ \expandafter\let\expandafter\pgf@next\csname pgf@declarepattern\pgf@pattern@type @mutable\endcsname%
+ \fi%
+ \pgf@next}
+
+\long\def\pgf@declarepatternformonly#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{0}}
+
+\long\def\pgf@declarepatterninherentlycolored#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{1}}
+
+\long\def\pgf@declarepatternformonly@mutable#1#2#3#4#5{%
+ \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
+ \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{2}%
+}
+
+\long\def\pgf@declarepatterninherentlycolored@mutable#1#2#3#4#5#6{%
+ \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
+ \expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{3}%
+}
\def\pgf@declarepattern#1#2#3#4#5#6{%
\pgfutil@ifundefined{pgf@pattern@name@#1}{%
@@ -125,16 +162,37 @@
\expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\pgf@marshal%
}
{%
- \PackageError{pgfbasepatterns}{Pattern `#1' already defined}{}%
+ \PackageError{pgfcorepatterns}{Pattern `#1' already defined}{}%
}%
}
\def\pgf@pattern@number{0}%
+\def\pgf@declarepatternmutable#1#2#3#4#5#6#7{%
+ \pgfutil@ifundefined{pgf@pattern@name@#1}{%
+ \expandafter\gdef\csname pgf@pattern@name@#1\endcsname{#1}%
+ \expandafter\gdef\csname pgf@pattern@variables@#1\endcsname{#2}%
+ \expandafter\gdef\csname pgf@pattern@lowerleft@#1\endcsname{#3}%
+ \expandafter\gdef\csname pgf@pattern@upperright@#1\endcsname{#4}%
+ \expandafter\gdef\csname pgf@pattern@tilesize@#1\endcsname{#5}%
+ \expandafter\long\expandafter\gdef\csname pgf@pattern@code@#1\endcsname{#6}%
+ \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{7}%
+ }{\PackageError{pgfcorepatterns}{The pattern `#1' is already defined}{}}%
+}
+
\def\pgf@ifpatternisinherentlycolored#1#2#3{%
- \expandafter\ifnum\csname pgf@pattern@type@#1\endcsname=1\relax#2\else#3\fi%
+ \expandafter\ifodd\csname pgf@pattern@type@#1\endcsname\relax#2\else#3\fi%
}
+\def\pgf@ifpatternismutable#1#2#3{%
+ \expandafter\ifnum\csname pgf@pattern@type@#1\endcsname>1\relax#2\else#3\fi%
+}
+
+\def\pgfpatternreleasename#1{\expandafter\let\csname pgf@pattern@name@#1\endcsname\relax}
+
+
+
+
% Set an pattern as fill color
@@ -150,10 +208,51 @@
% Example:
%
% \pgfsetfillpattern{stars}{red}
-
+%
\def\pgfsetfillpattern#1#2{%
+ \pgfutil@ifundefined{pgf@pattern@name@#1}%
+ {%
+ \PackageError{pgfcorepatterns}{Undefined pattern `#1'}{}%
+ }%
+ {%
+ \pgf@ifpatternismutable{#1}%
+ {%
+ % So, a mutable pattern. Check to see if the pattern
+ % has been used with the current variable values...
+ \let\pgf@pattern@tempvars\pgfutil@empty%
+ \expandafter\expandafter\expandafter\pgf@pattern@check@vars%
+ \csname pgf@pattern@variables@#1\endcsname,\pgf@stop,%
+ \edef\pgf@pattern@nametemp{pgf@pattern@#1@\pgf@pattern@tempvars}%
+ \expandafter\pgfutil@ifundefined\expandafter{\pgf@pattern@nametemp}%
+ {%
+ % ...Nope. So declare a new instance of the mutable pattern.
+ \pgf@ifpatternisinherentlycolored{#1}%
+ {\let\pgf@set@fillpattern@declare\pgfdeclarepatterninherentlycolored}%
+ {\let\pgf@set@fillpattern@declare\pgfdeclarepatternformonly}%
+ \pgf@set@fillpattern@declare%
+ {\pgf@pattern@nametemp}%
+ {\csname pgf@pattern@lowerleft@#1\endcsname}%
+ {\csname pgf@pattern@upperright@#1\endcsname}%
+ {\csname pgf@pattern@tilesize@#1\endcsname}%
+ {\csname pgf@pattern@code@#1\endcsname}%
+ }%
+ {%
+ % ...Yep. So do nothing.
+ }%
+ \expandafter\pgf@set@fillpattern\expandafter{\pgf@pattern@nametemp}{#2}%
+ \expandafter\gdef\csname\pgf@pattern@nametemp\endcsname{#1}%
+ }%
+ {%
+ % A non-mutable pattern.
+ \pgf@set@fillpattern{#1}{#2}%
+ }%
+ }%
+}
+
+
+\def\pgf@set@fillpattern#1#2{%
\pgfutil@ifundefined{pgf@pattern@name@#1}{%
- \PackageError{pgfbasepatterns}{Undefined pattern `#1'}{}}
+ \PackageError{pgfcorepatterns}{Undefined pattern `#1'}{}}
{%
\csname pgf@pattern@instantiate@#1\endcsname%
\expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\relax%
@@ -168,11 +267,30 @@
}%
}%
}
+
\def\pgf@set@fill@patternuncolored#1,#2,#3\relax#4{%
\pgfsys@setpatternuncolored{\csname pgf@pattern@name@#4\endcsname}{#1}{#2}{#3}%
}
-
-
+\def\pgf@pattern@check@vars#1,{%
+ \ifx#1\pgf@stop%
+ \let\pgf@next\relax%
+ \else%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\let\expandafter\pgf@pattern@char#1#1\pgfmath@%
+ \ifx\pgf@pattern@char/%
+ \edef\pgf@pattern@tempvar{(\pgfkeysvalueof{#1})}%
+ \else%
+ \expandafter\ifcat\pgf@pattern@char\relax%
+ \edef\pgf@pattern@tempvar{(\the#1)}%
+ \else%
+ \edef\pgf@pattern@tempvar{(#1)}%
+ \fi%
+ \fi%
+ \edef\pgf@pattern@tempvars{\pgf@pattern@tempvars\pgf@pattern@tempvar}%
+ \let\pgf@next\pgf@pattern@check@vars%
+ \fi%
+ \pgf@next%
+}
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
index 3ab2b4e009b..79cb3a06f77 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.13 2008/02/03 19:37:26 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.20 2010/04/09 08:53:45 ludewich Exp $
\newdimen\pgf@picminx
\newdimen\pgf@picmaxx
@@ -35,7 +35,7 @@
\def\pgfextract@process#1#2{%
\pgf@process{#2}%
- \edef#1{\noexpand\pgf@x\the\pgf@x\noexpand\pgf@y\the\pgf@y}%
+ \edef#1{\noexpand\pgf@x=\the\pgf@x\noexpand\relax\noexpand\pgf@y=\the\pgf@y\noexpand\relax}%
}
% This needed until old shapes code changed.
\let\pgfsavepgf@process\pgfextract@process%
@@ -172,6 +172,14 @@
\def\pgfpointscale#1#2{%
\pgf@process{#2}%
+ \pgfmathparse{#1}%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \pgf@y=\pgfmathresult\pgf@y%
+}
+% A "quick" variant of \pgfpointscale which doesn't invoke the math parser for '#1'.
+% #1 must be a number without units, no registers are accepted.
+\def\pgfqpointscale#1#2{%
+ \pgf@process{#2}%
\pgf@x=#1\pgf@x%
\pgf@y=#1\pgf@y%
}
@@ -736,6 +744,15 @@
\advance\pgf@y by \pgftemp@y\pgf@yy}
+% "Quick" variant for \pgfpointxy.
+%
+% Only numbers without unit are allowed here.
+\def\pgfqpointxy#1#2{%
+ \pgf@x=#1\pgf@xx%
+ \advance\pgf@x by #2\pgf@yx%
+ \pgf@y=#1\pgf@xy%
+ \advance\pgf@y by #2\pgf@yy}
+
% Store the vector #1 * x-vec + #2 * y-vec + #3 * z-vec
%
% #1 = a factor for the x-vector
@@ -782,6 +799,16 @@
\advance\pgf@y by \pgftemp@y\pgf@yy%
\advance\pgf@y by \pgftemp@z\pgf@zy}
+% "Quick" variant for \pgfpointxyz.
+%
+% Only numbers without unit are allowed.
+\def\pgfqpointxyz#1#2#3{%
+ \pgf@x=#1\pgf@xx%
+ \advance\pgf@x by #2\pgf@yx%
+ \advance\pgf@x by #3\pgf@zx%
+ \pgf@y=#1\pgf@xy%
+ \advance\pgf@y by #2\pgf@yy%
+ \advance\pgf@y by #3\pgf@zy}
@@ -913,7 +940,7 @@
\pgf@x=0pt\relax%
\else%
\divide\c@pgf@countb by \c@pgf@counta%
- \pgf@y=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
+ \pgf@y=\csname pgfmath@cosfrac@\the\c@pgf@countb\endcsname pt%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta%
\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa%
@@ -1114,6 +1141,13 @@
#1=\pgf@y\relax}
+% Stores the most recently used (x,y) coordinates into two macros, #1
+% and #2.
+\def\pgfgetlastxy#1#2{%
+ \edef#1{\the\pgf@x}%
+ \edef#2{\the\pgf@y}%
+}%
+
\def\pgf@def#1#2#3{\expandafter\def\csname pgf@#1#2\endcsname{#3}}
\pgf@def{cosfrac}{0}{1}
@@ -1168,6 +1202,4 @@
\pgf@def{cosfrac}{97}{0.717792} \pgf@def{cosfrac}{98}{0.714213}
\pgf@def{cosfrac}{99}{0.710651} \pgf@def{cosfrac}{100}{0.707107}
-
-
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
index 84a432ceadb..d5817ce4282 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.3 2008/10/09 16:46:56 tantau Exp $
% Quick version of basic drawing commands. Most high-level commands
% are not available if these commands are used.
@@ -76,7 +76,7 @@
\def\pgfpathqcircle#1{%
{%
\pgf@x=#1%
- \pgf@y=0.555\pgf@x%
+ \pgf@y=0.5522847\pgf@x%
\pgfsyssoftpath@moveto{\the\pgf@x}{0pt}%
\pgfsyssoftpath@curveto{\the\pgf@x}{\the\pgf@y}{\the\pgf@y}{\the\pgf@x}{0pt}{\the\pgf@x}%
\pgfsyssoftpath@curveto{-\the\pgf@y}{\the\pgf@x}{-\the\pgf@x}{\the\pgf@y}{-\the\pgf@x}{0pt}%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
index b637ff10ded..558f715788c 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.26 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.34 2010/09/08 15:07:18 tantau Exp $
% Globals
@@ -31,82 +31,6 @@
-% Library files inclusion
-
-
-% Include a library file.
-%
-% #1 = List of names of library file.
-%
-% Description:
-%
-% This command includes a list of library files. For each file X in the
-% list, the file pgflibraryX.code.tex is included, provided this has
-% not been done earlier.
-%
-% For the convenience of Context users, both round and square brackets
-% are possible for the argument.
-%
-% Example:
-%
-% \usepgflibrary{arrows}
-% \usepgflibrary[patterns,snakes]
-
-\def\usepgflibrary{\pgfutil@ifnextchar[{\use@pgflibrary}{\use@@pgflibrary}}%}
-\def\use@pgflibrary[#1]{\use@@pgflibrary{#1}}
-\def\use@@pgflibrary#1{%
- \edef\pgf@list{#1}%
- \pgfutil@for\pgf@temp:=\pgf@list\do{%
- \expandafter\ifx\csname pgf@library@\pgf@temp @loaded\endcsname\relax%
- \expandafter\let\csname pgf@library@\pgf@temp @loaded\endcsname=\pgfutil@empty%
- \expandafter\edef\csname pgf@library@#1@atcode\endcsname{\the\catcode`\@}
- \expandafter\edef\csname pgf@library@#1@barcode\endcsname{\the\catcode`\|}
- \catcode`\@=11
- \catcode`\|=12
- \input pgflibrary\pgf@temp.code.tex
- \catcode`\@=\csname pgf@library@#1@atcode\endcsname
- \catcode`\|=\csname pgf@library@#1@barcode\endcsname
- \fi%
- }%
-}
-
-
-% Include a module file.
-%
-% #1 = List of names of module files.
-%
-% Description:
-%
-% This command includes a list of module files. For each file X in the
-% list, the file pgfmoduleX.code.tex is included, provided this has
-% not been done earlier.
-%
-% For the convenience of Context users, both round and square brackets
-% are possible for the argument.
-%
-% Example:
-%
-% \usepgfmodule{matrix}
-
-\def\usepgfmodule{\pgfutil@ifnextchar[{\use@pgfmodule}{\use@@pgfmodule}}%}
-\def\use@pgfmodule[#1]{\use@@pgfmodule{#1}}
-\def\use@@pgfmodule#1{%
- \edef\pgf@list{#1}%
- \pgfutil@for\pgf@temp:=\pgf@list\do{%
- \expandafter\ifx\csname pgf@module@\pgf@temp @loaded\endcsname\relax%
- \expandafter\let\csname pgf@module@\pgf@temp @loaded\endcsname=\pgfutil@empty%
- \expandafter\edef\csname pgf@module@#1@atcode\endcsname{\the\catcode`\@}
- \expandafter\edef\csname pgf@module@#1@barcode\endcsname{\the\catcode`\|}
- \catcode`\@=11
- \catcode`\|=12
- \input pgfmodule\pgf@temp.code.tex
- \catcode`\@=\csname pgf@module@#1@atcode\endcsname
- \catcode`\|=\csname pgf@module@#1@barcode\endcsname
- \fi%
- }%
-}
-
-
% Scopes
@@ -268,6 +192,13 @@
\newif\ifpgfpicture
+\def\pgfresetboundingbox{%
+ \global\pgf@picmaxx=-16000pt\relax%
+ \global\pgf@picminx=16000pt\relax%
+ \global\pgf@picmaxy=-16000pt\relax%
+ \global\pgf@picminy=16000pt\relax%
+}%
+
\def\pgfpicture{%
\begingroup%
\pgfpicturetrue%
@@ -306,7 +237,7 @@
\let\setlength=\pgf@setlength%
\let\addtolength=\pgf@addtolength%
\let\selectfont=\pgf@selectfont%
- \nullfont\spaceskip\z@\xspaceskip\z@%
+ \nullfont\spaceskip0pt\xspaceskip0pt%
\setbox\pgf@layerbox@main\hbox to0pt\bgroup%
\begingroup%
}
@@ -325,7 +256,21 @@
% Shift baseline outside:
\pgf@relevantforpicturesizefalse%
\pgf@process{\pgf@baseline}%
- \gdef\pgf@shift@baseline{\the\pgf@y}%
+ \xdef\pgf@shift@baseline{\the\pgf@y}%
+ %
+ \pgf@process{\pgf@trimleft}%
+ \global\advance\pgf@x by-\pgf@picminx
+ % prepare \hskip\pgf@trimleft@final.
+ % note that \pgf@trimleft@final is also queried
+ % by the pgf image externalization.
+ \xdef\pgf@trimleft@final{-\the\pgf@x}%
+ %
+ \pgf@process{\pgf@trimright}%
+ \global\advance\pgf@x by-\pgf@picmaxx
+ % prepare \hskip\pgf@trimright@final.
+ % note that \pgf@trimright@final is also queried
+ % by the pgf image externalization.
+ \xdef\pgf@trimright@final{\the\pgf@x}%
\endgroup%
\hss%
\egroup%
@@ -396,6 +341,7 @@
\pgfsetbaselinepointlater{\pgf@setter@baseline}%
}
+\def\pgf@default@text{default}%
% Sets the baseline
%
@@ -407,11 +353,65 @@
% Example:
%
% \pgfsetbaseline{1cm+2pt}
-
-\def\pgfsetbaseline#1{\pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}}
+% \pgfsetbaseline{default}% resets to default value
+
+\def\pgfsetbaseline#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsetbaseline{\pgf@picminy}%
+ \else
+ \pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}%
+ \fi
+}
\pgfsetbaseline{\pgf@picminy}
+% controls how the image externalization implements trim:
+\newif\ifpgf@trim@lowlevel
+\pgfkeys{
+ /pgf/trim lowlevel/.is if=pgf@trim@lowlevel,
+ /pgf/trim lowlevel/.default=true,
+}
+% Same as the y-baseline for horizontal alignment.
+% The effect is different, though: it is some kind of trimming which
+% leaves the bounding box intact.
+\def\pgfsettrimleftpointlater#1{\def\pgf@trimleft{#1}}
+\def\pgfsettrimleftpointnow#1{%
+ \pgf@process{#1}%
+ \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfsettrimleftpointlater{\pgf@setter@baseline}%
+}
+% \pgfsettrimleft{<x coord>}
+% or
+% \pgfsettrimleft{default}
+\def\pgfsettrimleft#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimleft{\pgf@picminx}
+ \else
+ \pgfsettrimleftpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
+}
+\pgfsettrimleft{\pgf@picminx}
+
+\def\pgfsettrimrightpointlater#1{\def\pgf@trimright{#1}}
+\def\pgfsettrimrightpointnow#1{%
+ \pgf@process{#1}%
+ \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfsettrimrightpointlater{\pgf@setter@baseline}%
+}
+% \pgfsettrimright{<x coord>}
+% or
+% \pgfsettrimright{default}
+\def\pgfsettrimright#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimright{\pgf@picmaxx}%
+ \else
+ \pgfsettrimrightpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
+}
+\pgfsettrimright{\pgf@picmaxx}
% Interrupt path
@@ -489,6 +489,8 @@
\pgf@picminx=16000pt\relax%
\pgf@picmaxy=-16000pt\relax%
\pgf@picminy=16000pt\relax%
+ \pgf@size@hookedfalse%
+ \let\pgf@path@size@hook=\pgfutil@empty%
}
\def\endpgfinterruptboundingbox
{%
@@ -554,6 +556,7 @@
\fi%
\pgfutil@selectfont%
\pgfpicturefalse%
+ \let\pgf@positionnodelater@macro\relax%
\pgf@savelayers%
}
\def\endpgfinterruptpicture
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
index e8225bb0225..d4b0e8bee74 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.9 2007/12/10 13:19:32 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.13 2008/11/23 16:07:47 ludewich Exp $
%
% Parsing functions
@@ -111,6 +111,14 @@
}
+% Normalized a <color specification> argument for shadings into a
+% series of rgb color specifications and writes the result into
+% \pgf@rgbconv.
+%
+% Example:
+% \pgf@convertrgbstring{rgb(0cm)=(1,0,0); rgb(2cm)=(0,1,0); rgb(4cm)=(0,0,1); gray(1cm)=(3); color(2cm)=(green); }
+% ->
+% \pgf@rgbconv = macro:->'rgb(0cm)=(1,0,0); rgb(2cm)=(0,1,0); rgb(4cm)=(0,0,1); rgb(1cm)=(3,3,3); rgb(2cm)=(0,1,0); '
\def\pgf@convertrgbstring#1{%
\def\pgf@rgbconv{}%
\pgf@converttorgb#1]%
@@ -387,6 +395,12 @@
\expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}%
\expandafter\pgfshading@rgb\pgf@rgbcolor\relax%
\edef#2{\pgf@sys@tonumber{\pgf@xa}\space\pgf@sys@tonumber{\pgf@xb}\space\pgf@sys@tonumber{\pgf@xc}\space}%
+ \c@pgf@counta\escapechar%
+ \escapechar-1\relax%
+ \expandafter\edef\csname\string#2red\endcsname{\pgf@sys@tonumber{\pgf@xa}\space}%
+ \expandafter\edef\csname\string#2green\endcsname{\pgf@sys@tonumber{\pgf@xb}\space}%
+ \expandafter\edef\csname\string#2blue\endcsname{\pgf@sys@tonumber{\pgf@xc}\space}%
+ \escapechar\c@pgf@counta%
}
\def\pgfshading@rgb#1,#2,#3\relax{%
\pgf@xa=#1pt%
@@ -531,8 +545,8 @@
\advance\pgf@xc by-\pgf@pathminx%
\pgf@yc=\pgf@pathmaxy%
\advance\pgf@yc by-\pgf@pathminy%
- \pgf@xc=.02\pgf@xc%
- \pgf@yc=.02\pgf@yc%
+ \pgf@xc=.01992528\pgf@xc%
+ \pgf@yc=.01992528\pgf@yc%
\pgfsyssoftpath@invokecurrentpath%
\pgfsys@clipnext%
\pgfsys@discardpath%
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
index caf5432b4d8..442531ffa6f 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.10 2008/02/04 17:19:54 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.11 2009/06/10 09:22:57 ludewich Exp $
% Position transformations
@@ -37,6 +37,36 @@
\edef#1{{\pgf@pt@aa}{\pgf@pt@ab}{\pgf@pt@ba}{\pgf@pt@bb}{\the\pgf@pt@x}{\the\pgf@pt@y}}
}
+% Store the current transformation matrix in a set of macros, one for
+% each single entry.
+%
+% #1-#4 are macro which store the matrix entries (0,0), (0,1), (1,0),
+% (1,1) (in this order). It is the same order as for \pgftransformcm.
+%
+% #5 is a macro which will be filled with the x shift and
+% #6 is a macro which will be filled with the y shift.
+%
+% Example:
+% \pgfgettransform\aa\ab\ba\bb\shiftx\shifty
+%
+% ->
+%
+% \pgftransformcm\aa\ab\ba\bb{\pgfqpoint{\shiftx}{\shifty}}
+%
+% or
+%
+% \pgfsettransformentries\aa\ab\ba\bb\shiftx\shifty
+\def\pgfgettransformentries#1#2#3#4#5#6{%
+ \edef#1{\pgf@pt@aa}%
+ \edef#2{\pgf@pt@ab}%
+ \edef#3{\pgf@pt@ba}%
+ \edef#4{\pgf@pt@bb}%
+ \edef#5{\the\pgf@pt@x}%
+ \edef#6{\the\pgf@pt@y}%
+}%
+\def\pgfsettransformentries#1#2#3#4#5#6{%
+ \pgfsettransform{{#1}{#2}{#3}{#4}{#5}{#6}}%
+}%
% Restore the current transformation matrix from a macro.
%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg
new file mode 100644
index 00000000000..f1e0f36ce16
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.cfg
@@ -0,0 +1,2 @@
+\SYSTEM {http://www.tcs.uni-luebeck.de/dtds/svgpgf.dtd} {svgpgf.xmt}
+\NAME{svgpgf} {svgpgf.xmt}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt
new file mode 100644
index 00000000000..7a3e688e6ee
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgpgf.xmt
@@ -0,0 +1,48 @@
+\DeclareNamespace{svg}{http://www.w3.org/2000/svg}
+
+\XMLelement{svg:svg}{
+}
+{\begin{pgfpicture}
+ \pgfsetyvec{\pgfpoint{0cm}{-1cm}}}
+{\end{pgfpicture}}
+
+\XMLelement{svg:rect}{
+ \XMLattribute{width}{\svgwidth}{0}
+ \XMLattribute{height}{\svgheight}{0}
+ \XMLattribute{x}{\svgx}{0}
+ \XMLattribute{y}{\svgy}{0}
+ \XMLattribute{fill}{\svgfill}{x000}
+}
+{
+ \expandafter\svgparsefill\svgfill
+ \pgfsetfillcolor{mycol}
+ \pgfpathrectangle{\pgfpointxy{\svgx}{\svgy}}{\pgfpointxy{\svgwidth}{\svgheight}}
+ \pgfusepath{fill}}
+{}
+
+\gdef\svgparsefill#1#2#3#4{%
+ \pgfmathparse{\csname tonum#2\endcsname/16}
+ \let\myred=\pgfmathresult
+ \pgfmathparse{\csname tonum#3\endcsname/16}
+ \let\mygreen=\pgfmathresult
+ \pgfmathparse{\csname tonum#4\endcsname/16}
+ \let\myblue=\pgfmathresult
+ \definecolor{mycol}{rgb}{\myred,\mygreen,\myblue}
+}
+
+\expandafter\gdef\csname tonum0\endcsname{0}
+\expandafter\gdef\csname tonum1\endcsname{1}
+\expandafter\gdef\csname tonum2\endcsname{2}
+\expandafter\gdef\csname tonum3\endcsname{3}
+\expandafter\gdef\csname tonum4\endcsname{4}
+\expandafter\gdef\csname tonum5\endcsname{5}
+\expandafter\gdef\csname tonum6\endcsname{6}
+\expandafter\gdef\csname tonum7\endcsname{7}
+\expandafter\gdef\csname tonum8\endcsname{8}
+\expandafter\gdef\csname tonum9\endcsname{9}
+\expandafter\gdef\csname tonuma\endcsname{10}
+\expandafter\gdef\csname tonumb\endcsname{11}
+\expandafter\gdef\csname tonumc\endcsname{12}
+\expandafter\gdef\csname tonumd\endcsname{13}
+\expandafter\gdef\csname tonume\endcsname{14}
+\expandafter\gdef\csname tonumf\endcsname{15}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.cfg b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.cfg
new file mode 100644
index 00000000000..f658cf84240
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.cfg
@@ -0,0 +1,3 @@
+%\PUBLIC {-//W3C//DTD SVG 1.1//EN} {svgpgf.xmt}
+%\NAME{svg} {svgpgf.xmt}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.tex
new file mode 100644
index 00000000000..4e919ca1371
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.tex
@@ -0,0 +1,15 @@
+\documentclass{article}
+
+\usepackage{pgfsvg}
+
+\begin{document}
+
+Huhu...
+
+\xmlinclude{svgtest.xml}
+foo...
+\xmlinclude{rect01.xml}
+
+%\xmlinclude{svgtest.xml}
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.xml b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.xml
new file mode 100644
index 00000000000..109ee812629
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/svg/svgtest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg xmlns="http://www.w3.org/2000/svg"
+ width="200"
+ height="200"
+ viewBox="0 0.5 5 5" preserveAspectRatio="none">
+ <rect id="black_stripe"
+ fill="#000"
+ width="5"
+ height="1"/>
+ <rect id="gray_i"
+ fill="#484"
+ width="6"
+ height="1" y="2"/>
+ <rect id="gray_ii"
+ fill="#888"
+ width="3"
+ height="1" y="3"/>
+ <rect id="gray_iii"
+ fill="#ccc"
+ width="2"
+ height="1" y="4"/>
+ <rect id="white"
+ fill="#fff"
+ width="5"
+ height="1" y="5"/>
+</svg>
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex
new file mode 100644
index 00000000000..693da7c5907
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex
@@ -0,0 +1,265 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{decorations.markings,calc}
+
+
+%
+% Indicate that the picture contains a circuit
+%
+\tikzset{
+ circuit/.style={
+ every circuit/.try,
+ /utils/exec=\tikz@lib@circ@on@tofalse,
+ execute at begin to={
+ \tikz@lib@circ@on@totrue
+ \let\tikz@lib@circ@start@node\pgfutil@empty
+ \def\tikz@lib@circ@end{-- (\tikztotarget) \tikztonodes}
+ }
+ }
+}
+
+\newif\iftikz@lib@circ@on@to
+
+
+%
+% General management
+%
+
+\tikzset{
+ circuit handle symbol/.code={%
+ \global\advance\tikz@lib@circ@count by1\relax%
+ \iftikz@lib@circ@on@to
+ {%
+ % Compute the tikz@time...
+ \pgfkeys{
+ /pgf/key filters/active families or no family/.install key filter={/pgf/key filters/false}{/pgf/key filters/false},
+ /tikz/circuits/pos grabber/.activate family}
+ \pgfqkeysfiltered{/tikz}{pos=.5,#1}%
+ \expandafter%
+ }%
+ \expandafter\def\expandafter\tikz@lib@circ@pos\expandafter{\tikz@time}%
+ \pgfkeysalso{to path={
+ \pgfextra{\tikz@lib@circ@on@tofalse}
+ decorate [decoration={markings,mark connection node=mark node}]
+ {
+ \tikz@lib@circ@start@node
+ \tikz@lib@circ@end
+ }
+ }}
+ \ifx\tikz@lib@circ@pos\tikz@zero@text%
+ \def\tikz@lib@circ@start@node{%
+ {\pgfextra{\tikz@lib@circ@compute@direction{\tikz@lib@circ@start}}%
+ node[alias=tikz@lib@circ@node@start,at={(0,0)},#1,pos=]{}}(tikz@lib@circ@node@start)}%
+ \else%
+ \ifx\tikz@lib@circ@pos\tikz@one@text%
+ \def\tikz@lib@circ@end{
+ {\pgfextra{\tikz@lib@circ@compute@direction{\tikz@lib@circ@target}}%
+ node[alias=tikz@lib@circ@node\the\tikz@lib@circ@count,at={(0,0)},#1,pos=]{}}
+ --(tikz@lib@circ@node\the\tikz@lib@circ@count)\tikztonodes
+ }%
+ \else%
+ \edef\tikz@marshal{mark=at position \tikz@lib@circ@pos\space with}%
+ \def\tikz@marshala{decoration=}%
+ \expandafter\expandafter\expandafter\tikzset%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@marshala\expandafter{\tikz@marshal{\node[alias=mark node,#1,pos=]{};}}}
+ \fi%
+ \fi%
+ \else
+ \pgfkeysalso{#1}
+ \fi
+ }
+}
+\newcount\tikz@lib@circ@count
+\def\tikz@zero@text{0}
+\def\tikz@one@text{1}
+
+\def\tikz@lib@circ@compute@direction#1{%
+ \tikz@scan@one@point\tikz@lib@circ@save@start(\tikztostart)%
+ \tikz@scan@one@point\tikz@lib@circ@save@target(\tikztotarget)%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\tikz@lib@circ@start}{\tikz@lib@circ@target}}}%
+ \pgf@ya=-\pgf@y%
+ \pgftransformcm{\the\pgf@x}{\the\pgf@y}{\the\pgf@ya}{\the\pgf@x}{#1}%
+}
+\def\tikz@lib@circ@save@start#1{\def\tikz@lib@circ@start{#1}}
+\def\tikz@lib@circ@save@target#1{\def\tikz@lib@circ@target{#1}}
+
+\tikzset{
+ circuits/pos grabber/.is family,
+ pos/.belongs to family=/tikz/circuits/pos grabber,
+ at start/.belongs to family=/tikz/circuits/pos grabber,
+ very near start/.belongs to family=/tikz/circuits/pos grabber,
+ near start/.belongs to family=/tikz/circuits/pos grabber,
+ midway/.belongs to family=/tikz/circuits/pos grabber,
+ near end/.belongs to family=/tikz/circuits/pos grabber,
+ very near end/.belongs to family=/tikz/circuits/pos grabber,
+ at end/.belongs to family=/tikz/circuits/pos grabber
+}
+
+
+%
+% Declaring a new symbol
+%
+\tikzset{
+ circuit declare symbol/.style args={#1}{
+ % Declares a new circuit symbol.
+ %
+ % #1 = name
+ % #2 = factor for default minimum width
+ % #3 = factor for default minimum height
+ %
+ % The following styles are defined:
+ %
+ % #1
+ % Can be given as an option to a "node" command or to a "to"
+ % command. It takes a set of options as parameter that will be
+ % passed to the option.
+ %
+ % set #1 graphic
+ % This keys can be set to the necessary options to make a normal
+ % node look like the symbol. For instance, for a resistor that is
+ % rendered as a rectangle, this keys can be set, basically, to
+ % "rectangle,draw". Set this key to use a different appearance for
+ % symbols of kind #1.
+ %
+ % every #1
+ % This style will be included with every symbols of this kind and
+ % can be used to configure them further.
+ %
+ % every circuit symbol
+ % This style is also included with every symbol.
+ #1/.style={circuit handle symbol={
+ inner sep=0.5pt,
+ every circuit symbol,
+ #1/graphic,
+ every #1/.try,
+ ##1}
+ },
+ #1/graphic/.style={},
+ set #1 graphic/.style={#1/graphic/.style={##1}}
+ },
+ circuit symbol unit/.code=\pgfmathsetlength\tikzcircuitssizeunit{#1},
+ circuit symbol size/.style args={width #1 height #2}{
+ minimum width=#1*\tikzcircuitssizeunit,
+ minimum height=#2*\tikzcircuitssizeunit
+ },
+ huge circuit symbols/.style={circuit symbol unit=10pt},
+ large circuit symbols/.style={circuit symbol unit=8pt},
+ medium circuit symbols/.style={circuit symbol unit=7pt},
+ small circuit symbols/.style={circuit symbol unit=6pt},
+ tiny circuit symbols/.style={circuit symbol unit=5pt},
+}
+
+\newdimen\tikzcircuitssizeunit
+\tikzcircuitssizeunit=7pt
+
+
+%
+% Annotations
+%
+
+\tikzset{
+ circuit declare annotation/.style args={#1#2#3}{%
+ #1/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true]
+ [every circuit annotation/.try]
+ [every #1/.try]
+ [shift={(\tikzlastnode.north)}]
+ [annotation arrow,->]
+ [label distance=#2,##1]
+ #3
+ \egroup%
+ }
+ },
+ #1'/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true]
+ [every circuit annotation/.try]
+ [every #1/.try]
+ [shift={(\tikzlastnode.south)},yscale=-1]
+ [annotation arrow,->]
+ [label distance=#2,##1]
+ #3
+ \egroup%
+ }
+ }
+ },
+ annotation arrow/.style = {
+ /utils/exec={\pgfsetarrowoptions{direction ee}{.4*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth}},
+ >=direction ee
+ }
+}
+
+
+
+%
+% Rotating symbols
+%
+\tikzset{
+ point up/.style={rotate=90},
+ point down/.style={rotate=-90},
+ point left/.style={rotate=180},
+ point right/.style={}
+}
+
+
+
+%
+% Basic theming
+%
+
+\tikzset{
+ every circuit symbol/.style={},
+ circuit symbol open/.style={draw},
+ circuit symbol filled/.style={draw,fill=black},
+ circuit symbol lines/.style={draw},
+ circuit symbol wires/.style={draw},
+}
+
+
+
+
+
+%
+% Labels
+%
+
+\tikzset{
+ info/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@plain{\tikz@lib@circ@lab@plain[]}#1\pgf@stop},%}
+ info'/.code={\pgfutil@ifnextchar[\tikz@lib@circ@labp@plain{\tikz@lib@circ@labp@plain[]}#1\pgf@stop},%}
+ info sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@sloped@plain{\tikz@lib@circ@lab@sloped@plain[]}#1\pgf@stop},%}
+ info' sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@slopedp@plain{\tikz@lib@circ@lab@slopedp@plain[]}#1\pgf@stop},%}
+ circuit declare unit/.style 2 args={
+ %
+ % Defines four styles that can be used to add labels to a node.
+ %
+ #1/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab{\tikz@lib@circ@lab[]}##1\pgf@stop{#2}{#1}},%}
+ #1 sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@sloped{\tikz@lib@circ@lab@sloped[]}##1\pgf@stop{#2}{#1}},%}
+ #1'/.code={\pgfutil@ifnextchar[\tikz@lib@circ@labp{\tikz@lib@circ@labp[]}##1\pgf@stop{#2}{#1}},%}
+ #1' sloped/.code={\pgfutil@ifnextchar[\tikz@lib@circ@lab@slopedp{\tikz@lib@circ@lab@slopedp[]}##1\pgf@stop{#2}{#1}}%}
+ }
+}
+
+\def\tikz@lib@circ@lab[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,#1]$\mathrm{#2#3}$}}}
+\def\tikz@lib@circ@lab@sloped[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,transform shape,#1]$\mathrm{#2#3}$}}}
+\def\tikz@lib@circ@labp[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,#1]below:$\mathrm{#2#3}$}}}
+\def\tikz@lib@circ@lab@slopedp[#1]#2\pgf@stop#3#4{\tikzset{label={[every info/.try,every #4/.try,transform shape,#1]below:$\mathrm{#2#3}$}}}
+
+\def\tikz@lib@circ@lab@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,#1]#2}}}
+\def\tikz@lib@circ@lab@sloped@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,transform shape,#1]#2}}}
+\def\tikz@lib@circ@labp@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,#1]below:#2}}}
+\def\tikz@lib@circ@lab@slopedp@plain[#1]#2\pgf@stop{\tikzset{label={[every info/.try,transform shape,#1]below:#2}}}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
new file mode 100644
index 00000000000..1de9232e63c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
@@ -0,0 +1,376 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits.ee}
+\usetikzlibrary{arrows}
+
+\usepgflibrary{shapes.gates.ee.IEC}
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit ee IEC/.style=
+ {
+ circuit ee,
+ set resistor graphic = resistor IEC graphic,
+ set inductor graphic = inductor IEC graphic,
+ set capacitor graphic = capacitor IEC graphic,
+ set contact graphic = contact IEC graphic,
+ set ground graphic = ground IEC graphic,
+ set battery graphic = battery IEC graphic,
+ set diode graphic = diode IEC graphic,
+ set Zener diode graphic = Zener diode IEC graphic,
+ set tunnel diode graphic = tunnel diode IEC graphic,
+ set backward diode graphic = backward diode IEC graphic,
+ set Schottky diode graphic = Schottky diode IEC graphic,
+ set breakdown diode graphic = breakdown diode IEC graphic,
+ set bulb graphic = bulb IEC graphic,
+ set voltage source graphic = voltage source IEC graphic,
+ set current source graphic = current source IEC graphic,
+ set make contact graphic = make contact IEC graphic,
+ set break contact graphic = break contact IEC graphic,
+ }
+}
+
+
+%
+% Resistors
+%
+
+\tikzset{
+ resistor IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 4 height 1,
+ shape=rectangle ee,
+ transform shape
+ },
+ var resistor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 4.8 height 0.8,
+ shape=var resistor IEC,
+ transform shape,
+ outer sep=0pt,
+ cap=round
+ }
+}
+
+
+
+%
+% Inductors
+%
+
+\tikzset{
+ inductor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 4 height .5,
+ transform shape,
+ shape=inductor IEC,
+ outer sep=0pt,
+ cap=round
+ },
+ var inductor IEC graphic/.style={
+ circuit symbol filled,
+ circuit symbol size=width 4 height 1,
+ transform shape,
+ shape=rectangle ee
+ }
+}
+
+
+
+%
+% Capacitors
+%
+
+\tikzset{
+ capacitor IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .5 height 2,
+ transform shape,
+ shape=capacitor IEC
+ }
+}
+
+
+
+%
+% Ground
+%
+
+\tikzset{
+ ground IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .75 height 2,
+ transform shape,
+ shape=ground IEC
+ }
+}
+
+
+
+
+%
+% Battery
+%
+
+\tikzset{
+ battery IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width .5 height 2.5,
+ transform shape,
+ shape=battery IEC,
+ transform shape
+ }
+}
+
+
+
+%
+% Diodes
+%
+
+\tikzset{
+ %
+ % normal diode
+ %
+ diode IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 1.25 height 1.25,
+ transform shape,
+ shape=generic diode IEC,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var diode IEC graphic/.style={
+ diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+\tikzset{
+ %
+ % Zener diode
+ %
+ Zener diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var Zener diode IEC graphic/.style={
+ Zener diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+\tikzset{
+ %
+ % Schottky diode
+ %
+ Schottky diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.4pt}{-.6pt}}
+ \pgfpathlineto{\pgfqpoint{-.4pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.4pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.4pt}{.6pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var Schottky diode IEC graphic/.style={
+ Schottky diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+\tikzset{
+ %
+ % tunnel diode
+ %
+ tunnel diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{-.5pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var tunnel diode IEC graphic/.style={
+ tunnel diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+\tikzset{
+ %
+ % backward diode
+ %
+ backward diode IEC graphic/.style={
+ diode IEC graphic,
+ /pgf/generic diode IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}}
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ },
+ var backward diode IEC graphic/.style={
+ backward diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+
+\tikzset{
+ %
+ % breakdown diode
+ %
+ breakdown diode IEC graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2.5 height 1.25,
+ transform shape,
+ shape=breakdown diode IEC,
+ },
+ var breakdown diode IEC graphic/.style={
+ breakdown diode IEC graphic,
+ circuit symbol filled
+ }
+}
+
+
+
+%
+% Contacts
+%
+
+\tikzset{
+ contact IEC graphic/.style={
+ circuit symbol filled,
+ circuit symbol size=width .5 height .5,
+ shape=circle ee,
+ outer sep=.25\pgflinewidth
+ },
+% connection IEC graphic/.style={
+% circuit symbol open,
+% circuit symbol size=width 1 height 1,
+% shape=circle ee,
+% outer sep=.25\pgflinewidth
+% }
+}
+
+
+%
+% Bulbs
+%
+
+\tikzset{
+ bulb IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 1.5 height 1.5,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfpointpolar{-135}{1pt}}
+ \pgfpathlineto{\pgfpointpolar{45}{1pt}}
+ \pgfpathmoveto{\pgfpointpolar{-45}{1pt}}
+ \pgfpathlineto{\pgfpointpolar{135}{1pt}}
+ \pgfusepathqstroke
+ },
+ transform shape
+ }
+}
+
+
+%
+% Current and voltage sources
+%
+
+\tikzset{
+ current source IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfusepathqstroke
+ },
+ transform shape
+ },
+ voltage source IEC graphic/.style={
+ circuit symbol lines,
+ circuit symbol size=width 2 height 2,
+ shape=generic circle IEC,
+ /pgf/generic circle IEC/before background={
+ \pgfpathmoveto{\pgfqpoint{-1pt}{0pt}}
+ \pgfpathlineto{\pgfqpoint{1pt}{0pt}}
+ \pgfusepathqstroke
+ },
+ transform shape
+ }
+}
+
+
+
+%
+% Contacts
+%
+
+\tikzset{
+ make contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2 height 1,
+ transform shape,
+ shape=make contact IEC,
+ outer sep=0pt,
+ cap=round
+ },
+ var make contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2.4 height 1,
+ transform shape,
+ shape=var make contact IEC,
+ outer sep=0pt,
+ cap=round
+ }
+}
+
+
+\tikzset{
+ break contact IEC graphic/.style={
+ circuit symbol wires,
+ circuit symbol size=width 2 height 1,
+ transform shape,
+ shape=break contact IEC,
+ outer sep=0pt,
+ cap=round
+ },
+}
+
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
new file mode 100644
index 00000000000..91641309ab5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
@@ -0,0 +1,158 @@
+
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits}
+\usepgflibrary{shapes.gates.ee}
+
+
+%
+% Setting up an ee circuit
+%
+\tikzset{
+ circuit ee/.style={
+ circuit,
+ every circuit ee/.try
+ }
+}
+
+
+%
+% The default symbols (you need to load a sublib to install the actual rendering).
+%
+
+\tikzset{
+ circuit declare symbol = resistor,
+ circuit declare symbol = inductor,
+ circuit declare symbol = capacitor,
+ circuit declare symbol = contact,
+ circuit declare symbol = ground,
+ circuit declare symbol = battery,
+ circuit declare symbol = diode,
+ circuit declare symbol = Zener diode,
+ circuit declare symbol = Schottky diode,
+ circuit declare symbol = tunnel diode,
+ circuit declare symbol = backward diode,
+ circuit declare symbol = breakdown diode,
+ circuit declare symbol = bulb,
+ circuit declare symbol = current source,
+ circuit declare symbol = voltage source,
+ circuit declare symbol = current direction,
+ circuit declare symbol = current direction',
+ circuit declare symbol = make contact,
+ circuit declare symbol = break contact,
+ %
+ set current direction graphic = current direction ee graphic,
+ set current direction' graphic = current direction' ee graphic,
+}
+
+
+%
+% The default labels
+%
+
+\tikzset{
+ circuit declare unit={ampere}{A},
+ circuit declare unit={volt}{V},
+ circuit declare unit={ohm}{\Omega},
+ circuit declare unit={siemens}{S},
+ circuit declare unit={henry}{H},
+ circuit declare unit={farad}{F},
+ circuit declare unit={coulomb}{C},
+ circuit declare unit={voltampere}{VA},
+ circuit declare unit={watt}{W},
+ circuit declare unit={hertz}{Hz},
+}
+
+
+
+%
+% The direction and arrow settings
+%
+
+\tikzset{
+ % These styles should set the end-arrow.
+ %
+ % This arrow will generally be used to indicate current directions in a circuit:
+ current direction arrow/.style = {
+ /utils/exec={\pgfsetarrowoptions{direction ee}{1.3065*.5*\the\tikzcircuitssizeunit+1.3065*.3*\the\pgflinewidth}},
+ >=direction ee,
+ direction ee arrow = direction ee,
+ }
+}
+
+
+
+
+\tikzset{
+ current direction ee graphic/.style = {
+ shape=direction ee,
+ circuit symbol filled,
+ current direction arrow,
+ minimum width = .5*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth,
+ minimum height = .5*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth,
+ transform shape
+ },
+ current direction' ee graphic/.style = {
+ current direction ee graphic,
+ rotate=180
+ }
+}
+
+
+
+%
+% Annotations
+%
+
+\tikzset{
+ circuit declare annotation={direction info}{.5\tikzcircuitssizeunit}
+ {
+ (-1.25\tikzcircuitssizeunit,.3333\tikzcircuitssizeunit) edge[line to] (1.25\tikzcircuitssizeunit,.3333\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={light emitting}{1.75\tikzcircuitssizeunit}
+ {
+ (-.2\tikzcircuitssizeunit,.65\tikzcircuitssizeunit) edge[line to] ++(45:1.25\tikzcircuitssizeunit)
+ (.2\tikzcircuitssizeunit,.25\tikzcircuitssizeunit) edge[line to] ++(45:1.25\tikzcircuitssizeunit)
+ },
+ circuit declare annotation={light dependent}{1.75\tikzcircuitssizeunit}
+ {
+ [shift=(135:1.25\tikzcircuitssizeunit)]
+ (.2\tikzcircuitssizeunit,.65\tikzcircuitssizeunit) edge[line to] ++(-45:1.25\tikzcircuitssizeunit)
+ (-.2\tikzcircuitssizeunit,.25\tikzcircuitssizeunit) edge[line to] ++(-45:1.25\tikzcircuitssizeunit)
+ },
+ adjustable/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true]
+ [every adjustable/.try]
+ [annotation arrow,->]
+ let \p1=(\tikzlastnode.north), \p2=(\tikzlastnode.south) in
+ [label distance=1.5\tikzcircuitssizeunit-.5*abs(\y2-\y1),#1]
+ (-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)
+ \egroup%
+ }
+ },
+ adjustable'/.style={
+ append after command={%
+ \bgroup
+ [current point is local=true,yscale=-1]
+ [every adjustable/.try]
+ [annotation arrow,->]
+ let \p1=(\tikzlastnode.north), \p2=(\tikzlastnode.south) in
+ [label distance=1.5\tikzcircuitssizeunit-.5*abs(\y2-\y1),#1]
+ (-1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit)
+ \egroup%
+ }
+ }
+}
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex
new file mode 100644
index 00000000000..4fe276ff0a0
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex
@@ -0,0 +1,29 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits.logic.US}
+
+\tikzset{
+ circuit logic CDH/.style =
+ {
+ circuit logic US,
+ set and gate graphic = and gate CDH graphic,
+ set nand gate graphic = nand gate CDH graphic,
+ }
+}
+
+\tikzset{
+ circuit logic US make graphic=and gate CDH,
+ circuit logic US make graphic=nand gate CDH,
+}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex
new file mode 100644
index 00000000000..64d1f764b71
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex
@@ -0,0 +1,76 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits.logic}
+\usepgflibrary{shapes.gates.logic.IEC}
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit logic IEC/.style=
+ {
+ circuit logic,
+ set and gate graphic = and gate IEC graphic,
+ set nand gate graphic = nand gate IEC graphic,
+ set or gate graphic = or gate IEC graphic,
+ set nor gate graphic = nor gate IEC graphic,
+ set xor gate graphic = xor gate IEC graphic,
+ set xnor gate graphic = xnor gate IEC graphic,
+ set not gate graphic = not gate IEC graphic,
+ set buffer gate graphic = buffer gate IEC graphic,
+ %
+ and gate IEC symbol = {$\scriptstyle\char`\&$},
+ nand gate IEC symbol = {$\scriptstyle\char`\&$},
+ or gate IEC symbol = {$\scriptstyle\geq1$},
+ nor gate IEC symbol = {$\scriptstyle\geq1$},
+ xor gate IEC symbol = {$\scriptstyle=1$},
+ xnor gate IEC symbol = {$\scriptstyle=1$},
+ not gate IEC symbol = {$\scriptstyle1$},
+ buffer gate IEC symbol = {$\scriptstyle1$},
+ },
+}
+
+
+%
+% The logical gate graphics are all nearly identical, so we provide a
+% simple style for creating them:
+%
+\tikzset{
+ circuit logic IEC make graphic/.style=
+ {
+ #1 graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 2.5 height 4,
+ shape=#1,
+ inner sep=.5ex
+ }
+ }
+}
+
+
+\tikzset{
+ circuit logic IEC make graphic=and gate IEC,
+ circuit logic IEC make graphic=nand gate IEC,
+ circuit logic IEC make graphic=or gate IEC,
+ circuit logic IEC make graphic=nor gate IEC,
+ circuit logic IEC make graphic=xor gate IEC,
+ circuit logic IEC make graphic=xnor gate IEC,
+ circuit logic IEC make graphic=not gate IEC,
+ circuit logic IEC make graphic=buffer gate IEC,
+ circuit logic IEC make graphic=and gate CDH,
+ circuit logic IEC make graphic=nand gate CDH,
+}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex
new file mode 100644
index 00000000000..1f724912549
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex
@@ -0,0 +1,65 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits.logic}
+\usepgflibrary{shapes.gates.logic.US}
+
+
+%
+% When this lib is loaded, all symbols default to IEC
+%
+
+\tikzset{
+ circuit logic US/.style=
+ {
+ circuit logic,
+ set and gate graphic = and gate US graphic,
+ set nand gate graphic = nand gate US graphic,
+ set or gate graphic = or gate US graphic,
+ set nor gate graphic = nor gate US graphic,
+ set xor gate graphic = xor gate US graphic,
+ set xnor gate graphic = xnor gate US graphic,
+ set not gate graphic = not gate US graphic,
+ set buffer gate graphic = buffer gate US graphic
+ }
+}
+
+
+%
+% The logical gate graphics are all nearly identical, so we provide a
+% simple style for creating them:
+%
+\tikzset{
+ circuit logic US make graphic/.style=
+ {
+ #1 graphic/.style={
+ circuit symbol open,
+ circuit symbol size=width 0 height 2.5,
+ shape=#1,
+ transform shape
+ }
+ }
+}
+
+
+\tikzset{
+ circuit logic US make graphic=and gate US,
+ circuit logic US make graphic=nand gate US,
+ circuit logic US make graphic=or gate US,
+ circuit logic US make graphic=nor gate US,
+ circuit logic US make graphic=xor gate US,
+ circuit logic US make graphic=xnor gate US,
+ circuit logic US make graphic=not gate US,
+ circuit logic US make graphic=buffer gate US,
+}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex
new file mode 100644
index 00000000000..0fc662f92c5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex
@@ -0,0 +1,46 @@
+% Copyright 2008 by Till Tantau and Mark Wibrow
+%
+% 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.
+
+\usetikzlibrary{circuits}
+
+
+
+%
+% Provides a shortcut to the "logic gates inputs" key.
+%
+
+\tikzset{
+ circuit logic/.style={
+ circuit,
+ inputs/.style={logic gate inputs={##1}},
+ logic gate inverted radius=.25\tikzcircuitssizeunit,
+ every circuit logic/.try,
+ }
+}
+
+
+
+%
+% The default symbols (you need to load a sublib to install the actual rendering).
+%
+
+\tikzset{
+ circuit declare symbol = and gate,
+ circuit declare symbol = nand gate,
+ circuit declare symbol = or gate,
+ circuit declare symbol = nor gate,
+ circuit declare symbol = xor gate,
+ circuit declare symbol = xnor gate,
+ circuit declare symbol = not gate,
+ circuit declare symbol = buffer gate
+}
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex
new file mode 100644
index 00000000000..8018de58018
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex
@@ -0,0 +1,80 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex,v 1.1 2008/12/17 22:48:46 tantau Exp $
+
+\usetikzlibrary{datavisualization}
+
+
+
+% The following is not yet really implement. But you might get the idea...
+
+
+
+% A 3d version of the school book plot
+
+\tikzdatavisualizationset{
+ school book 3d plot/.style={
+ xyz Cartesian,
+ x axis={
+ visualize axis={y axis={goto=0},z axis={goto=0},styling/.style=->},
+ visualize ticks={common={y axis={goto=0},z axis={goto=0},direction axis=y axis},only ticks={tick text at min extend}},
+% visualize ticks={common={y axis={goto=0},z axis={goto=0},direction axis=z axis}},
+ },
+ y axis={
+ visualize axis={x axis={goto=0},z axis={goto=0},styling/.style=->},
+ visualize ticks={common={x axis={goto=0},z axis={goto=0},direction axis=x axis},only ticks={tick text at min extend}},
+% visualize ticks={common={x axis={goto=0},z axis={goto=0},direction axis=z axis}},
+ },
+ z axis={
+ visualize axis={x axis={goto=0},y axis={goto=0},styling/.style=->},
+ visualize ticks={common={x axis={goto=0},y axis={goto=0},direction axis=x axis},only ticks={tick text at min extend}},
+% visualize ticks={common={x axis={goto=0},y axis={goto=0},direction axis=y axis}}
+ },
+ new line plot,
+ every school book plot/.try
+ }
+}
+
+
+% A 3d version of the scientific plot
+%
+% Here, a "length" is used for the length of the three
+% axes, rather than a predetermined rectangle (this does not really
+% make sense for the z-axis. You overrule these settings easily.
+
+\tikzdatavisualizationset{
+ scientific 3d plot/length/.initial=100pt,
+ scientific 3d plot/.style={
+ xyz Cartesian,
+ x axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific 3d plot/length},
+ visualize axis={y axis={goto=min},z axis={goto=min}},
+ visualize axis={y axis={goto=max},z axis={goto=min}},
+ visualize axis={y axis={goto=min},z axis={goto=max}},
+ visualize axis={y axis={goto=max},z axis={goto=max}}
+ },
+ y axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific 3d plot/length},
+ visualize axis={x axis={goto=min},z axis={goto=min}},
+ visualize axis={x axis={goto=max},z axis={goto=min}},
+ visualize axis={x axis={goto=min},z axis={goto=max}},
+ visualize axis={x axis={goto=max},z axis={goto=max}}
+ },
+ z axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific 3d plot/length},
+ visualize axis={x axis={goto=min},y axis={goto=min}},
+ visualize axis={x axis={goto=max},y axis={goto=min}},
+ visualize axis={x axis={goto=min},y axis={goto=max}},
+ visualize axis={x axis={goto=max},y axis={goto=max}}
+ },
+ new line plot
+ }
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex
new file mode 100644
index 00000000000..40fa0e87169
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex
@@ -0,0 +1,43 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex,v 1.2 2008/07/21 06:22:22 tantau Exp $
+
+\usetikzlibrary{datavisualization}
+\usepgflibrary{datavisualization.barcharts}
+
+
+\tikzdatavisualizationset{%
+ candle stick plot/.style={
+ new object={
+ store=/tikz/data visualization/count,
+ class=count,
+ arg1=day
+ },
+ new axis=y axis,
+ y axis/source=dax,
+ y axis/source max=100,
+ y axis/vec=\pgfqpoint{0cm}{1cm},
+ new object={
+ store=/tikz/data visualization/x line trans,
+ class=line transformer,
+ arg1=day,
+ arg2=\pgfqpoint{3mm}{0mm}
+ },
+ new object={
+ store=/tikz/data visualization/index,
+ class=candle stick visualizer,
+ arg1 from key=index/source
+ },
+ },
+ index/source/.initial=index,
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex
new file mode 100644
index 00000000000..c717e95cf7b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex
@@ -0,0 +1,2278 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex,v 1.31 2010/09/15 22:27:36 tantau Exp $
+
+\usepgfmodule{datavisualization}
+\usetikzlibrary{backgrounds}
+
+
+\tikzset{/tikz/data visualization/.is family,
+ /tikz/data visualization/.unknown/.code={
+ \let\tikz@dv@key\pgfkeyscurrentname%
+ \pgfkeys{/tikz/\tikz@dv@key/.try={#1}}%
+ \ifpgfkeyssuccess%
+ \else%
+ \pgfkeys{/errors/unknown key={/tikz/data visualization/\tikz@dv@key}{#1}}%
+ \fi%
+ },
+ /tikz/data visualization/data/.unknown/.code={%
+ % Redirect to /pgf/data
+ \let\tikz@dv@key\pgfkeyscurrentname%
+ \pgfkeys{/pgf/data/\tikz@dv@key/.try={#1}}%
+ \ifpgfkeyssuccess%
+ \else%
+ \pgfkeys{/errors/unknown key={/pgf/data/\tikz@dv@key}{#1}}%
+ \fi%
+ }
+}
+
+\def\tikzdatavisualizationset{\pgfqkeys{/tikz/data visualization}}
+
+
+
+
+% The main \datavisualization command
+%
+% This command must, as always, be given inside a tikz picture. It
+% will add a data visualization to the picture; use "shift" option and
+% friends to place the data visualization somewhere other than at the
+% origin.
+%
+% The \datavisualization is followed by a sequence of blocks and ended
+% with a semicolon. Each block may be one of the following:
+%
+% "data" blocks.
+%
+% Syntax: data [options] % options specify an external source
+% Syntax: data [options] { inline data }
+%
+% The optional arguments may either specify an
+% external data source or the data may follow inline.
+%
+% The options are executed for the path /pgf/data. The style
+% /tikz/every data is executed for each data, which can be useful to
+% generally set, say, a certain data format.
+%
+% "info" blocks.
+%
+% Syntax: info [options] {code}
+%
+% A block starting with "info" may contain any code. It
+% will be executed after the visualization. In order to execute code
+% at some other time (like, say, before the visualization), use
+% options like "before visualization".
+%
+% Options blocks.
+%
+% Syntax: [options]
+%
+% The options will be executed immediately.
+%
+% Scope blocks.
+%
+% Syntax: scope[options] { blocks }
+%
+% The blocks are executed inside a scope for which the options are
+% set. This can be used to group data blocks.
+%
+% Examples:
+%
+% \datavisualization[schoolbook plot]
+% data [source=my_data_file.csv]
+% ;
+%
+% \datavisualization[schoolbook plot]
+% data [format=key value pairs]
+% {
+% x=0, y=0
+% x=1, y=1
+% x=2, y=4
+% x=3, y=9
+% };
+%
+% \datavisualization[schoolbook plot]
+% data [format=function]
+% {
+% var x: interval [0:3];
+% func y = \value x*\value x;
+% }
+% [before visualization={
+% \fill [black!10] (visualization cs:x=0,y=0) -- (visualization cs:x=3,y=9);
+% }]
+% info[red]
+% {
+% \draw (visualization cs:x=0,y=0) -- (visualization cs:x=3,y=9);
+% };
+%
+% \datavisualization[schoolbook plot]
+% data [/data point/label=first experiment,source=file_1]
+% data [/data point/label=second experiment,source=file_2]
+% data [/data point/label=third experiment,source=file_3]
+% data [/data point/label=prediction,format=function]
+% { var x: interval [0,1]; func y = rand(\value x); }
+% ;
+
+\def\tikz@lib@datavisualization{
+ \begingroup%
+ % Ok, first, start a new data visualization
+ \pgfoonew \tikz@main@dv=new data visualization()%
+ % Next, create a scope for the dv
+ \pgfset{local bounding box=data visualization bounding box}%
+ % Clear the axis list
+ \pgfkeyslet{/tikz/data visualization/axes list}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/axes actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/label actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/legend actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/grid actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/major grid actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/minor grid actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/subminor grid actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/ticks actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/major ticks actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/minor ticks actions}\pgfutil@empty%
+ \pgfkeyslet{/tikz/data visualization/subminor ticks actions}\pgfutil@empty%
+ \tikz@main@dv.before visualization(%
+ )%
+ \tikz@main@dv.after visualization(%
+ \pgfkeysvalueof{/tikz/data visualization/grid actions}
+ \pgfkeysvalueof{/tikz/data visualization/subminor grid actions}
+ \pgfkeysvalueof{/tikz/data visualization/minor grid actions}
+ \pgfkeysvalueof{/tikz/data visualization/major grid actions}
+ \pgfkeysvalueof{/tikz/data visualization/ticks actions}
+ \pgfkeysvalueof{/tikz/data visualization/subminor ticks actions}
+ \pgfkeysvalueof{/tikz/data visualization/minor ticks actions}
+ \pgfkeysvalueof{/tikz/data visualization/major ticks actions}
+ \pgfkeysvalueof{/tikz/data visualization/axes actions}
+ \pgfkeysvalueof{/tikz/data visualization/label actions}
+ \pgfkeysvalueof{/tikz/data visualization/legend actions}
+ )%
+ %
+ \pgfset{/pgf/data/continue code=\tikz@lib@dv@parse@loop}%
+ % Now enter parse loop
+ \tikz@lib@dv@parse@loop
+}
+
+\def\tikz@lib@dv@parse@loop{%
+ \pgfutil@ifnextchar d\tikz@lib@dv@handle@data{%
+ \pgfutil@ifnextchar ;\tikz@lib@dv@parse@end{%
+ \pgfutil@ifnextchar \par\tikz@lib@dv@handle@par{%
+ \pgfutil@ifnextchar s\tikz@lib@dv@handle@beginscope{%
+ \pgfutil@ifnextchar i\tikz@lib@dv@handle@info{%
+ \pgfutil@ifnextchar [\tikz@lib@dv@handle@options{%
+ \pgfutil@ifnextchar \egroup\tikz@lib@dv@handle@endscope{%
+ \PackageError{tikz}{Semicolon expected}{}%
+ \endgroup%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+}
+\def\tikz@lib@dv@parse@end{%
+ % Go!
+ \tikz@main@dv.survey()%
+ \tikz@main@dv.visualize()%
+ \endgroup%
+}
+\def\tikz@lib@dv@handle@par\par{\tikz@lib@dv@parse@loop}
+
+\def\tikz@lib@dv@handle@options[#1]{%
+ \tikzdatavisualizationset{#1}%
+ \tikz@lib@dv@parse@loop%
+}
+
+\def\tikz@lib@dv@handle@beginscope scope{%
+ \begingroup%
+ \pgfutil@ifnextchar[\tikz@lib@dv@beg@opt{\tikz@lib@dv@beg@opt[]}%}
+}
+\def\tikz@lib@dv@beg@opt[#1]{%
+ \pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}%
+ \pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\begingroup\pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}}})%
+ \pgfutil@ifnextchar\bgroup{
+ \afterassignment\tikz@lib@dv@parse@loop%
+ \let\tikz@dummy=%get rid of \bgroup
+ }{%
+ \PackageError{pgf}{Opening brace expected}{}%
+ }%
+}
+\def\tikz@lib@dv@handle@endscope{%
+ \pgfkeysvalueof{/pgf/data visualization/obj}.add data(\endgroup)%
+ \endgroup%
+ \afterassignment\tikz@lib@dv@parse@loop%
+ \let\tikz@dummy=%get rid of \egroup
+}
+
+\def\tikz@lib@dv@handle@data data{\pgfdata}
+
+\def\tikz@lib@dv@handle@info info{
+ \pgfutil@ifnextchar[{\tikz@lib@dv@handle@info@block@opt}{\tikz@lib@dv@handle@info@block@opt[]}}%}
+\def\tikz@lib@dv@handle@info@block@opt[#1]#2{%
+ \tikz@main@dv.after visualization({{\scope[#1]#2\endscope}})%
+ \tikz@lib@dv@parse@loop
+}
+
+
+\pgfset{/pgf/every data/.style={/tikz/every data/.try,/tikz/data visualization/every data/.try}}
+
+
+%
+% Performing before/after stuff via keys
+%
+
+\tikzdatavisualizationset{
+ before survey/.code=\tikz@main@dv.before survey({{#1}}),
+ after survey/.code=\tikz@main@dv.after survey({{#1}}),
+ before visualization/.code=\tikz@main@dv.before visualization({{#1}}),
+ after visualization/.code=\tikz@main@dv.after visualization({{#1}}),
+ at start survey/.code=\tikz@main@dv.at start survey({{#1}}),
+ at end survey/.code=\tikz@main@dv.at end survey({{#1}}),
+ at start visualization/.code=\tikz@main@dv.at start visualization({{#1}}),
+ at end visualization/.code=\tikz@main@dv.at end visualization({{#1}}),
+}
+
+
+
+%
+% Object setup
+%
+
+% The following key is used to create objects for the rendering
+% pipeline. They cannot be created "directly" because when it is known
+% that the objects needs to be created, in principle, many keys may
+% not yet be known.
+%
+% The following options are used:
+%
+% store = key that will store the object (handle)
+% class = class of the object
+% arg1 = argument1 of the constructor
+% ...
+% arg8 = argument8 of the constructor
+% when = specifies when the object will be created. Defaults to
+% "before survey", other possible values are "after survey" and
+% "before/after visualization"
+% before creation = code to be executed just before the object is
+% created
+% after creation = code to be executed just after the object has been created
+%
+% The following styles may be useful:
+%
+% arg1 from key = use the contents of the given key as arg1. Similar
+% for other args
+% arg1 handle from key = the contents of the given key should contain
+% an object. Then arg1 will be a handle to this
+% object. Similar for other args
+
+\tikzdatavisualizationset{%
+ new object/.code={%
+ \def\tikz@dv@grabbed@when{before survey}%
+ \let\tikz@dv@grabbed@store\pgfutil@empty
+ \pgfkeys{/tikz/data visualization/new object/grab/.cd,#1}%
+ \ifx\tikz@dv@grabbed@store\pgfutil@empty
+ \else
+ \pgfkeyslet{\tikz@dv@grabbed@store}\pgfutil@empty%
+ \fi
+ \edef\tikz@marshal{\noexpand\tikz@main@dv.\tikz@dv@grabbed@when(\noexpand\tikz@dv@newobject{\tikz@dv@grabbed@store}}%
+ \tikz@marshal{#1})%
+ },
+ new object/grab/store/.store in=\tikz@dv@grabbed@store,
+ new object/grab/when/.store in=\tikz@dv@grabbed@when,
+ new object/grab/.unknown/.code={},%ignore
+}
+
+\def\tikz@dv@newobject#1#2{%
+ \def\tikz@dv@new@obj@store{#1}%
+ \ifx\tikz@dv@new@obj@store\pgfutil@empty%
+ \let\tikz@dv@new@obj=\pgfutil@empty%
+ \else%
+ \pgfkeysgetvalue\tikz@dv@new@obj@store\tikz@dv@new@obj%
+ \fi%
+ \ifx\tikz@dv@new@obj\pgfutil@empty
+ \let\tikz@dv@arg@a=\tikz@lib@notused%
+ \let\tikz@dv@arg@b=\tikz@lib@notused%
+ \let\tikz@dv@arg@c=\tikz@lib@notused%
+ \let\tikz@dv@arg@d=\tikz@lib@notused%
+ \let\tikz@dv@arg@e=\tikz@lib@notused%
+ \let\tikz@dv@arg@f=\tikz@lib@notused%
+ \let\tikz@dv@arg@g=\tikz@lib@notused%
+ \let\tikz@dv@arg@h=\tikz@lib@notused%
+ \let\tikz@dv@new@after=\relax%
+ \pgfkeys{/tikz/data visualization/new object/parse/.cd,#2}
+ \edef\pgf@marshal{\noexpand\pgfoonew\noexpand\tikzdvobj=new \tikz@dv@new@class(}%
+ \tikz@dv@add@arg{}\tikz@dv@arg@a%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@b%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@c%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@d%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@e%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@f%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@g%
+ \tikz@dv@add@arg{\expandafter,}\tikz@dv@arg@h%
+ \expandafter\def\expandafter\pgf@marshal\expandafter{\pgf@marshal)}%
+ \pgf@marshal%
+ \tikzdvobj.default connects()%
+ \ifx\tikz@dv@new@obj@store\pgfutil@empty%
+ \else%
+ \pgfkeyslet\tikz@dv@new@obj@store\tikzdvobj%
+ \fi%
+ \tikz@dv@new@after%
+ \fi
+}
+\def\tikz@lib@notused{\tikz@lib@notused}
+
+\def\tikz@dv@add@arg#1#2{%
+ \ifx#2\tikz@lib@notused%
+ \else%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@marshal%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@marshal#1#2}%
+ \fi%
+}
+
+\tikzdatavisualizationset{%
+ new object/parse/.cd,
+ store/.code=,% ignore
+ when/.code=,% ignore
+ class/.store in=\tikz@dv@new@class,
+ before creation/.code=#1,
+ after creation/.store in=\tikz@dv@new@after,
+ arg1/.store in=\tikz@dv@arg@a,
+ arg2/.store in=\tikz@dv@arg@b,
+ arg3/.store in=\tikz@dv@arg@c,
+ arg4/.store in=\tikz@dv@arg@d,
+ arg5/.store in=\tikz@dv@arg@e,
+ arg6/.store in=\tikz@dv@arg@f,
+ arg7/.store in=\tikz@dv@arg@g,
+ arg8/.store in=\tikz@dv@arg@h,
+ arg1 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@a},
+ arg2 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@b},
+ arg3 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@c},
+ arg4 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@d},
+ arg5 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@e},
+ arg6 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@f},
+ arg7 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@g},
+ arg8 from key/.code=\pgfkeysgetvalue{#1}{\tikz@dv@arg@h}
+ arg1 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@a}{\tikz@dv@arg@a},
+ arg2 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@b}{\tikz@dv@arg@b},
+ arg3 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@c}{\tikz@dv@arg@c},
+ arg4 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@d}{\tikz@dv@arg@d},
+ arg5 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@e}{\tikz@dv@arg@e},
+ arg6 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@f}{\tikz@dv@arg@f},
+ arg7 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@g}{\tikz@dv@arg@g},
+ arg8 handle from key/.code=\tikz@dv@handle@from@key{#1}{\tikz@dv@handle@h}{\tikz@dv@arg@h}
+}
+
+\def\tikz@dv@handle@from@key#1#2#3{%
+ \pgfkeysvalueof{#1}.get handle(#2)%
+ \def#3{#2}%
+}
+
+
+
+
+%
+% Data visualization coordinate system
+%
+%
+% This cs is used to refer to points in a datavisualization. The
+% parameters are keys that are set in the /data point key
+% directory. Then, a (virtual) data point is created and the
+% calculated position is returned
+
+\tikzdeclarecoordinatesystem{visualization}
+{%
+ \tikzset{/data point/.cd,#1}%
+ \pgfpointdvlocaldatapoint%
+}
+
+
+
+
+%
+%
+% Axes
+%
+%
+
+
+
+%
+% Axis base
+%
+
+\tikzdatavisualizationset{%
+ new axis/.style={
+ new object={
+ class=scaling mapper,
+ store=/tikz/data visualization/#1/scaling mapper,
+ before creation={
+ \pgfkeysgetvalue{/tikz/data visualization/#1/scaling}\tikz@temp
+ \ifx\tikz@temp\pgfutil@empty%
+ \pgfkeysgetvalue{/tikz/data visualization/#1/scaling/default}\tikz@temp
+ \fi
+ \expandafter\tikz@dv@lib@parse@scaling\tikz@temp\pgf@stop%
+ \pgfkeyslet{/tikz/data visualization/#1/scaling}\tikz@temp
+ },
+ arg1 from key=/tikz/data visualization/#1/attribute,
+ arg2/.expanded=\pgfkeysvalueof{/tikz/data visualization/#1/attribute}/scaled,
+ arg3 from key=/tikz/data visualization/#1/scaling,
+ arg4 from key=/tikz/data visualization/#1/function
+ },
+ #1/attribute/.initial=#1,
+ #1/function/.initial=,
+ #1/scaling/.initial=,
+ #1/scaling/default/.initial=0 at 0 and 1 at 1,
+ #1/ticks at/.initial=,
+ #1/default ticks at/.initial=,
+ #1/major ticks/.initial=,
+ #1/minor ticks/.initial=,
+ #1/subminor ticks/.initial=,
+ #1/grid at/.initial=,
+ #1/default grid at/.initial=,
+ #1/major grid/.initial=,
+ #1/minor grid/.initial=,
+ #1/subminor grid/.initial=,
+ #1/label/.initial=,
+ #1/padding min/.initial=,
+ #1/padding max/.initial=,
+ #1/.code={
+ \let\tikz@temp\tikz@dv@axis%
+ \def\tikz@dv@axis{/tikz/data visualization/#1}%
+ \expandafter\tikz@do@axis@options\expandafter{\tikz@temp}{##1}%
+ },
+ #1/@compute at positions/.initial=\tikz@lib@dv@compute@at@linear,
+ axes list/.append={\tikz@lib@dv@do@axis{#1}}
+ },
+ all axes/.code={
+ \def\tikz@lib@dv@args{#1}%
+ \pgfkeysvalueof{/tikz/data visualization/axes list}%
+ },
+ % General styling
+ styling/.style=,
+ style/.style={styling/.append style={#1}},
+ @node styling/.initial=,
+ node styling/.style={%
+ /utils/exec={\pgfkeysgetvalue{/tikz/data visualization/@node styling}\tikz@temp\expandafter\tikzset\expandafter{\tikz@temp}}},
+ node style/.style={/tikz/data visualization/@node styling/.append={,#1}},
+ grid styling/.style=,
+ grid style/.style={grid styling/.append style={#1}},
+ % General extends (both axes, grid and ticks)
+ low/.initial=0,
+ high/.initial=0,
+ padded/.style={low=padded min,high=padded max},
+ tick length/.style={low={-#1},high={#1}},
+ % General tick and grid keys:
+ common/.initial=,
+ major/.initial=,
+ minor/.initial=,
+ subminor/.initial=,
+ @setup at setters/.style={
+ common/.code=\tikz@lib@dv@add@{common}{##1},
+ major/.code=\tikz@lib@dv@add@{major}{##1},
+ minor/.code=\tikz@lib@dv@add@{minor}{##1},
+ subminor/.code=\tikz@lib@dv@add@{subminor}{##1}
+ },
+ @setup at setters,
+ % Tick keys
+ direction axis/.initial=,
+ value/.initial=,
+ pos/.initial=,
+ tick text at low/.is if=tikz@dv@min@tick@node,
+ tick text at high/.is if=tikz@dv@max@tick@node,
+ no tick text/.style={tick text at low=false,tick text at high=false},
+ every major ticks/.style={style={line cap=round},tick length=2pt},
+ every minor ticks/.style={style={help lines,thin,line cap=round},tick length=1.4pt},
+ every subminor ticks/.style={style={help lines,line cap=round},tick length=0.8pt},
+ clean ticks/.style={node style={fill=white}},
+ % Default grid styles
+ grid style={high=max,low=min},
+ every major grid/.style={style={help lines,thin,black!25}},
+ every minor grid/.style={style={help lines,black!25}},
+ every subminor grid/.style={style={help lines,black!10}},
+ at default ticks/.code={%
+ \expandafter\pgfkeysalso\expandafter{\tikz@lib@dv@ticks@default@at}},
+ at ticks/.code={%
+ \expandafter\pgfkeysalso\expandafter{\tikz@lib@dv@ticks@default@at}%
+ \expandafter\pgfkeysalso\expandafter{\tikz@lib@dv@ticks@at}},
+}
+
+\def\tikz@lib@dv@add@#1#2{\pgfkeysaddvalue{/tikz/data visualization/#1}{}{,#2}}
+
+\def\tikz@dv@lib@parse@scaling#1 at#2and #3 at#4\pgf@stop{%
+ \pgfmathsetmacro{\tikz@dv@lib@min@at}{#2}
+ \pgfmathsetmacro{\tikz@dv@lib@max@at}{#4}
+ \edef\tikz@temp{#1 at \tikz@dv@lib@min@at and #3 at \tikz@dv@lib@max@at}%
+}
+
+
+% Ticks at
+\tikzdatavisualizationset{
+ at/.code={\def\tikz@dv@at@list{#1}},
+ also at/.code={\expandafter\def\expandafter\tikz@dv@at@list\expandafter{\tikz@dv@at@list,{#1}}},
+ major at/.style={major={at={#1}}},
+ minor at/.style={minor={at={#1}}},
+ subminor at/.style={subminor={at={#1}}},
+ major also at/.style={major={also at={#1}}},
+ minor also at/.style={minor={also at={#1}}},
+ subminor also at/.style={subminor={also at={#1}}},
+ options at/.code={\expandafter\def\expandafter\tikz@dv@style@at@list\expandafter{\tikz@dv@style@at@list,{#1}}},
+ no tick text at/.style={options at={#1 as [no tick text]}}
+}
+
+
+\def\tikz@lib@dv@do@axis#1{%
+ \def\tikz@marshal{#1=}
+ \expandafter\expandafter\expandafter\tikzdatavisualizationset%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@marshal\expandafter{\tikz@lib@dv@args}}
+}
+
+\def\tikz@do@axis@options#1#2{
+ \pgfkeys{/tikz/data visualization/axis options/.cd,#2}
+ \def\tikz@dv@axis{#1}
+}
+\let\tikz@dv@axis\pgfutil@empty
+
+\tikzdatavisualizationset{
+ every ticks/.style={
+ node style={%
+ font=\pgfutil@font@footnotesize,
+ inner sep=1pt,
+ outer sep=.1666em,
+ rounded corners=1.5pt
+ }
+ },
+ every visualizer label/.style={
+ every ticks,
+ node style={
+ font=\pgfutil@font@small
+ }
+ },
+ @color of visualizer labels/.style={text=black},
+ every visualizer legend label/.style={
+ node style={
+ fill=none
+ }
+ },
+ every axis label/.style={
+ node style={%
+ font=\pgfutil@font@small
+ }
+ }
+}
+
+
+\tikzset{
+ /tikz/data visualization/axis options/.cd,
+ %
+ % Basic setters
+ %
+ attribute/.style={\tikz@dv@axis/attribute={#1}},
+ function/.style={\tikz@dv@axis/function={#1}},
+ scaling/.style={\tikz@dv@axis/scaling={#1}},
+ padding min/.style={\tikz@dv@axis/padding min={#1}},
+ padding max/.style={\tikz@dv@axis/padding max={#1}},
+ padding/.style={padding min={-#1},padding max={#1}},
+ label/.style={\tikz@dv@axis/label={#1}},
+ %
+ % Strategies
+ %
+ tick placement strategy/.style={\tikz@dv@axis/@compute at positions={#1}},
+ linear steps/.style={tick placement strategy=\tikz@lib@dv@compute@at@linear},
+ %
+ % Attribute setter
+ %
+ goto/.code={\tikz@dv@goto{\tikz@dv@axis}{#1}},
+ %
+ % Modification of the range
+ %
+ include values/.style={%
+ /tikz/data visualization/before survey/.expanded={%
+ \noexpand\pgfkeysgetvalue{\tikz@dv@axis/scaling mapper}\noexpand\tikz@dv@axis@mapper%
+ \noexpand\foreach \noexpand\tikz@lib@dv@temp in {#1} {%
+ \noexpand\tikz@dv@axis@mapper.include in value(\noexpand\tikz@lib@dv@temp)%
+ }%
+ }%
+ },
+ %
+ % Visualization setters
+ %
+ visualize axis/.code=\expandafter\tikz@lib@dv@av\expandafter{\tikz@dv@axis}{#1},
+ %
+ % Ticks settings
+ %
+ ticks/.style={\tikz@dv@axis/ticks at/.append={,#1}},
+ visualize ticks/.code=\expandafter\tikz@lib@dv@tv\expandafter{\tikz@dv@axis}{#1},
+ %
+ % Grid settings
+ %
+ grid/.style={\tikz@dv@axis/grid at/.append={,#1}},
+ grid/.default=at default ticks,
+ visualize grid/.code=\expandafter\tikz@lib@dv@gv\expandafter{\tikz@dv@axis}{#1},
+ %
+ % Visualizing axis labels
+ %
+ visualize label/.code=\expandafter\tikz@lib@dv@lv\expandafter{\tikz@dv@axis}{#1},
+}
+
+
+% Layer options
+\tikzdatavisualizationset{
+ axis layer/.style=on background layer,
+ ticks layer/.style=on background layer,
+ ticks node layer/.style=,
+ grid layer/.style=on background layer,
+}
+
+
+% Axis visualization
+%
+% #1 = name of the to-be-visualized axis name
+% #2 = options for the visualization
+
+\def\tikz@lib@dv@av#1#2{
+ \tikzdatavisualizationset{
+ axes actions/.append={\tikz@lib@dv@show@axis{#1}{#2}}
+ }
+}
+
+\def\tikz@lib@dv@show@axis#1#2{%
+ \scope[data visualization/axis layer,/tikz/data visualization/.cd,low=min,high=max,every axis/.try,#2]
+ \pgfkeysgetvalue{#1/scaling mapper}\tikz@dv@axis@mapper
+ % Ok, calculate direction vector:
+ \tikzpointandanchordirection{\tikz@dv@axis@mapper.set in to(min)}{\tikz@dv@axis@mapper.set in to(max)}
+ \xdef\tikz@dv@axis@dir{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \path[draw,/tikz/data visualization/styling]
+ \pgfextra{
+ {
+ \tikz@dv@goto{#1}{\pgfkeysvalueof{/tikz/data visualization/low}}%
+ \pgfpathdvmoveto%
+ }
+ {
+ \tikz@dv@goto{#1}{\pgfkeysvalueof{/tikz/data visualization/high}}%
+ \pgfpathdvlineto%
+ }
+ };
+ \endscope
+}
+
+\def\tikz@dv@goto#1#2{%
+ \edef\pgf@temp{#2}%
+ \ifx\pgf@temp\tikz@lib@dv@padded@min@text%
+ \pgfkeysvalueof{#1/scaling mapper}.set in to(min)%
+ \pgfkeysvalueof{#1/scaling mapper}.get out()%
+ \pgfkeysgetvalue{#1/padding min}\pgf@temp%
+ \pgfmathparse{\pgf@temp}%
+ \pgfkeyslet{/data point/\pgfdvout/offset}\pgfmathresult%
+ \else%
+ \ifx\pgf@temp\tikz@lib@dv@padded@max@text%
+ \pgfkeysvalueof{#1/scaling mapper}.set in to(max)%
+ \pgfkeysvalueof{#1/scaling mapper}.get out()%
+ \pgfkeysgetvalue{#1/padding max}\pgf@temp%
+ \pgfmathparse{\pgf@temp}%
+ \pgfkeyslet{/data point/\pgfdvout/offset}\pgfmathresult%
+ \else%
+ \pgfkeysvalueof{#1/scaling mapper}.set in to(#2)%
+ \fi%
+ \fi%
+}
+
+\def\tikz@lib@dv@padded@min@text{padded min}
+\def\tikz@lib@dv@padded@max@text{padded max}
+
+% Ticks visualization
+%
+% #1 = name of axis on which ticks should be shown
+% #2 = options for the visualization
+
+\def\tikz@lib@dv@tv#1#2{
+ \tikzdatavisualizationset{
+ ticks actions/.append={\tikz@lib@dv@default@action{ticks}{#1}{#2}},
+ major ticks actions/.append={\tikz@lib@dv@show@ticks{major}{#1}{#2}},
+ minor ticks actions/.append={\tikz@lib@dv@show@ticks{minor}{#1}{#2}},
+ subminor ticks actions/.append={\tikz@lib@dv@show@ticks{subminor}{#1}{#2}}
+ }
+}
+
+\def\tikz@lib@dv@default@action#1#2#3{%
+ \let\tikz@marshal\pgfutil@empty%
+ {%
+ \let\tikz@lib@dv@ticks@at\pgfutil@empty%
+ \pgfkeysgetvalue{#2/ticks at}\tikz@lib@dv@ticks@default@at%
+ \pgfkeysgetvalue{#2/#1 at}\tikz@lib@dv@settings%
+ \pgfkeysgetvalue{#2/scaling mapper}\tikz@lib@dv@mapper
+ % Normal minor etc. have no effect.
+ \tikzdatavisualizationset{major/.code=,minor/.code=,subminor/.code=,common/.code=}
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}%
+ \tikzdatavisualizationset{@setup at setters}%
+ \pgfkeysgetvalue{/tikz/data visualization/compute step}\tikz@temp@step%
+ \ifx\tikz@temp@step\pgfutil@empty%
+ % do nothing
+ \else%
+ \pgfkeysvalueof{#2/@compute at positions}%
+ \xdef\tikz@marshal{
+ major={\pgfkeysvalueof{/tikz/data visualization/major}},
+ minor={\pgfkeysvalueof{/tikz/data visualization/minor}},
+ subminor={\pgfkeysvalueof{/tikz/data visualization/subminor}}}
+ \fi
+ }%
+ \pgfkeyslet{#2/default #1 at}\tikz@marshal
+}
+
+\def\tikz@lib@dv@show@ticks#1#2#3{%
+ % First, check whether there is anything to do at all:
+ \pgfkeysgetvalue{#2/default ticks at}\tikz@lib@dv@default@settings%
+ \ifx\tikz@lib@dv@default@settings\pgfutil@empty%
+ \pgfkeysgetvalue{#2/ticks at}\tikz@lib@dv@settings%
+ \else%
+ \pgfkeysgetvalue{#2/ticks at}\tikz@lib@dv@settings%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@dv@settings%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@dv@default@settings\expandafter,\tikz@lib@dv@settings}
+ \fi%
+ \ifx\tikz@lib@dv@settings\pgfutil@empty%
+ % Great, nothing to do
+ \else
+ {%
+ \let\tikz@dv@at@list\pgfutil@empty%
+ \let\tikz@dv@style@at@list\pgfutil@empty%
+ \scope[/tikz/data visualization/.cd,every ticks/.try,every #1 ticks/.try,#3]%
+ % Setup options
+ \pgfkeysgetvalue{#2/scaling mapper}\tikz@lib@dv@mapper
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}%
+ \pgfkeysgetvalue{/tikz/data visualization/common}\tikz@temp
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@temp}
+ \pgfkeysgetvalue{/tikz/data visualization/#1}\tikz@temp
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@temp}
+ \pgfkeysgetvalue{/tikz/data visualization/\pgfkeysvalueof{/tikz/data visualization/direction axis}/scaling mapper}\pgf@dv@tick@dir@mapper
+ % Ok, now it's time to draw the ticks!
+ \foreach \tikz@dv@tick@pos in \tikz@dv@at@list
+ {
+ \ifx\tikz@dv@tick@pos\pgfutil@empty
+ \else
+ \expandafter\tikz@lib@dv@parse\tikz@dv@tick@pos\pgf@stop%
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@tick@opt}%
+ \tikz@lib@dv@mapper.set in to(\tikz@dv@tick@pos)%
+ % First, compute position of tick:
+ \pgf@process{\pgfpointdvlocaldatapoint}
+ \xdef\pgf@dv@tick@origin{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ % Ok, calculate direction vector:
+ \tikzpointandanchordirection{\pgf@dv@tick@dir@mapper.set in to(min)}{\pgf@dv@tick@dir@mapper.set in to(max)}
+ \xdef\pgf@dv@tick@dir{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ % Now, show something:
+ \tikz@lib@handle@at@style%
+ \scope[/tikz/data visualization/styling]
+ \pgf@process{\pgfpointadd{\pgf@dv@tick@origin}{\pgfpointscale{\pgfkeysvalueof{/tikz/data visualization/high}}{\pgf@dv@tick@dir}}}
+ \xdef\tikz@dv@max@tick{\the\pgf@x,\the\pgf@y}
+ \pgf@process{\pgfpointadd{\pgf@dv@tick@origin}{\pgfpointscale{\pgfkeysvalueof{/tikz/data visualization/low}}{\pgf@dv@tick@dir}}}
+ \xdef\tikz@dv@min@tick{\the\pgf@x,\the\pgf@y}
+ \scope[data visualization/ticks layer] \draw (\tikz@dv@min@tick) -- (\tikz@dv@max@tick); \endscope
+ \iftikz@dv@min@tick@node \scope[data visualization/ticks node layer] \path (\tikz@dv@min@tick) \tikz@dv@handle@tick{\tikz@dv@min@anchor}; \endscope \fi
+ \iftikz@dv@max@tick@node \scope[data visualization/ticks node layer] \path (\tikz@dv@max@tick) \tikz@dv@handle@tick{\tikz@dv@max@anchor}; \endscope\fi
+ \endscope
+ \fi
+ }
+ \endscope
+ }
+ \fi
+}
+
+\def\tikz@lib@dv@parse#1\pgf@stop{%
+ \pgfutil@in@{as}{#1}%
+ \ifpgfutil@in@%
+ \tikz@lib@dv@parse@as#1\pgf@stop%
+ \else%
+ \tikz@lib@dv@parse@as#1as\tikz@lib@dv@typeset\pgf@stop%
+ \fi%
+}
+\def\tikz@lib@dv@parse@as#1as{%
+ \def\tikz@dv@tick@pos{#1}%
+ \pgfutil@ifnextchar[{\tikz@lib@dv@parse@as@opt}{\tikz@lib@dv@parse@as@opt[]}%]
+}
+\def\tikz@lib@dv@parse@as@opt[#1]{%
+ \def\tikz@lib@dv@tick@opt{#1}%
+ \pgfutil@ifnextchar\pgf@stop{\tikz@lib@dv@parse@as@text\tikz@lib@dv@typeset}{\tikz@lib@dv@parse@as@text}
+}
+\def\tikz@lib@dv@parse@as@text#1\pgf@stop{%
+ \def\tikz@lib@dv@tick@text{#1}%
+}
+
+\def\tikz@lib@dv@typeset{%
+ \pgfdvmathenter{\tikz@lib@dv@typesetnum}{\tikz@dv@tick@pos}%
+ \pgfdvmathexitbyscientificformat{\tikz@lib@dv@typesetnum}{\tikz@lib@dv@typesetnum}% hmm... not sure about this...
+ \pgfkeysvalueof{/tikz/data visualization/tick prefix}%
+ \pgfkeysvalueof{/tikz/data visualization/tick typesetter}{\tikz@lib@dv@typesetnum}%
+ \pgfkeysvalueof{/tikz/data visualization/tick suffix}%
+}
+
+\newif\iftikz@dv@min@tick@node
+\newif\iftikz@dv@max@tick@node
+
+\def\tikz@dv@handle@tick#1{%
+ \pgfextra{
+ \ifx\tikz@lib@dv@tick@text\pgfutil@empty%
+ \global\let\tikz@dv@tick@marshal=\pgfutil@empty% Skip!
+ \else
+ \def\tikz@dv@tick@marshal{node[anchor=#1,/tikz/data visualization/node styling]}%
+ \expandafter\pgfutil@g@addto@macro\expandafter\tikz@dv@tick@marshal\expandafter{\expandafter{\tikz@lib@dv@tick@text}}
+ \fi
+ \expandafter}%
+ \tikz@dv@tick@marshal
+}
+
+
+\def\tikz@lib@handle@at@style{%
+ \ifx\tikz@dv@style@at@list\pgfutil@empty% nothing to do
+ \else%
+ \let\tikz@dv@lib@this@at@style=\pgfutil@empty%
+ \pgfdvmathenter{\tikz@temp}{\tikz@dv@tick@pos}%
+ \pgfdvmathexitbyscientificformat{\tikz@dv@compare@to}{\tikz@temp}%
+ \foreach \tikz@dv@at@style in \tikz@dv@style@at@list {%
+ \ifx\tikz@dv@at@style\pgfutil@empty%
+ \else%
+ \expandafter\tikz@dv@lib@handle@one@at@style\tikz@dv@at@style\tikz@stop%
+ \fi%
+ }
+ \ifx\tikz@dv@lib@this@at@style\pgfutil@empty%
+ \else%
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@dv@lib@this@at@style}%
+ \fi%
+ \fi%
+}
+
+\def\tikz@dv@lib@handle@one@at@style#1as#2[#3]#4\tikz@stop{%
+ \pgfdvmathenter{\tikz@lib@dv@at@math@var}{#1}%
+ \pgfdvmathexitbyscientificformat{\tikz@dv@temp}{\tikz@lib@dv@at@math@var}%
+ \ifx\tikz@dv@temp\tikz@dv@compare@to%
+ % Bingo!
+ \expandafter\gdef\expandafter\tikz@dv@lib@this@at@style\expandafter{\tikz@dv@lib@this@at@style,#3}%
+ \fi%
+}
+
+
+% Help function
+\def\tikzpointandanchordirection#1#2{%
+ % This function works like pgfpointdvdirection, but also computes
+ % appriate "min" and "max" anchors.
+ \pgf@process{\pgfpointdvdirection{#1}{#2}}
+ {
+ \pgf@ya=\pgf@y
+ \pgf@y=-\pgf@x
+ \pgf@x=\pgf@ya
+ \tikz@auto@anchor
+ \xdef\tikz@dv@max@anchor{\tikz@anchor}
+ \tikz@auto@anchor@prime
+ \xdef\tikz@dv@min@anchor{\tikz@anchor}
+ }
+}
+
+
+
+
+% Grid visualization
+%
+% #1 = name of axis on which grid lines should be shown
+% #2 = options for the visualization
+
+\def\tikz@lib@dv@gv#1#2{
+ \tikzdatavisualizationset{
+ grid actions/.append={\tikz@lib@dv@default@action{grid}{#1}{#2}},
+ major grid actions/.append={\tikz@lib@dv@show@grid{major}{#1}{#2}},
+ minor grid actions/.append={\tikz@lib@dv@show@grid{minor}{#1}{#2}},
+ subminor grid actions/.append={\tikz@lib@dv@show@grid{subminor}{#1}{#2}},
+ }
+}
+
+\def\tikz@lib@dv@show@grid#1#2#3{%
+ % First, check whether there is anything to do at all:
+ \pgfkeysgetvalue{#2/default grid at}\tikz@lib@dv@default@settings%
+ \ifx\tikz@lib@dv@default@settings\pgfutil@empty%
+ \pgfkeysgetvalue{#2/grid at}\tikz@lib@dv@settings%
+ \else%
+ \pgfkeysgetvalue{#2/grid at}\tikz@lib@dv@settings%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@dv@settings%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@dv@default@settings\expandafter,\tikz@lib@dv@settings}
+ \fi%
+ \ifx\tikz@lib@dv@settings\pgfutil@empty%
+ % Great, nothing to do
+ \else
+ {%
+ \let\tikz@dv@at@list\pgfutil@empty
+ \let\tikz@dv@style@at@list\pgfutil@empty
+ \scope[data visualization/grid layer,/tikz/data visualization/.cd,every #1 grid/.try,grid styling,grid styling/.style=,#3]
+ % Setup options
+ \pgfkeysgetvalue{#2/scaling mapper}\tikz@lib@dv@mapper
+ \let\tikz@lib@dv@ticks@default@at\pgfutil@empty%
+ \pgfkeysgetvalue{#2/ticks at}\tikz@lib@dv@ticks@at%
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@settings}%
+ \pgfkeysgetvalue{/tikz/data visualization/common}\tikz@temp
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@temp}
+ \pgfkeysgetvalue{/tikz/data visualization/#1}\tikz@temp
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@temp}
+ \edef\tikz@lib@dv@dir@axis{/tikz/data visualization/\pgfkeysvalueof{/tikz/data visualization/direction axis}}%
+ % Ok, now it's time to draw the grid!
+ \foreach \tikz@dv@grid@pos in \tikz@dv@at@list
+ {
+ \ifx\tikz@dv@grid@pos\pgfutil@empty
+ \else
+ \expandafter\tikz@lib@dv@parse\tikz@dv@grid@pos\pgf@stop%
+ \expandafter\tikzdatavisualizationset\expandafter{\tikz@lib@dv@tick@opt}%
+ \tikzdatavisualizationset{grid styling}%
+ \tikz@lib@dv@mapper.set in to(\tikz@dv@tick@pos)%
+ \draw[/tikz/data visualization/styling]
+ \pgfextra{
+ % First, compute start of grid:
+ \tikz@dv@goto{\tikz@lib@dv@dir@axis}{\pgfkeysvalueof{/tikz/data visualization/low}}%
+ \pgfpathdvmoveto%
+ \tikz@dv@goto{\tikz@lib@dv@dir@axis}{\pgfkeysvalueof{/tikz/data visualization/high}}%
+ \pgfpathdvlineto%
+ };
+ \fi
+ }
+ \endscope
+ }
+ \fi
+}
+
+
+
+
+
+
+
+
+
+%
+% Label visualization
+%
+
+\def\tikz@lib@dv@lv#1#2{
+ \tikzdatavisualizationset{
+ label actions/.append={\tikz@lib@dv@show@label{#1}{#2}}
+ }
+}
+
+\def\tikz@lib@dv@show@label#1#2{%
+ % First, check whether there is anything to do at all:
+ \pgfkeysgetvalue{#1/label}\tikz@dv@lib@label%
+ \ifx\tikz@dv@lib@label\pgfutil@empty%
+ % Great, nothing to do
+ \else
+ \scope[/tikz/data visualization/.cd,every axis label/.try,#2]
+ \pgfkeysgetvalue{/tikz/data visualization/value}\tikz@lib@dv@at%
+ \pgfkeysgetvalue{/tikz/data visualization/pos}\tikz@lib@dv@pos%
+ \pgfkeysgetvalue{#1/scaling mapper}\tikz@dv@mapper
+ \ifx\tikz@lib@dv@pos\pgfutil@empty%
+ \ifx\tikz@lib@dv@at\pgfutil@empty%
+ % Well, hopefully the node options setup things correctly...
+ \else%
+ % Special treatment of "min" and "max"
+ \ifx\tikz@lib@dv@at\pgf@min@text%
+ \tikz@lib@dv@special@at{\tikz@dv@min@anchor}
+ \else \ifx\tikz@lib@dv@at\tikz@lib@dv@padded@min@text%
+ \tikz@lib@dv@special@at{\tikz@dv@min@anchor}
+ \else \ifx\tikz@lib@dv@at\pgf@max@text%
+ \tikz@lib@dv@special@at{\tikz@dv@max@anchor}
+ \else \ifx\tikz@lib@dv@at\tikz@lib@dv@padded@max@text%
+ \tikz@lib@dv@special@at{\tikz@dv@max@anchor}
+ \fi\fi\fi\fi%
+ \tikz@dv@goto{#1}{\tikz@lib@dv@at}%
+ \pgftransformshift{\pgfpointdvlocaldatapoint}%
+ \fi%
+ \else%
+ \tikz@dv@mapper.set in to(min)%
+ \pgftransformshift{\pgfpointscale{1-\tikz@lib@dv@pos}{\pgfpointdvlocaldatapoint}}
+ \tikz@dv@mapper.set in to(max)%
+ \pgftransformshift{\pgfpointscale{\tikz@lib@dv@pos}{\pgfpointdvlocaldatapoint}}
+ \fi
+ \expandafter\tikz@lib@dv@parse@node\tikz@dv@lib@label\pgf@stop
+ \endscope
+ \fi
+}
+\def\tikz@lib@dv@special@at#1{%
+ % Ok, calculate direction vector:
+ \tikzpointandanchordirection{\tikz@dv@mapper.set in to(min)}{\tikz@dv@mapper.set in to(max)}
+ \tikzset{anchor=#1}
+}
+
+\def\tikz@lib@dv@parse@node{\pgfutil@ifnextchar[\tikz@lib@dv@parse@node@opt{\tikz@lib@dv@parse@node@opt[]}}%}
+\def\tikz@lib@dv@parse@node@opt[#1]#2\pgf@stop{
+ \node [/tikz/data visualization/node styling,#1] {#2};
+}
+
+
+
+%
+% Tick placement strategies
+%
+
+\tikzdatavisualizationset{
+ compute step/.initial=,
+ step/.style={compute step=\def\tikz@lib@dv@step{#1}},
+ minor steps between steps/.initial=,
+ minor steps between steps/.default=9,
+ phase/.initial=0,
+ tick typesetter/.initial=\pgfmathprintnumber,
+ tick prefix/.initial=,
+ tick suffix/.initial=,
+ tick unit/.style={tick suffix={#1}},% this is an alias
+}
+
+\def\tikz@lib@dv@compute@at@linear{%
+ % Setup about:
+ \let\tikz@lib@dv@compute@about=\tikz@lib@dv@about@linear%
+ \let\tikz@lib@dv@step\relax%
+ \pgfkeysvalueof{/tikz/data visualization/compute step}
+ \ifx\tikz@lib@dv@step\relax%
+ \else%
+ % Gather interesting values
+ \tikz@lib@dv@mapper.get in range interval()%
+ \pgfdvinrangeinterval.get min and max()%
+ \pgfkeysgetvalue{/tikz/data visualization/phase}\tikz@temp
+ \pgfdvmathenter{\tikz@dv@lib@phase}{\tikz@temp}
+ \pgfdvmathenter{\tikz@dv@lib@step}{\tikz@lib@dv@step}
+ % Compute start:
+ \pgfdvmathsub{\tikz@dv@lib@temp}{\pgfdvmin}{\tikz@dv@lib@phase}% temp = dvmin - phase
+ \pgfdvmathdiv{\tikz@dv@lib@temp}{\tikz@dv@lib@temp}{\tikz@dv@lib@step}% temp = temp/step
+ \pgfdvmathfloor{\tikz@dv@lib@temp}{\tikz@dv@lib@temp}% temp = floor(temp)
+ \pgfdvmathmul{\tikz@lib@dv@current}{\tikz@dv@lib@temp}{\tikz@dv@lib@step}% current = temp*step ...
+ \pgfdvmathadd{\tikz@lib@dv@current}{\tikz@lib@dv@current}{\tikz@dv@lib@phase}% + phase
+ \let\tikz@lib@dv@ats\pgfutil@empty%
+ \let\tikz@lib@dv@minor@ats\pgfutil@empty%
+ \tikz@lib@dv@mapper.get function(\tikz@temp)%
+ \ifx\tikz@temp\pgfutil@empty%
+ \pgfdvmathenter{\tikz@one@hundreth}{0.001}%
+ \pgfdvmathsub{\tikz@lib@temp}{\pgfdvmax}{\pgfdvmin}%
+ \pgfdvmathmul{\tikz@lib@dv@epsilon}{\tikz@lib@temp}{\tikz@one@hundreth}% epsilon = (max - min)/1000
+ \else
+ \let\tikz@lib@dv@epsilon\pgfdvmathalwayszero
+ \fi
+ \pgfdvmathsub{\tikz@lib@dv@min@minus@epsilon}{\pgfdvmin}{\tikz@lib@dv@epsilon}%
+ \pgfdvmathadd{\tikz@lib@dv@max@plus@epsilon}{\pgfdvmax}{\tikz@lib@dv@epsilon}%
+ \pgfkeysgetvalue{/tikz/data visualization/minor steps between steps}\tikz@lib@dv@substeps%
+ \ifx\tikz@lib@dv@substeps\pgfutil@empty
+ \else
+ \pgfmathsetmacro\tikz@temp{\tikz@lib@dv@substeps+1}%
+ \pgfdvmathenter{\tikz@dv@lib@substeps}{\tikz@temp}%
+ \pgfdvmathdiv{\tikz@lib@dv@substep}{\tikz@dv@lib@step}{\tikz@dv@lib@substeps}%
+ \fi
+ \loop%
+ \ifx\tikz@lib@dv@substeps\pgfutil@empty%
+ \else%
+ \let\tikz@lib@dv@subcurrent=\tikz@lib@dv@current%
+ \pgfmathsetcount{\c@pgf@counta}{\tikz@lib@dv@substeps}%
+ \let\tikz@lib@dv@next=\tikz@lib@dv@subloop%
+ \tikz@lib@dv@subloop
+ \fi%
+ \pgfdvmathifless{\tikz@lib@dv@current}{\tikz@lib@dv@min@minus@epsilon}{}{%
+ \pgfdvmathexitbyserializing{\tikz@temp}{\tikz@lib@dv@current}%
+ \edef\tikz@lib@dv@ats{\tikz@lib@dv@ats,\tikz@temp}%
+ }
+ \pgfdvmathadd{\tikz@lib@dv@current}{\tikz@lib@dv@current}{\tikz@dv@lib@step}%
+ \pgfdvmathifless{\tikz@lib@dv@current}{\tikz@lib@dv@max@plus@epsilon}{\tikz@lib@dv@continuetrue}{\tikz@lib@dv@continuefalse}%
+ \iftikz@lib@dv@continue%
+ \repeat%
+ \tikzdatavisualizationset{major/.expanded={at={\tikz@lib@dv@ats}},minor/.expanded={at={\tikz@lib@dv@minor@ats}}}%
+ \fi%
+}
+\newif\iftikz@lib@dv@continue
+
+\def\tikz@lib@dv@subloop{
+ \pgfdvmathadd{\tikz@lib@dv@subcurrent}{\tikz@lib@dv@subcurrent}{\tikz@lib@dv@substep}%
+ \pgfdvmathifless{\tikz@lib@dv@subcurrent}{\pgfdvmin}{}{%
+ \pgfdvmathifless{\tikz@lib@dv@subcurrent}{\pgfdvmax}{%
+ \pgfdvmathexitbyserializing{\tikz@temp}{\tikz@lib@dv@subcurrent}%
+ \edef\tikz@lib@dv@minor@ats{\tikz@lib@dv@minor@ats,\tikz@temp}
+ }{}}
+ \advance\c@pgf@counta by-1\relax%
+ \ifnum\c@pgf@counta=0\relax%
+ \let\tikz@lib@dv@next=\relax
+ \fi
+ \tikz@lib@dv@next
+}
+
+
+
+%
+% Ticks about settings
+%
+
+\tikzdatavisualizationset{
+ about/.style={compute step=\tikz@lib@dv@compute@about{#1}},
+ about strategy/.initial=,
+ standard about strategy/.style={about strategy={1.5/1.0,2.3/2.0,4/2.5,7/5,11/10}},
+ standard about strategy,
+ euro about strategy/.style={about strategy={1.5/1.0,3/2.0,7/5,11/10}},
+ half about strategy/.style={about strategy={2/1.0,7/5,11/10}},
+ quarter about strategy/.style={about strategy={1.8/1.0,4/2.5,7/5,11/10}},
+ int about strategy/.style={about strategy={1.5/1.0,2.5/2.0,3.5/3.0,4.5/4.0,7/5,11/10}},
+ none/.style={compute step=},
+ few/.style={about=3},
+ some/.style={about=5},
+ many/.style={about=10},
+}
+
+\def\tikz@lib@dv@about@linear#1{%
+ \tikz@lib@dv@mapper.get in range interval()%
+ \pgfdvinrangeinterval.get min and max()%
+ \pgfdvmathsub{\tikz@lib@dv@diff}{\pgfdvmax}{\pgfdvmin}
+ \pgfdvmathenter{\tikz@lib@dv@about@val}{#1}%
+ \pgfdvmathdiv{\tikz@lib@dv@around}{\tikz@lib@dv@diff}{\tikz@lib@dv@about@val}%
+ % Make mantisse sensible
+ \pgfmathfloattomacro{\tikz@lib@dv@around}{\tikz@lib@dv@flags}{\tikz@lib@dv@mant}{\tikz@lib@dv@exp}
+ \pgf@xc=\tikz@lib@dv@mant pt%
+ \pgfkeysgetvalue{/tikz/data visualization/about strategy}\tikz@lib@dv@strat
+ \foreach \tikz@lib@dv@threshold/\tikz@lib@replace in \tikz@lib@dv@strat
+ {
+ \ifdim\pgf@xc<\tikz@lib@dv@threshold pt%
+ \global\pgf@xc=\tikz@lib@replace pt%
+ \breakforeach
+ \fi
+ }
+ \ifdim\pgf@xc<10pt%
+ \pgfmathfloatcreate{\tikz@lib@dv@flags}{\pgf@sys@tonumber{\pgf@xc}}{\tikz@lib@dv@exp}
+ \else
+ \pgfmathsetmacro\tikz@lib@dv@exp{\tikz@lib@dv@exp+1}
+ \divide\pgf@xc by 10\relax
+ \pgfmathfloatcreate{\tikz@lib@dv@flags}{\pgf@sys@tonumber{\pgf@xc}}{\tikz@lib@dv@exp}
+ \fi
+ \pgfmathfloattofixed{\pgfmathresult}
+ \let\tikz@lib@dv@step=\pgfmathresult
+}
+
+
+
+
+
+%
+% Logarithmic axes
+%
+
+\tikzset{
+ /tikz/data visualization/axis options/.cd,
+ exponential steps/.style={tick placement strategy=\tikz@lib@dv@compute@at@log},
+ %
+ % Basic setters
+ %
+ logarithmic/.style={
+ \tikz@dv@axis/function=\pgfdvmathln{\pgfvalue}{\pgfvalue},
+ \tikz@dv@axis/scaling/default=1 at 0 and 10 at 1,
+ exponential steps
+ }
+}
+
+\def\tikz@lib@dv@compute@at@log{%
+ % Setup about:
+ \let\tikz@lib@dv@compute@about=\tikz@lib@dv@about@log%
+ \let\tikz@lib@dv@step\relax%
+ \pgfkeysvalueof{/tikz/data visualization/compute step}
+ \ifx\tikz@lib@dv@step\relax%
+ \else%
+ % Gather interesting values
+ \tikz@lib@dv@mapper.get in range interval()%
+ \pgfdvinrangeinterval.get min and max()%
+ \pgfdvmathlog{\pgfdvminlog}{\pgfdvmin}%
+ \pgfdvmathlog{\pgfdvmaxlog}{\pgfdvmax}%
+ \pgfkeysgetvalue{/tikz/data visualization/phase}\tikz@temp
+ \pgfdvmathenter{\tikz@dv@lib@phase}{\tikz@temp}
+ \pgfdvmathenter{\tikz@dv@lib@step}{\tikz@lib@dv@step}
+ % Compute start:
+ \pgfdvmathsub{\tikz@dv@lib@temp}{\pgfdvminlog}{\tikz@dv@lib@phase}% temp = dvmin - phase
+ \pgfdvmathdiv{\tikz@dv@lib@temp}{\tikz@dv@lib@temp}{\tikz@dv@lib@step}% temp = temp/step
+ \pgfdvmathfloor{\tikz@dv@lib@temp}{\tikz@dv@lib@temp}% temp = floor(temp)
+ \pgfdvmathmul{\tikz@lib@dv@current}{\tikz@dv@lib@temp}{\tikz@dv@lib@step}% current = temp*step ...
+ \pgfdvmathadd{\tikz@lib@dv@current}{\tikz@lib@dv@current}{\tikz@dv@lib@phase}% + phase
+ \let\tikz@lib@dv@ats\pgfutil@empty%
+ \let\tikz@lib@dv@minor@ats\pgfutil@empty%
+ \pgfdvmathenter{\tikz@one@hundreth}{0.001}%
+ \pgfdvmathsub{\tikz@lib@temp}{\pgfdvmaxlog}{\pgfdvminlog}%
+ \pgfdvmathmul{\tikz@lib@dv@epsilon}{\tikz@lib@temp}{\tikz@one@hundreth}% epsilon = (max - min)/100
+ \pgfdvmathsub{\tikz@lib@dv@min@minus@epsilon}{\pgfdvminlog}{\tikz@lib@dv@epsilon}%
+ \pgfdvmathadd{\tikz@lib@dv@max@plus@epsilon}{\pgfdvmaxlog}{\tikz@lib@dv@epsilon}%
+ \pgfkeysgetvalue{/tikz/data visualization/minor steps between steps}\tikz@lib@dv@substeps%
+ \ifx\tikz@lib@dv@substeps\pgfutil@empty
+ \else
+ \pgfmathsetmacro\tikz@temp{\tikz@lib@dv@substeps+1}%
+ \pgfdvmathenter{\tikz@dv@lib@substeps}{\tikz@temp}%
+ \fi
+ \loop%
+ \ifx\tikz@lib@dv@substeps\pgfutil@empty%
+ \else%
+ \let\tikz@lib@dv@subcurrent=\tikz@lib@dv@current%
+ \pgfdvmathadd{\tikz@lib@dv@subcurrent@next}{\tikz@lib@dv@subcurrent}{\tikz@dv@lib@step}%
+ \pgfdvmathpowten{\tikz@lib@dv@subcurrent}{\tikz@lib@dv@subcurrent}%
+ \pgfdvmathpowten{\tikz@lib@dv@subcurrent@max}{\tikz@lib@dv@subcurrent@next}%
+ \pgfdvmathsub{\tikz@lib@dv@subcurrent@diff}{\tikz@lib@dv@subcurrent@max}{\tikz@lib@dv@subcurrent}%
+ \pgfdvmathdiv{\tikz@lib@dv@substep}{\tikz@lib@dv@subcurrent@diff}{\tikz@dv@lib@substeps}%
+ \pgfmathsetcount{\c@pgf@counta}{\tikz@lib@dv@substeps}%
+ \let\tikz@lib@dv@next=\tikz@lib@dv@subloop%
+ \tikz@lib@dv@subloop
+ \fi%
+ \pgfdvmathifless{\tikz@lib@dv@current}{\tikz@lib@dv@min@minus@epsilon}{}{%
+ \pgfdvmathpowten{\tikz@lib@dv@current@pow}{\tikz@lib@dv@current}%
+ \pgfdvmathexitbyserializing{\tikz@temp}{\tikz@lib@dv@current@pow}%
+ \edef\tikz@lib@dv@ats{\tikz@lib@dv@ats,\tikz@temp}%
+ }
+ \pgfdvmathadd{\tikz@lib@dv@current}{\tikz@lib@dv@current}{\tikz@dv@lib@step}%
+ \pgfdvmathifless{\tikz@lib@dv@current}{\tikz@lib@dv@max@plus@epsilon}{\tikz@lib@dv@continuetrue}{\tikz@lib@dv@continuefalse}%
+ \iftikz@lib@dv@continue%
+ \repeat%
+ \tikzdatavisualizationset{major/.expanded={at={\tikz@lib@dv@ats}},minor/.expanded={at={\tikz@lib@dv@minor@ats}}}%
+ \fi%
+}
+\newif\iftikz@lib@dv@continue
+
+
+\def\tikz@lib@dv@about@log#1{%
+ \tikz@lib@dv@mapper.get in range interval()%
+ \pgfdvinrangeinterval.get min and max()%
+ \pgfdvmathlog{\pgfdvmin}{\pgfdvmin}%
+ \pgfdvmathlog{\pgfdvmax}{\pgfdvmax}%
+ \pgfdvmathsub{\tikz@lib@dv@diff}{\pgfdvmax}{\pgfdvmin}
+ \pgfdvmathenter{\tikz@lib@dv@about@val}{#1}%
+ \pgfdvmathdiv{\tikz@lib@dv@around}{\tikz@lib@dv@diff}{\tikz@lib@dv@about@val}%
+ % Make mantisse sensible
+ \pgfmathfloattomacro{\tikz@lib@dv@around}{\tikz@lib@dv@flags}{\tikz@lib@dv@mant}{\tikz@lib@dv@exp}
+ \ifdim\tikz@lib@dv@exp pt<0pt%
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \else
+ \pgf@xc=\tikz@lib@dv@mant pt\relax%
+ \ifdim\pgf@xc<2.5pt
+ \pgfmathfloatcreate{1}{1.0}{\tikz@lib@dv@exp}
+ \else\ifdim\pgf@xc<5.1pt
+ \pgfmathfloatcreate{1}{3.0}{\tikz@lib@dv@exp}
+ \else
+ \pgfmathfloatcreate{1}{6.0}{\tikz@lib@dv@exp}
+ \fi\fi
+ \fi%
+ \pgfmathfloattofixed{\pgfmathresult}
+ \let\tikz@lib@dv@step=\pgfmathresult
+}
+
+
+
+
+
+
+
+%
+% Cartesian axes
+%
+
+\tikzdatavisualizationset{%
+ new Cartesian axis/.style={
+ new axis={#1},
+ new object={
+ class=linear transformer,
+ store=/tikz/data visualization/#1/linear transformer,
+ arg1/.expanded=\pgfkeysvalueof{/tikz/data visualization/#1/attribute}/scaled,
+ arg2 from key=/tikz/data visualization/#1/unit vector,
+ },
+ #1/scaling/default/.initial=0 at 0 and 1 at 1cm,
+ #1/unit vector/.initial=,
+ }
+}
+
+\tikzset{
+ /tikz/data visualization/axis options/.cd,
+ unit vector/.code=\tikz@scan@one@point\tikz@lib@dv@uv#1,
+ length/.style={\tikz@dv@axis/scaling=min at 0 and max at #1},
+ positive length/.style={\tikz@dv@axis/scaling=0 at 0 and max at #1},
+ negative length/.style={\tikz@dv@axis/scaling=min at -#1 and 0 at 0},
+ unit length/.code={\tikz@dv@parse@unit@length{#1}},
+ power unit length/.style={\tikz@dv@axis/scaling=1 at 0 and 10 at #1}
+}
+
+\def\tikz@lib@dv@uv#1{%
+ \pgfkeyssetvalue{\tikz@dv@axis/unit vector}{#1}
+}
+
+\def\tikz@dv@parse@unit@length#1{
+ \pgfutil@in@{per}{#1}
+ \ifpgfutil@in@%
+ \tikz@dv@parse@unit@length@#1\pgf@stop%
+ \else%
+ \tikz@dv@parse@unit@length@#1per1units\pgf@stop%
+ \fi%
+}
+\def\tikz@dv@parse@unit@length@#1per#2units{
+ \pgfkeysalso{\tikz@dv@axis/scaling=0 at 0 and #2 at #1}
+}
+
+
+%
+% Common visualizer interface
+%
+
+\tikzdatavisualizationset{
+ new visualizer/.style 2 args={
+ /pgf/data/#1/.style={/data point/visualizer=#1},
+ #1/.code={
+ \def\tikz@visualizer{#1}%
+ \pgfkeys{/tikz/data visualization/visualizer options/.cd,##1}
+ },
+ /utils/exec={
+ \advance\tikzdvvisualizercounter by 1\relax
+ \edef\tikz@temp{/data point/visualizer/#1/.initial=\the\tikzdvvisualizercounter}
+ \expandafter\tikzset\expandafter{\tikz@temp}
+ },
+ /data point/#1/execute at begin/.initial={
+ \pgfkeyssetvalue{/data point/visualizer}{#1}
+ \scope[
+ /tikz/data visualization/every visualizer/.try,
+ #2,
+ /utils/exec=\pgf@signalstyle.emit(),
+ /tikz/data visualization/visualizers/#1/styling/.try]
+ },
+ /data point/#1/execute at end/.initial={
+ \path; % invokes every path implicitly
+ \endscope
+ },
+ /tikz/data visualization/visualizers/#1/styling/.style=,
+ },
+ visualizer style sheet/.style={/data point/visualizer/.style sheet={#1}}
+}
+
+\def\tikz@do@visualizer#1#2{%
+ \tikzdatavisualizationset{
+ #2=#1
+ }
+}
+
+\newcount\tikzdvvisualizercounter
+
+\newif\iftikz@dv@visualizer@label@inline
+
+\tikzset{
+ @set plot handler/.code={\let\tikz@plot@handler=#1},
+ no lines/.style={@set plot handler=\pgfplothandlerdiscard,/utils/exec=\tikzdatavisualizationset{default label in legend mark}},
+ smooth line/.style={@set plot handler=\pgfplothandlercurveto,/utils/exec=\tikzdatavisualizationset{default label in legend path}},
+ smooth cycle/.style={@set plot handler=\pgfplothandlerclosedcurve,/utils/exec=\tikzdatavisualizationset{default label in legend closed path}},
+ straight line/.style={@set plot handler=\pgfplothandlerlineto,/utils/exec=\tikzdatavisualizationset{default label in legend path}},
+ straight cycle/.style={@set plot handler=\pgfplothandlerpolygon,/utils/exec=\tikzdatavisualizationset{default label in legend closed path}},
+ polygon/.style={straight cycle=cycle},% alias
+ gapped line/.style={@set plot handler=\pgfplothandlergaplineto,/utils/exec=\tikzdatavisualizationset{default label in legend path}},
+ gapped cycle/.style={@set plot handler=\pgfplothandlergapcycle,/utils/exec=\tikzdatavisualizationset{gapped circular label in legend line}}
+}
+
+
+
+%
+% Label visualizer
+%
+
+\tikzdatavisualizationset{
+ new label visualizer/.style 2 args={
+ new object={
+ when=before visualization,
+ class=label visualizer,
+ before creation={
+ \begingroup
+ \def\tikz@visualizer{#1}%
+ \pgfkeys{/tikz/data visualization/visualizer label options/.cd,
+ /tikz/data visualization/every label visualizer/.try,
+ #2}
+ \pgfkeysgetvalue{/tikz/data visualization/visualizer label options/text}\tikz@dv@temp@lab
+ \def\tikz@tempa{
+ \scope[/tikz/data visualization/visualizer label options/.cd,
+ /tikz/data visualization/every label visualizer/.try,
+ #2]
+ \path [
+ /data point/visualizer=#1,/utils/exec=\pgf@signalstyle.emit(),
+ /tikz/data visualization/.cd,every visualizer label]
+ (label visualizer coordinate') --
+ (label visualizer coordinate)
+ node [
+ auto,
+ at end,
+ /tikz/data visualization/node styling]
+ }
+ \expandafter\def\expandafter\tikz@tempb\expandafter{\expandafter{\tikz@dv@temp@lab};}%
+ \expandafter\expandafter\expandafter\gdef%
+ \expandafter\expandafter\expandafter\tikz@dv@label@code%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\relax%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@tempa\tikz@tempb\endscope}}
+ \global\let\tikz@dv@label@attribute=\tikz@dv@label@attribute
+ \global\let\tikz@dv@label@threshold=\tikz@dv@label@threshold
+ \endgroup
+ },
+ arg1/.expand once=\tikz@dv@label@attribute,
+ arg2/.expand once=\tikz@dv@label@threshold,
+ arg3/.expand once=\tikz@dv@label@code,
+ arg4=\pgfdvvisualizerfilter{#1}
+ },
+ /utils/exec=\tikz@create@label@count{#1}
+ },
+ % Label style
+ text colored/.style={node style={text=visualizer color}}
+}
+
+\def\tikz@create@label@count#1{
+ \tikzdatavisualizationset{
+ new object={
+ when=after survey,
+ store=/tikz/data visualization/visualizers/#1/count/obj,
+ class=count,
+ arg1=visualizers/#1/count,
+ after creation={
+ \tikzdvobj.set filter({%
+ \pgfkeysgetvalue{/data point/visualizer}\pgf@tempa%
+ \def\pgf@tempb{#1}%
+ \ifx\pgf@tempa\pgf@tempb%
+ \else
+ \pgfdvfilterpassedfalse%
+ \fi
+ })
+ }
+ }
+ }
+}
+
+\pgfkeys{
+ /tikz/data visualization/visualizer label options/.cd,
+ at/.code args={#1>=#2}{%
+ \def\tikz@dv@label@attribute{#1}%
+ \def\tikz@dv@label@threshold{#2}%
+ },
+ index/.code={%
+ \edef\tikz@dv@label@attribute{visualizers/\tikz@visualizer/count}%
+ \def\tikz@dv@label@threshold{#1}%
+ },
+ text/.initial=,
+ text'/.style={text={#1},node style=swap},
+ node style/.style={/tikz/data visualization/node style={#1}},
+ text colored/.style=/tikz/data visualization/text colored,
+}
+
+\let\tikz@dv@label@attribute\pgfutil@empty
+\let\tikz@dv@label@threshold\pgfutil@empty
+\let\tikz@dv@label@code\pgfutil@empty
+
+
+
+
+%
+% Legend handling
+%
+
+\tikzdatavisualizationset{
+ new legend/.code={
+ \pgfkeysifdefined{/tikz/data visualization/#1/at}{}
+ {\tikzdatavisualizationset{
+ new object={
+ class=legend,
+ store=/tikz/data visualization/#1/obj,
+ arg1 from key=/tikz/data visualization/#1/@columns or rows,
+ arg2 from key=/tikz/data visualization/#1/@ideal,
+ arg3 from key=/tikz/data visualization/#1/max entries,
+ arg4 from key=/tikz/data visualization/#1/@strategy,
+ after creation={
+ \tikzdatavisualizationset{
+ legend actions/.append={
+ \pgfkeysgetvalue{/tikz/data visualization/#1/obj}\pgf@dv@legend%
+ {
+ \pgf@dv@legend.get arrangement(\pgf@dv@temp)%
+ \pgfkeysgetvalue{/tikz/data visualization/#1/at}\pgf@dv@at%
+ \pgfkeysgetvalue{/tikz/data visualization/#1/anchor}\pgf@dv@anchor%
+ \let\pgfdvnextcell=\pgfmatrixnextcell%
+ \let\pgfdvendrow=\pgfmatrixendrow%
+ \def\pgf@marshal{
+ \matrix[at/.expand once=\pgf@dv@at,matrix anchor/.expand
+ once=\pgf@dv@anchor,/tikz/data visualization/#1/styling]
+ }
+ \expandafter\pgf@marshal\expandafter{\pgf@dv@temp};
+ }
+ }
+ }
+ }
+ },
+ #1/@columns or rows/.initial=columns,
+ #1/@ideal/.initial=1,
+ #1/max entries/.initial=100,
+ #1/@strategy/.initial=down then right,
+ #1/anchor/.initial=west,
+ #1/at/.initial=(data visualization bounding box.east),
+ #1/styling/.style={row sep=0pt,column sep=.8em},
+ %
+ %
+ %
+ #1/.code={
+ \let\tikz@temp\tikz@dv@legend%
+ \def\tikz@dv@legend{/tikz/data visualization/#1}%
+ \expandafter\tikz@do@legend@options\expandafter{\tikz@temp}{##1}%
+ },
+ #1={every new legend}
+ }}},
+ legend/.style={new legend=legend,legend={#1}}
+}
+
+\def\tikz@do@legend@options#1#2{
+ \pgfkeys{/tikz/data visualization/legend options/.cd,#2}
+ \def\tikz@dv@legend{#1}
+}
+\let\tikz@dv@legend\pgfutil@empty
+
+
+\tikzset{
+ /tikz/data visualization/legend options/.cd,
+ %
+ % How to arrange the entries in the legend
+ %
+ ideal number of columns/.style={\tikz@dv@legend/@columns or rows=columns,\tikz@dv@legend/@ideal={#1}},
+ ideal number of rows/.style={\tikz@dv@legend/@columns or rows=rows,\tikz@dv@legend/@ideal={#1}},
+ columns/.style={ideal number of columns={#1}},% alias
+ rows/.style={ideal number of rows={#1}},% alias
+ max rows/.style={\tikz@dv@legend/@columns or rows=columns,\tikz@dv@legend/max entries={#1}},
+ max columns/.style={\tikz@dv@legend/@columns or rows=rows,\tikz@dv@legend/max entries={#1}},
+ down then right/.style={\tikz@dv@legend/@strategy=down then right},
+ down then left/.style={\tikz@dv@legend/@strategy=down then left},
+ up then right/.style={\tikz@dv@legend/@strategy=up then right},
+ up then left/.style={\tikz@dv@legend/@strategy=up then left},
+ right then down/.style={\tikz@dv@legend/@strategy=right then down},
+ left then down/.style={\tikz@dv@legend/@strategy=left then down},
+ right then up/.style={\tikz@dv@legend/@strategy=right then up},
+ left then up/.style={\tikz@dv@legend/@strategy=left then up},
+ %
+ % Where to put the legend
+ %
+ anchor/.style={\tikz@dv@legend/anchor={#1}},
+ at/.style={\tikz@dv@legend/at={#1}},
+ right/.style={
+ columns=1,
+ at={([xshift=.8em]data visualization bounding box.east)},
+ anchor=west,
+ },
+ left/.style={
+ columns=1,
+ at={([xshift=-.8em]data visualization bounding box.west)},
+ anchor=east,
+ },
+ below/.style={
+ rows=1,
+ at={([yshift=-.5em]data visualization bounding box.south)},
+ anchor=north,
+ },
+ above/.style={
+ rows=1,
+ at={([yshift=.5em]data visualization bounding box.north)},
+ anchor=south,
+ },
+ every new legend/.style={right,label style=text right},
+ %
+ % Label text styling
+ %
+ label style/.style={
+ style={/tikz/data visualization/legend entry options/every label
+ in legend/.append style={#1}}
+ },
+ %
+ % Styling
+ %
+ style/.style={\tikz@dv@legend/styling/.append style={#1}},
+}
+
+
+\tikzdatavisualizationset{
+ new legend entry/.code={
+ \begingroup
+ \pgfkeys{/tikz/data visualization/legend entry options/.cd,#1}
+ \pgfkeysgetvalue{/tikz/data visualization/legend entry options/legend}\tikz@dv@temp@legend
+ \global\let\tikz@dv@temp@legend\tikz@dv@temp@legend
+ \endgroup
+ \tikzdatavisualizationset{new legend/.expanded=\tikz@dv@temp@legend}%
+ \expandafter\tikz@dv@add@legend@entry\expandafter{\tikz@dv@temp@legend}{#1}
+ }
+}
+
+\def\tikz@dv@add@legend@entry#1#2{
+ \tikz@main@dv.at start survey({{
+ \pgfkeysgetvalue{/tikz/data visualization/#1/obj}\pgf@temp
+ \pgf@temp.add entry(\tikz@dv@render@legend@entry{legend=#1,#2})
+ }})
+}
+
+\def\tikz@dv@render@legend@entry#1{
+ \pgfkeys{/tikz/data visualization/.cd,
+ every visualizer label,
+ every visualizer legend label
+ }
+ \pgfkeys{/tikz/data visualization/legend entry options/.cd,#1}
+ \pgfkeysgetvalue{/tikz/data visualization/legend entry options/text}\tikz@dv@temp@lab
+ \pgfkeysgetvalue{/tikz/data visualization/@node styling}\tikz@dv@temp@style
+ \pgfkeysgetvalue{/tikz/data visualization/legend entry options/setup}\tikz@dv@temp@setup
+ \pgfkeysgetvalue{/tikz/data visualization/legend entry options/value visualizer}\tikz@dv@temp@visual
+ \pgfkeysgetvalue{/tikz/data visualization/legend entry options/value visualizer styling}\tikz@dv@temp@visual@styling
+ \scope[/utils/exec=\expandafter\pgfkeysalso\expandafter{\tikz@dv@temp@setup},
+ /utils/exec=\pgf@signalstyle.emit()]
+ \node[/tikz/data visualization/node styling,
+ /utils/exec=\expandafter\pgfkeysalso\expandafter{\tikz@dv@temp@style}]
+ {\tikz@dv@pre@height\tikz@dv@temp@lab\tikz@dv@post@height};
+ \scope[/utils/exec=\expandafter\pgfkeysalso\expandafter{\tikz@dv@temp@visual@styling}]
+ \tikz@dv@temp@visual
+ \endscope
+ \endscope
+}
+
+\def\tikz@dv@pre@height{\hbox{\vrule height .75em width0pt}}
+\def\tikz@dv@post@height{\hbox{\vrule depth .25em width0pt}}
+
+
+
+\pgfkeys{
+ /tikz/data visualization/legend entry options/.cd,
+ %
+ % General options
+ %
+ text/.initial=,
+ node style/.style={/tikz/data visualization/node style={#1}},
+ legend/.initial=legend,
+ setup/.initial=,
+ value visualizer/.initial=,
+ value visualizer styling/.initial=,
+ value visualizer style/.style={value visualizer styling/.append={,#1}},
+ value visualizer macro/.initial=,
+ %
+ % Legend visualizers for plots
+ %
+ text right/.style={
+ node style={anchor=mid west,inner ysep=1pt,inner xsep=0pt,reset cm,xshift=.333em},
+ value visualizer style={reset cm},
+ value visualizer macro=\tikz@dv@legend@entry@as@example
+ },
+ text left/.style={
+ node style={anchor=mid east,inner ysep=1pt,inner xsep=0pt,reset
+ cm,xshift=-.333em,align=right},
+ value visualizer style={reset cm,xscale=-1},
+ value visualizer macro=\tikz@dv@legend@entry@as@example
+ },
+ text only/.style={
+ node style={anchor=mid west,inner ysep=1pt,inner xsep=0pt,reset cm,text=visualizer color},
+ value visualizer style={},
+ value visualizer macro=\relax,
+ },
+ text colored/.style=/tikz/data visualization/text colored,
+}
+
+
+\pgfkeys{
+ /tikz/data visualization/visualizer options/.cd,
+ label in legend/.code={\expandafter\tikz@dv@new@label@in@legend@for@visualizer\expandafter{\tikz@visualizer}{#1}},
+ label in data/.code=\tikzdatavisualizationset{new label visualizer/.expand once=\expandafter{\tikz@visualizer}{#1}},
+ style/.style={/tikz/data visualization/visualizers/\tikz@visualizer/styling/.append style={#1}},
+}
+
+\def\tikz@dv@new@label@in@legend@for@visualizer#1#2{
+ \tikzdatavisualizationset{
+ new legend entry={
+ every legend entry/.try,
+ every label in legend/.try,
+ /tikz/data visualization/every label/.try,
+ #2,
+ setup={/data point/visualizer=#1},
+ /utils/exec=\pgfkeysgetvalue{/tikz/data visualization/legend entry options/value visualizer macro}\tikz@dv@visualizer@macro,
+ value visualizer={
+ \scope[/tikz/data visualization/visualizers/#1/styling/.try]
+ \def\tikz@visualizer{#1}
+ \tikz@dv@visualizer@macro
+ \endscope
+ }
+ }
+ }
+}
+
+\def\tikz@dv@legend@entry@as@example{
+ \pgfkeysvalueof{/data point/\tikz@visualizer/execute at begin}
+ \tikz@plot@handler
+ \pgfplotstreamstart
+ \pgfkeysgetvalue{/tikz/data visualization/label in legend line coordinates}{\tikz@dv@temp}
+ \foreach \coordinate in \tikz@dv@temp
+ { \pgfplotstreampoint{\expandafter\tikz@scan@one@point\expandafter\pgfutil@firstofone\coordinate} }
+ \pgfplotstreamend
+ \pgfkeysvalueof{/data point/\tikz@visualizer/execute at end}
+ \pgfkeysvalueof{/data point/\tikz@visualizer/execute at begin}
+ \tikz@dv@plot@mark@maker
+ \pgfplotstreamstart
+ \pgfkeysgetvalue{/tikz/data visualization/label in legend mark coordinates}{\tikz@dv@temp}
+ \foreach \coordinate in \tikz@dv@temp
+ { \pgfplotstreampoint{\expandafter\tikz@scan@one@point\expandafter\pgfutil@firstofone\coordinate} }
+ \pgfplotstreamend
+ \pgfkeysvalueof{/data point/\tikz@visualizer/execute at end}
+}
+
+
+\tikzdatavisualizationset{
+ label in legend line coordinates/.initial=,
+ label in legend mark coordinates/.initial=,
+ label in legend one mark/.style={
+ label in legend line coordinates={},
+ label in legend mark coordinates={(0,0)},
+ },
+ label in legend three marks/.style={
+ label in legend line coordinates={},
+ label in legend mark coordinates={(-3ex,-.3ex),(-1.5ex,.3ex),(0,0)},
+ },
+ straight label in legend line/.style={
+ label in legend line coordinates={(-2em,0),(0,0)},
+ label in legend mark coordinates={(-1.5em,0),(-.5em,0)},
+ },
+ zig zag label in legend line/.style={
+ label in legend line coordinates={(-2em,0),(-1.5em,.3ex),(-.5em,-.3ex),(0,0)},
+ label in legend mark coordinates={(-1.5em,.3ex),(-.5em,-.3ex)},
+ },
+ circular label in legend line/.style={
+ label in legend line coordinates={%
+ ([xshift=-1em]0:.9em and .35ex),%
+ ([xshift=-1em]30:.9em and .35ex),%
+ ([xshift=-1em]60:.9em and .35ex),%
+ ([xshift=-1em]90:.9em and .35ex),%
+ ([xshift=-1em]120:.9em and .35ex),%
+ ([xshift=-1em]150:.9em and .35ex),%
+ ([xshift=-1em]180:.9em and .35ex),%
+ ([xshift=-1em]210:.9em and .35ex),%
+ ([xshift=-1em]240:.9em and .35ex),
+ ([xshift=-1em]270:.9em and .35ex),%
+ ([xshift=-1em]300:.9em and .35ex),%
+ ([xshift=-1em]330:.9em and .35ex)},
+ label in legend mark coordinates={([xshift=-1em]120:.9em and .35ex),([xshift=-1em]-60:.9em and .35ex)},
+ },
+ gapped circular label in legend line/.style={
+ label in legend line coordinates={%
+ ([xshift=-1em,yshift=.2ex]90:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]162:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]234:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]306:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]18:1.4ex and 0.9ex)},
+ label in legend mark coordinates={
+ ([xshift=-1em,yshift=.2ex]90:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]162:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]234:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]306:1.4ex and 0.9ex),%
+ ([xshift=-1em,yshift=.2ex]18:1.4ex and 0.9ex)}
+ },
+ default label in legend path/.style={zig zag label in legend line},
+ default label in legend closed path/.style={circular label in legend line},
+ default label in legend mark/.style={label in legend one mark},
+}
+
+
+\def\tikz@dv@legend@entry@visualizer@visualizer{
+}
+
+
+
+%
+% Basic visualizers
+%
+
+\tikzdatavisualizationset{
+ visualize as line/.style={
+ new object={
+ when=after survey,
+ store=/tikz/data visualization/visualizers/#1,
+ class=plot handler visualizer,
+ arg1=#1,
+ arg2={\tikz@plot@handler,\tikz@dv@plot@mark@maker}
+ },
+ new visualizer={#1}{%
+ every path/.style={draw},
+ style={every mark/.append style={color=visualizer color}},
+ straight line,
+ semithick,
+ color=visualizer color,
+ mark=none,
+ /tikz/data visualization/every visualize as line/.try,
+ },
+ /data point/visualizer=#1
+ },
+ visualize as line/.default=line,
+ visualize as smooth line/.style={
+ visualize as line={#1},
+ #1={style=smooth line}
+ },
+ visualize as smooth line/.default=line,
+ visualize as scatter/.style={
+ visualize as line={#1},
+ #1={style=no lines,
+ /tikz/data visualization/every visualize as scatter/.try},
+ visualizer style sheet=cross marks
+ },
+ visualize as scatter/.default=scatter
+}
+
+\def\tikz@dv@plot@mark@maker{
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@transform=\pgfutil@empty%
+ \tikzset{solid,shift only,every mark}%
+ \tikz@options%
+ \pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}
+}
+
+
+
+
+% The following needs to be fixed...
+\tikzdatavisualizationset{
+ new rectangles visualizer/.style={
+ new object={
+ store=/tikz/data visualization/visualizers/#1,
+ class=rectangle visualizer,
+ arg1 from key=/tikz/data visualization/#1/attribute 1,
+ arg2 from key=/tikz/data visualization/#1/attribute 2,
+ arg3=#1/use path
+ },
+ #1/attribute 1/.initial=x,
+ #1/attribute 2/.initial=y,
+ /data point/#1/use path/.initial=\pgfusepath{stroke},
+ /data point/#1/style/.code=\pgfkeysalso{/data point/#1/use path={\path[every rectangles/.try,##1];}}
+ },
+ rectangle visualizer/.default=rectangles
+}
+
+
+
+
+
+%
+% Style sheets
+%
+
+% Style sheet handler
+
+\pgfkeysdef{/handlers/.style sheet}{%
+ \edef\pgf@marshal{
+ \noexpand \pgfoonew \noexpand\tikz@dv@temp=new style attribute(\pgfkeyscurrentpath,#1)
+ \noexpand \tikz@dv@temp.default connects()
+ }
+ \pgf@marshal
+}
+
+\tikzset{
+ visualizer color/.code=\colorlet{visualizer color}{#1},
+ visualizer color=black
+}
+
+% Default style sheets
+
+\pgfdvdeclarestylesheet{vary thickness}
+{
+ default style/.style={line width={0.3pt+#1*0.2pt}}
+}
+
+\pgfdvdeclarestylesheet{vary dashing}
+{
+ default style/.style=solid,
+ 1/.style=solid,
+ 2/.style={dash pattern=on 5\pgflinewidth off 2\pgflinewidth},
+ 3/.style={dash pattern=on 1.5\pgflinewidth off 1.5\pgflinewidth},
+ 4/.style={dash pattern=on 5\pgflinewidth off 1.5\pgflinewidth on 1.5\pgflinewidth off 1.5\pgflinewidth},
+ 5/.style={dash pattern=on 10\pgflinewidth off 3\pgflinewidth},
+ 6/.style={dash pattern=on 10\pgflinewidth off 2\pgflinewidth on 2\pgflinewidth off 2\pgflinewidth},
+ 7/.style={dash pattern=on 8\pgflinewidth off 2\pgflinewidth on
+ 1.5\pgflinewidth off 1.5\pgflinewidth on 1.5\pgflinewidth off
+ 1.5\pgflinewidth on 1.5\pgflinewidth off 1.5\pgflinewidth}
+}
+
+\pgfdvdeclarestylesheet{vary thickness and dashing}
+{
+ default style/.style=thin,
+ 1/.style=thin,
+ 2/.style=thick,
+ 3/.style={
+ dash pattern=on 5\pgflinewidth off 2\pgflinewidth,
+ thin
+ },
+ 4/.style={
+ dash pattern=on 5\pgflinewidth off 2\pgflinewidth,
+ thick,
+ },
+ 5/.style={
+ dash pattern=on 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thin
+ },
+ 6/.style={
+ dash pattern=on 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thick
+ },
+ 7/.style={
+ dash pattern=on 5\pgflinewidth off 1.5\pgflinewidth on
+ 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thin
+ },
+ 8/.style={
+ dash pattern=on 5\pgflinewidth off 1.5\pgflinewidth on
+ 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thick
+ },
+ 9/.style={
+ dash pattern=on 10\pgflinewidth off 3\pgflinewidth,
+ thin
+ },
+ 10/.style={
+ dash pattern=on 10\pgflinewidth off 3\pgflinewidth,
+ thick
+ },
+ 11/.style={
+ dash pattern=on 10\pgflinewidth off 2\pgflinewidth on
+ 2\pgflinewidth off 2\pgflinewidth,
+ thin
+ },
+ 12/.style={
+ dash pattern=on 10\pgflinewidth off 2\pgflinewidth on
+ 2\pgflinewidth off 2\pgflinewidth,
+ thick
+ },
+ 13/.style={
+ dash pattern=on 8\pgflinewidth off 2\pgflinewidth on
+ 1.5\pgflinewidth off 1.5\pgflinewidth on 1.5\pgflinewidth off
+ 1.5\pgflinewidth on 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thin
+ },
+ 14/.style={
+ dash pattern=on 8\pgflinewidth off 2\pgflinewidth on
+ 1.5\pgflinewidth off 1.5\pgflinewidth on 1.5\pgflinewidth off
+ 1.5\pgflinewidth on 1.5\pgflinewidth off 1.5\pgflinewidth,
+ thick
+ }
+}
+
+
+\pgfdvdeclarestylesheet{strong colors}
+{
+ default style/.style={black},
+ 1/.style={visualizer color=black},
+ 2/.style={visualizer color=red!80!black},
+ 3/.style={visualizer color=blue!80!black},
+ 4/.style={visualizer color=green!60!black},
+ 5/.style={visualizer color=orange!80!black},
+ 6/.style={visualizer color=black!60}
+}
+
+
+\pgfdvdeclarestylesheet{cross marks}
+{
+ default style/.style={mark=x,every mark/.append style=thin,mark size=1.8pt},
+ 1/.style={mark=x,every mark/.append style=thin,mark size=1.8pt},
+ 2/.style={mark=+,every mark/.append style=thin,mark size=1.8pt},
+ 3/.style={mark=Mercedes star,every mark/.append style=thin,mark size=1.8pt},
+ 4/.style={mark=Mercedes star flipped,every mark/.append style=thin,mark size=1.8pt},
+ 5/.style={mark=star,every mark/.append style=thin,mark size=1.8pt},
+ 6/.style={mark=10-pointed star,every mark/.append style={line width=.3pt,mark size=1.6pt}}
+}
+
+
+
+% Declare a color series style sheet
+%
+% #1 = name of the style sheet
+% #2 = color model
+% #3 = initial color
+% #4 = step
+%
+% Description:
+%
+% This function declares a style sheet that changes colors according
+% to the value of the attribute. No test is made that the attribute is
+% a number.
+
+\def\tikzdvdeclarestylesheetcolorseries#1#2#3#4{
+ \definecolorseries{tikzdvcolorseries#1}{#2}{step}[#2]{#3}{#4}
+ \resetcolorseries{tikzdvcolorseries#1}
+ \pgfdvdeclarestylesheet{#1}
+ {
+ default style/.style={
+ /utils/exec=\colorlet{tikz@dv@temp}[rgb]{tikzdvcolorseries#1!![##1]},
+ visualizer color=tikz@dv@temp
+ }
+ }
+}
+
+\tikzdvdeclarestylesheetcolorseries{varying hue}{hsb}{.4,0.9,0.8}{.213,0,0}
+\tikzdvdeclarestylesheetcolorseries{shades of blue}{hsb}{.65,1.4,1}{0,-.4,-.0}
+\tikzdvdeclarestylesheetcolorseries{shades of red}{hsb}{0,1.4,1}{0,-.4,-.0}
+
+
+
+
+
+%
+% Basic Axes & Coordinate Systems
+%
+
+
+%
+%
+% Basic axis systems
+%
+%
+
+\tikzdatavisualizationset{
+ xy Cartesian/.style={
+ new Cartesian axis=x axis,
+ x axis={attribute=x,unit vector={(1pt,0cm)}},
+ new Cartesian axis=y axis,
+ y axis={attribute=y,unit vector={(0cm,1pt)}}
+ },
+ xy axes/.style={x axis={#1},y axis={#1}},
+ uv Cartesian/.style={
+ new Cartesian axis=u axis,
+ u axis={attribute=u,unit vector={(1pt,0cm)}},
+ new Cartesian axis=v axis,
+ v axis={attribute=v,unit vector={(0cm,1pt)}}
+ },
+ uv axes/.style={u axis={#1},v axis={#1}},
+}
+
+\tikzdatavisualizationset{
+ xyz Cartesian cabinet/.style={
+ xy Cartesian,
+ new Cartesian axis=z axis,
+ z axis={attribute=z,unit vector={(-0.353553pt,-0.353553pt)}}
+ },
+ xyz axes/.style={x axis={#1},y axis={#1},z axis={#1}},
+ uvw Cartesian cabinet/.style={
+ uv Cartesian,
+ new Cartesian axis=w axis,
+ w axis={attribute=w,unit vector={(-0.353553pt,-0.353553pt)}}
+ }
+ uvw axes/.style={u axis={#1},v axis={#1},w axis={#1}},
+}
+
+
+
+
+% The school book axes
+%
+% This coordinate system can be used to create plots that look like
+% plots in a typical school book: There are two axes called "x axis"
+% and "y axis" that meet at the origin, there are arrows at the ends
+% of the axes, pointing in the directions of the positive axes. No
+% scaling is done by default, rather one unit equals one 1cm. This
+% ensures that the even when multiple plots are created, the same
+% scaling will be used each time.
+%
+% To change the scaling, say "all axes={unit length=1mm}" for
+% instance.
+
+\tikzdatavisualizationset{
+ school book axes/.style={
+ xy Cartesian,
+ x axis={
+ include values=0,
+ visualize axis={y axis={goto=0},style=->,padded},
+ visualize ticks={common={y axis={goto=0},direction axis=y axis},
+ major={tick text at low,
+ options at=0 as [{style={draw=none},no tick text}]
+ }},
+ visualize grid={common={direction axis=y axis,padded}},
+ ticks={step=1},
+ padding=0.75em,
+ visualize label={visualize x axis label}
+ },
+ y axis={
+ include values=0,
+ visualize axis={x axis={goto=0},style=->,padded},
+ visualize ticks={
+ common={x axis={goto=0},direction axis=x axis},
+ major={tick text at low,options at=0 as [{high=0,low=0,style={draw=none},node style={anchor=north east}}]}
+ },
+ visualize grid={common={direction axis=x axis,padded}},
+ ticks={step=1},
+ padding=0.75em,
+ visualize label={visualize y axis label}
+ },
+ school book axes standard labels,
+ every school book axes/.try
+ }
+}
+
+
+% Possible axis positionings:
+
+\tikzdatavisualizationset{
+ %
+ % Place labels at the ends of the axes
+ school book axes standard labels/.style={
+ visualize x axis label/.style={
+ value=padded max,
+ y axis={goto=0}
+ },
+ visualize y axis label/.style={
+ value=padded max,
+ x axis={goto=0}
+ }
+ }
+}
+
+
+% The scientific axes
+%
+% The scientific axes is a 2d plot that has a predetermined width and
+% height. The data is then scaled in such a way that it fits inside
+% this given rectangle.
+
+\tikzdatavisualizationset{
+ scientific axes/width/.initial=5cm,
+ scientific axes/height/.initial=0.618*\pgfkeysvalueof{/tikz/data visualization/scientific axes/width},% golden ratio...
+ scientific axes/.style={
+ xy Cartesian,
+ every axis/.append style={style={draw=black!50}},
+ every ticks/.append style={style={draw=black!50}},
+ x axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/width},
+ ticks={some},
+ visualize ticks={common={y axis={goto=padded min},direction axis=y axis,high=0pt},major={tick text at low}},
+ visualize ticks={common={y axis={goto=padded max},direction axis=y axis,low=0pt}},
+ visualize axis={y axis={goto=padded min},padded},
+ visualize axis={y axis={goto=padded max},padded},
+ visualize grid={common={direction axis=y axis,padded}},
+ visualize label=visualize x axis label
+ },
+ y axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/height},
+ ticks={some},
+ visualize ticks={common={x axis={goto=padded min},direction axis=x axis,high=0pt},major={tick text at low}},
+ visualize ticks={common={x axis={goto=padded max},direction axis=x axis,low=0pt}},
+ visualize axis={x axis={goto=padded min},padded},
+ visualize axis={x axis={goto=padded max},padded},
+ visualize grid={common={direction axis=x axis,padded}},
+ visualize label=visualize y axis label
+ },
+ scientific axes standard labels,
+ every scientific axes/.try
+ },
+ scientific inner axes/.style={
+ xy Cartesian,
+ every axis/.append style={style={draw=black!50}},
+ every ticks/.append style={style={draw=black!50}},
+ x axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/width},
+ ticks={some},
+ visualize ticks={common={y axis={goto=padded min},direction axis=y axis,low=0pt},major={tick text at low}},
+ visualize ticks={common={y axis={goto=padded max},direction axis=y axis,high=0pt}},
+ visualize axis={y axis={goto=padded min},padded},
+ visualize axis={y axis={goto=padded max},padded},
+ visualize grid={common={direction axis=y axis,padded}},
+ visualize label=visualize x axis label
+ },
+ y axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/height},
+ ticks={some},
+ visualize ticks={common={x axis={goto=padded min},direction axis=x axis,low=0pt},major={tick text at low}},
+ visualize ticks={common={x axis={goto=padded max},direction axis=x axis,high=0pt}},
+ visualize axis={x axis={goto=padded min},padded},
+ visualize axis={x axis={goto=padded max},padded},
+ visualize grid={common={direction axis=x axis,padded}},
+ visualize label=visualize y axis label
+ },
+ scientific axes standard labels,
+ every scientific axes/.try
+ },
+ scientific clean axes/.style={
+ xy Cartesian,
+ x axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/width},
+ ticks={some},
+ visualize ticks={common={y axis={goto=padded min},direction axis=y axis,high=0pt},major={tick text at low}},
+ visualize axis={y axis={goto=padded min}},
+ visualize grid={common={direction axis=y axis}},
+ visualize label=visualize x axis label,
+ grid={major={also at=min,also at=max}},
+ },
+ y axis={
+ length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/height},
+ ticks={some},
+ visualize ticks={common={x axis={goto=padded min},direction axis=x axis,high=0pt},major={tick text at low}},
+ visualize axis={x axis={goto=padded min}},
+ visualize grid={common={direction axis=x axis}},
+ visualize label=visualize y axis label,
+ grid={major={also at=min,also at=max}},
+ },
+ all axes={padding=.5em},
+ scientific axes standard labels,
+ every scientific axes/.try
+ },
+}
+
+
+
+% Possible axis positionings:
+
+\tikzdatavisualizationset{
+ %
+ % Place axes labels below and left, where left label is rotated
+ %
+ scientific axes standard labels/.style={
+ visualize x axis label/.style={
+ % Horizontal position is middle of axis:
+ pos=0.5,
+ y axis={goto=padded min},
+ % Vertical position comes from bounding box:
+ node style={
+ at={(0,0 |- data visualization bounding box.south)},
+ below
+ }
+ },
+ visualize y axis label/.style={%
+ % Vertical position is middle of axis:
+ pos=0.5,
+ x axis={goto=padded min},
+ % Horizontal position comes from bounding box:
+ node style={
+ at={(0,0 -| data visualization bounding box.west)},
+ rotate=90,
+ above}
+ }
+ },
+ %
+ % Place axes labels below and left, no rotation
+ %
+ scientific axes upright labels/.style={
+ scientific axes standard labels,
+ visualize y axis label/.style={%
+ % Vertical position is middle of axis:
+ pos=0.5,
+ x axis={goto=padded min},
+ % Horizontal position comes from bounding box:
+ node style={
+ at={(0,0 -| data visualization bounding box.west)},
+ left
+ }
+ }
+ },
+ %
+ % Place axes at the ends of the axes
+ %
+ scientific axes end labels/.style={
+ visualize x axis label/.style={
+ value=max,
+ y axis={goto=padded min},
+ % Vertical position comes from bounding box:
+ node style={
+ at={(0,0 -| data visualization bounding box.east)},
+ right
+ }
+ },
+ visualize y axis label/.style={
+ value=max,
+ x axis={goto=padded min},
+ % Horizontal position comes from bounding box:
+ node style={
+ at={(0,0 |- data visualization bounding box.north)},
+ above
+ }
+ }
+ }
+}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex
new file mode 100644
index 00000000000..4a4d0896ec8
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex
@@ -0,0 +1,16 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex,v 1.1 2008/12/09 00:12:10 tantau Exp $
+
+\usetikzlibrary{datavisualization}
+\usepgflibrary{datavisualization.formats.functions}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex
new file mode 100644
index 00000000000..8b4d99f49dd
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex
@@ -0,0 +1,62 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex,v 1.3 2008/11/24 18:31:22 tantau Exp $
+
+\usetikzlibrary{datavisualization}
+\usepgflibrary{datavisualization.polar}
+
+
+\tikzdatavisualizationset{%
+ new polar/.style={
+ new axis=angle axis,
+ angle axis={attribute=angle},
+ new axis=radius axis,
+ radius axis={attribute=radius},
+ radius axis/scaling/default=0 at 0 and 1 at 1cm,
+ new object={
+ store=/tikz/data visualization/polar transformer,
+ class=polar transformer,
+ arg1/.expanded=\pgfkeysvalueof{/tikz/data visualization/angle axis/attribute}/scaled,
+ arg2/.expanded=\pgfkeysvalueof{/tikz/data visualization/radius axis/attribute}/scaled,
+ arg3 from key=/tikz/data visualization/#1/unit vector 0 degrees,
+ arg4 from key=/tikz/data visualization/#1/unit vector 90 degrees
+ },
+ /tikz/data visualization/#1/unit vector 0 degrees/.initial=\pgfqpoint{1pt}{0pt},
+ /tikz/data visualization/#1/unit vector 90 degrees/.initial=\pgfqpoint{0pt}{1pt},
+ /tikz/data visualization/#1/unit vectors/.code 2 args={
+ \def\tikz@dv@polar{/tikz/data visualization/#1}
+ \tikz@scan@one@point\tikz@lib@dv@polar@a##1
+ \tikz@scan@one@point\tikz@lib@dv@polar@b##2
+ }
+ },
+ new polar/.default=polar
+}
+\def\tikz@lib@dv@polar@a#1{
+ \pgfkeyssetvalue{\tikz@dv@polar/unit vector 0 degrees}{#1}
+}
+\def\tikz@lib@dv@polar@b#1{
+ \pgfkeyssetvalue{\tikz@dv@polar/unit vector 90 degrees}{#1}
+}
+
+
+\tikzset{
+ /tikz/data visualization/axis options/.cd,
+ deg/.style={\tikz@dv@axis/scaling=0 at 0 and 360 at 360},
+ rad/.style={\tikz@dv@axis/scaling=0 at 0 and pi at 180},
+ grad/.style={\tikz@dv@axis/scaling=0 at 0 and 400 at 360},
+ percent/.style={\tikz@dv@axis/scaling=0 at 0 and 100 at 360},
+ full circle/.style={\tikz@dv@axis/scaling=min at 0 and max at 360},
+ half circle/.style={\tikz@dv@axis/scaling=min at 0 and max at 180},
+ quarter circle/.style={\tikz@dv@axis/scaling=min at 0 and max at 90}
+}
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex
new file mode 100644
index 00000000000..69736423596
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex
@@ -0,0 +1,38 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex,v 1.1 2008/12/17 22:48:46 tantau Exp $
+
+\usetikzlibrary{datavisualization}
+
+
+
+
+%
+% Sparklines (not yet usable...)
+%
+
+\tikzdatavisualizationset{
+ spark line/.style={
+ xy Cartesian,
+ x axis={
+ unit length={1pt}
+ },
+ y axis={
+ scaling={min at -0.2em and max at 0.8em}
+ },
+ new line plot,
+ every spark line plot/.try
+ }
+}
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex
new file mode 100644
index 00000000000..7464369161c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex
@@ -0,0 +1,29 @@
+% Copyright 2010 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.basic.code.tex,v 1.1 2010/10/23 16:35:41 tantau Exp $
+
+
+
+%
+% This is jsut a place-holder
+%
+
+\tikzset{graphs/n/.initial=1}
+
+\tikzdefgraph{K}
+{
+ \pgfkeysgetvalue{/tikz/graphs/n}\tikz@lib@graph@temp@n
+}
+{
+ [connect as=clique]
+ \foreach \tikz@lib@graph@temp@i in {1,...,\tikz@lib@graph@temp@n}
+ { \tikz@lib@graph@temp@i [at=(\tikz@lib@graph@temp@i*360/\tikz@lib@graph@temp@n:2cm)] }
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex
new file mode 100644
index 00000000000..32fd3a374a7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex
@@ -0,0 +1,877 @@
+% Copyright 2010 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex,v 1.1 2010/10/23 16:35:41 tantau Exp $
+
+
+%
+% Interface keys
+%
+
+\tikzset{
+ graphs/new edge directed/.code n args={3}{\path (#1) edge[->,#3] (#2);},
+ graphs/new edge undirected/.code n args={3}{\path (#1) edge[-,#3] (#2);},
+ graphs/new edge bidirected/.code n args={3}{\path (#1) edge[<->,#3] (#2);},
+ graphs/new edge back directed/.style n args={3}{new edge directed={#2}{#1}{#3}},
+ graphs/default edge kind/.initial=undirected
+}
+
+
+%
+% Keys for using nodes declared outside a graph inside a graph as if
+% it were declared there
+%
+
+\tikzset{
+ graphs/use existing nodes/.code=\tikz@lib@graph@alltrue
+}
+
+\tikzset{
+ new set/.code={
+ \expandafter\global\expandafter\let\csname tikz@lg@node@set #1\endcsname\pgfutil@empty%
+ },
+ set/.code={
+ \expandafter\def\expandafter\tikz@alias\expandafter{\tikz@alias%
+ \expandafter\def\expandafter\pgf@temp\expandafter{\csname tikz@lg@node@set #1\endcsname}%
+ \expandafter\expandafter\expandafter\pgfutil@g@addto@macro\expandafter\pgf@temp\expandafter{\expandafter\tikz@lg@do\expandafter{\tikz@fig@name}}%
+ }%
+ },%
+}
+
+\newif\iftikz@lib@graph@all
+
+
+%
+% Basic options
+%
+
+\tikzset{
+ graphs/@nodes styling/.style=,
+ graphs/nodes/.style={/tikz/graphs/@nodes styling/.append style={,#1}},
+ graphs/@edges styling/.initial=,
+ graphs/edges/.style={/tikz/graphs/@edges styling/.append={,#1}},
+ graphs/join/.initial=match,
+ graphs/connect as/.initial=,
+}
+
+
+%
+% The parser
+%
+
+\def\tikz@lib@graph@parser{%
+ \pgfutil@ifnextchar[{\tikz@lib@graph@parser@}{\tikz@lib@graph@parser@[]}%]
+}
+
+\long\def\tikz@lib@graph@parser@[#1]#2{%
+ \scope[graphs/.cd,every graph/.try,#1]%
+ \let\tikz@lib@graph@options\pgfutil@empty%
+ \let\tikz@lib@graph@node@list\pgfutil@empty%
+ \tikz@lib@graph@parse@group{#2}%
+ \let\tikz@lg@do=\tikz@lib@graph@cleanup%
+ \tikz@lib@graph@node@list%
+ \endscope%
+ \tikz@lib@graph@parser@done%
+}
+
+
+
+
+\long\def\tikz@lib@graph@parse@group#1{%
+ \let\tikz@lib@graph@group@c\pgfutil@empty%
+ \let\tikz@lib@graph@group@cont\pgfutil@empty%
+ \let\tikz@lib@graph@group@conta\pgfutil@empty%
+ \tikz@lib@graph@par#1\par\pgf@stop@eogroup%
+}
+
+
+
+%
+% Remove \par
+%
+
+\long\def\tikz@lib@graph@par#1\par{%
+ \pgfutil@ifnextchar\pgf@stop@eogroup{%
+ \expandafter\tikz@lib@graph@encloser\tikz@lib@graph@group@c#1[}{%
+ \expandafter\def\expandafter\tikz@lib@graph@group@c\expandafter{\tikz@lib@graph@group@c#1}%
+ \tikz@lib@graph@par%
+ }%
+}
+
+
+%
+% Replace ...[...]... by ...[{...}]...
+%
+\def\tikz@lib@graph@encloser#1[{%
+ \pgfutil@ifnextchar\pgf@stop@eogroup{%
+ \expandafter\tikz@lib@graph@semi\tikz@lib@graph@group@cont#1;%
+ }{%
+ \expandafter\def\expandafter\tikz@lib@graph@group@cont\expandafter{\tikz@lib@graph@group@cont#1[}%]
+ \tikz@lib@graph@encloser@cont%
+ }%
+}
+
+\def\tikz@lib@graph@encloser@cont#1]#2[{%
+ \pgfutil@ifnextchar\pgf@stop@eogroup{%
+ \expandafter\tikz@lib@graph@semi\tikz@lib@graph@group@cont{#1}]#2;}{%
+ \expandafter\def\expandafter\tikz@lib@graph@group@cont\expandafter{\tikz@lib@graph@group@cont{#1}]#2[}%
+ \tikz@lib@graph@encloser@cont}%
+}
+
+
+%
+% Replace ; by ,
+%
+
+\def\tikz@lib@graph@semi#1;{%
+ \pgfutil@ifnextchar\pgf@stop@eogroup{%
+ \expandafter\tikz@lib@graph@start@group\tikz@lib@graph@group@conta#1,}{%
+ \expandafter\def\expandafter\tikz@lib@graph@group@conta\expandafter{\tikz@lib@graph@group@conta#1,}%
+ \tikz@lib@graph@semi%
+ }%
+}
+
+
+
+%
+% Start of a group
+%
+\def\tikz@lib@graph@start@group{%
+ \pgfutil@ifnextchar[\tikz@lib@graph@start@group@opt{\tikz@lib@graph@start@group@opt[]}%]
+}
+
+\def\tikz@lib@graph@start@group@opt[#1]{%
+ \pgfkeys{/tikz/graphs/.cd,connect as=,every group/.try,#1}%
+ \tikz@lib@graph@main@parser%
+}
+
+
+%
+% Main parse
+%
+
+\def\tikz@lib@graph@main@parser#1,{%
+ \begingroup%
+ \let\tikz@lib@graph@stored@actions\pgfutil@empty%
+ \let\tikz@lib@graph@node@list\pgfutil@empty% reset
+ \tikz@lib@graph@parse@one#1-\pgf@stop@eodashes%
+}
+
+
+\def\tikz@lib@graph@parse@one{%
+ \pgfutil@ifnextchar\bgroup\tikz@lib@graph@scope\tikz@lib@graph@node%
+}
+
+
+
+
+% A normal node
+
+\def\tikz@lib@graph@node#1-{%
+ % Detect trailing <
+ \tikz@lib@graph@@node#1<\pgf@stop%
+}
+
+\def\tikz@lib@graph@@node#1<#2\pgf@stop%
+{
+ %
+ % #1 will be a node (not a group)
+ %
+ % Syntax: node name [options]
+ %
+ % Grab node name
+ \tikz@lib@graph@grab@name#1[\pgf@stop%
+ \tikz@lib@graph@stored@actions%
+ \pgfutil@ifnextchar\pgf@stop@eodashes{%
+ \tikz@lib@graph@graph@done%
+ }{%
+ %
+ % Now, get arrow kind
+ %
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \expandafter\tikz@lib@graph@no@back@arrow%
+ \else%
+ \expandafter\tikz@lib@graph@back@arrow%
+ \fi%
+ }%
+}
+
+\def\tikz@lib@graph@no@back@arrow{%
+ \pgfutil@ifnextchar>\tikz@lib@graph@forward@arrow{%
+ \pgfutil@ifnextchar-\tikz@lib@graph@undirected@arrow{%
+ \PackageError{graphs library}{One of the arrow types <-, --, ->, or <-> expected}{}%
+ \tikz@lib@graph@undirected@arrow%
+ }%
+ }%
+}
+
+\def\tikz@lib@graph@undirected@arrow-{%
+ \def\tikz@lib@graph@arrow@type{undirected}%
+ \tikz@lib@graph@after@arrow%
+}
+
+\def\tikz@lib@graph@forward@arrow>{%
+ \def\tikz@lib@graph@arrow@type{directed}%
+ \tikz@lib@graph@after@arrow%
+}
+
+\def\tikz@lib@graph@bi@arrow>{%
+ \def\tikz@lib@graph@arrow@type{bidirected}%
+ \tikz@lib@graph@after@arrow%
+}
+
+\def\tikz@lib@graph@back@arrow{%
+ \pgfutil@ifnextchar>{\tikz@lib@graph@bi@arrow}{%
+ \def\tikz@lib@graph@arrow@type{back directed}%
+ \tikz@lib@graph@after@arrow%
+ }%
+}
+
+\def\tikz@lib@graph@after@arrow{%
+ \pgfutil@ifnextchar[{\tikz@lib@graph@after@arrow@opt}{\tikz@lib@graph@after@arrow@opt[]}%]
+}
+
+\def\tikz@lib@graph@after@arrow@opt[#1]{%
+ %
+ % Ok, first recolor
+ %
+ \pgfkeys{/tikz/graph node/recolor in by=in''}
+ \pgfkeys{/tikz/graph node/recolor out by=out'}
+ % Save action for next node
+ \expandafter\def\expandafter\tikz@lib@graph@stored@actions\expandafter{%
+ \expandafter\tikz@lib@graph@joiner\expandafter{\tikz@lib@graph@arrow@type}{#1}}%
+ \tikz@lib@graph@parse@one%
+}
+
+\def\tikz@lib@graph@joiner#1#2{%
+ \pgfkeys{/tikz/graph node/recolor in by=in'}
+ \pgfkeys{/tikz/graph node/recolor in'' by=in}
+ {%
+ \pgfkeyssetvalue{/tikz/graphs/default edge kind}{#1}%
+ \pgfkeys{/tikz/graphs/.cd,#2}%
+ \pgfkeysgetvalue{/tikz/graphs/join}\pgf@temp%
+ \expandafter\tikz@lg@do@connector\expandafter{\pgf@temp}%
+ }%
+ \pgfkeys{/tikz/graph node/!in',/tikz/graph node/!out'}
+}
+
+\def\tikz@lib@graph@graph@done\pgf@stop@eodashes{%
+ % Get node list outside...
+ \expandafter%
+ \endgroup%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list}%
+ \pgfutil@ifnextchar\pgf@stop@eogroup%
+ \tikz@lib@graph@graph@group@done%
+ \tikz@lib@graph@main@parser%
+}
+
+\def\tikz@lib@graph@graph@group@done\pgf@stop@eogroup{%
+ \pgfkeysgetvalue{/tikz/graphs/connect as}\tikz@lib@graph@group@connector
+ \expandafter\tikz@lg@do@connector\expandafter{\tikz@lib@graph@group@connector}
+}
+
+\def\tikz@lg@do@connector#1{%
+ \tikzset{/tikz/connectors/.cd,#1}
+}
+
+
+
+%
+% Handle node
+%
+\def\tikz@lib@graph@grab@name{%
+ \pgfutil@ifnextchar\foreach\tikz@lib@graph@do@foreach\tikz@lib@graph@grab@name@@%
+}
+
+\def\tikz@lib@graph@do@foreach\foreach#1in#2#3[\pgf@stop{%
+ % Ok, we do a parse on a foreach loop.
+ % We have to make sure that we
+ \begingroup
+ \let\tikz@lib@graph@node@list@saved\pgfutil@empty%
+ \foreach #1 in {#2}%
+ {%
+ \let\tikz@lib@graph@node@list\tikz@lib@graph@node@list@saved%
+ \tikz@lib@graph@parse@group{#3}%
+ \global\let\tikz@lib@graph@node@list@saved\tikz@lib@graph@node@list%
+ }%
+ \expandafter%
+ \endgroup%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list@saved}%
+}
+
+
+\def\tikz@lib@graph@grab@name@@#1[{%
+ \tikz@lib@graph@read#1\pgf@stop%
+ \let\tikz@lib@graph@as\tikz@lib@graph@as@default%
+ \pgfutil@ifnextchar\pgf@stop{%
+ \ifx\tikz@lib@graph@name\pgfutil@empty%
+ \else
+ \expandafter\tikz@lib@graph@noskip%
+ \fi%
+ }{\tikz@lib@graph@node@opt[}%
+}
+\def\tikz@lib@graph@noskip{\tikz@lib@graph@node@opt[][}%]
+
+\def\tikz@lib@graph@as@default{%
+ \let\tikzgraphnodename\tikz@lib@graph@name%
+ \tikz@lib@graph@typesetter%
+}
+
+\def\tikz@lib@graph@read#1\pgf@stop{%
+ \pgfkeys@spdef\tikz@lib@graph@name{#1}%
+ \edef\tikz@lib@graph@name{\tikz@lib@graph@path\tikz@lib@graph@name}%
+}
+
+
+\def\tikz@lib@graph@node@opt[#1]#2[\pgf@stop{%
+ \ifx\tikz@lib@graph@name\tikz@lib@graph@usetext
+ % Ok, make a list of the nodes stored in #1:
+ \let\tikz@lg@temp\pgfutil@empty%
+ \foreach \tikz@lg@node@name in {#1} {\expandafter\tikz@lib@graph@handle@use\expandafter{\tikz@lg@node@name}}
+ % Ok, now add the nodes to the node list
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\tikz@lib@graph@node@list\tikz@lg@temp}%
+ % Then color and initialize them:
+ \let\tikz@lg@do\tikz@lib@graph@do@use%
+ \tikz@lg@temp%
+ \else%
+ \expandafter\ifx\csname tikz@lib@graph@def@\tikz@lib@graph@name\endcsname\relax%
+ {%
+ \edef\tikz@lib@graph@node@list{\noexpand\tikz@lg@do{\tikz@lib@graph@name}}%
+ \tikz@lg@if@local@node{\tikz@lib@graph@name}%
+ {\tikzset{/tikz/graph node/.cd,in,out,#1}}%
+ {%
+ \tikz@lg@init@color{\tikz@lib@graph@name}{\tikz@lgc@all@true\tikz@lgc@in@true\tikz@lgc@out@true}%
+ \iftikz@lib@graph@all%
+ \tikzset{/tikz/graph node/.cd,#1}%
+ \else%
+ \node [name=\tikz@lib@graph@name,/tikz/graph
+ node/.cd,/tikz/graphs/@nodes styling,#1]
+ {\tikz@lib@graph@as};%
+ \fi
+ }%
+ }%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\tikz@lib@graph@node@list\expandafter\tikz@lg@do\expandafter{\tikz@lib@graph@name}}%
+ \else
+ % The name of the node is a graph name
+ \tikz@lib@graph@handle@graph{#1}%
+ \fi
+ \fi%
+}
+
+\def\tikz@lib@graph@handle@use#1{%
+ % Is #1 the name of a node set?
+ \expandafter\let\expandafter\pgf@temp\csname tikz@lg@node@set #1\endcsname
+ \ifx\pgf@temp\relax
+ \pgfutil@g@addto@macro\tikz@lg@temp{\tikz@lg@do{#1}}
+ \else%
+ \expandafter\pgfutil@g@addto@macro\expandafter\tikz@lg@temp\expandafter{\pgf@temp}
+ \fi
+}
+
+\def\tikz@lib@graph@do@use#1{%
+ \tikz@lg@init@color{#1}{\tikz@lgc@all@true\tikz@lgc@in@true\tikz@lgc@out@true}%
+}
+
+\def\tikz@lib@graph@usetext{use}
+
+\def\tikz@lib@graph@typeset@def#1 as #2\pgf@stop{
+ \def\tikz@lib@graph@typesetter#1\pgf@stop{#2}
+}
+
+\tikzset{
+ graphs/typeset/.store in=\tikz@lib@graph@typesetter,
+ graphs/math nodes/.style={/tikz/graphs/typeset=$\tikzgraphnodename$},
+ graphs/empty nodes/.style={/tikz/graphs/typeset=},
+ graphs/typeset=\tikzgraphnodename
+}
+
+
+%
+% Handle scope
+%
+\def\tikz@lib@graph@scope#1{
+ \begingroup
+ \let\tikz@lib@graph@node@list\pgfutil@empty%
+ \tikz@lib@graph@parse@group{#1}%
+ \expandafter%
+ \endgroup%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list}%
+ \tikz@lib@graph@stored@actions%
+ \pgfutil@ifnextchar-{\tikz@lib@graph@scope@minus}{%
+ \pgfutil@ifnextchar<{\tikz@lib@graph@scope@less}{%
+ \PackageError{graphs library}{One of the arrow types <-, --, ->,
+ or <-> expected}{}%
+ }%
+ }%
+}
+
+\def\tikz@lib@graph@scope@minus-{
+ \pgfutil@ifnextchar>\tikz@lib@graph@forward@arrow{%
+ \pgfutil@ifnextchar-\tikz@lib@graph@undirected@arrow{%
+ \pgfutil@ifnextchar\pgf@stop@eodashes\tikz@lib@graph@graph@done{%
+ \PackageError{graphs library}{One of the arrow types <-, --, ->, or <-> expected}{}%
+ \tikz@lib@graph@undirected@arrow%
+ }%
+ }%
+ }%
+}
+
+\def\tikz@lib@graph@scope@less<-{\tikz@lib@graph@back@arrow}%
+
+
+
+
+%
+% Predefining graphs
+%
+
+\def\tikzdefgraph#1#2#3{%
+ \expandafter\def\csname tikz@lib@graph@def@#1\endcsname{\tikz@lib@graph@do@graph{#2}{#3}}%
+}
+
+\def\tikz@lib@graph@handle@graph#1{%
+ \begingroup%
+ \let\tikz@lib@graph@node@list\pgfutil@empty%
+ \tikzset{graphs/.cd,#1}%
+ \csname tikz@lib@graph@def@\tikz@lib@graph@name\endcsname%
+ \expandafter%
+ \endgroup%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list}%
+}
+
+\def\tikz@lib@graph@do@graph#1#2{%
+ #1%
+ \tikz@lib@graph@parse@group{#2}%
+}
+
+\let\tikz@lib@graph@path\pgfutil@empty
+
+\tikzset{graphs/name/.code={%
+ \edef\tikz@lib@graph@path{#1\space\tikz@lib@graph@path}%
+ }%
+}
+
+
+%
+% Colors
+%
+
+\tikzset{
+ graph node/.unknown/.code={%
+ \let\tikz@key\pgfkeyscurrentname%
+ \pgfkeys{/tikz/\tikz@key={#1}}%
+ },
+ graph node/as/.code=\def\tikz@lib@graph@as{#1}%
+}
+
+
+\tikzset{%
+ new graph color/.style={%
+ /utils/exec=\expandafter\newif\csname iftikz@lgc@#1@\endcsname,
+ graph node/#1/.code={%
+ \edef\tikz@lg@col{\expandafter\noexpand\csname tikz@lgc@#1@true\endcsname}%
+ \let\tikz@lg@do\tikz@lg@colorize%
+ \tikz@lib@graph@node@list%
+ },
+ graph node/!#1/.code={%
+ \edef\tikz@lg@old@col{\expandafter\noexpand\csname tikz@lgc@#1@true\endcsname}%
+ \def\tikz@lg@new@col{}%
+ \let\tikz@lg@do\tikz@lg@change@color%
+ \tikz@lib@graph@node@list%
+ },
+ graph node/recolor #1 by/.code={%
+ \edef\tikz@lg@old@col{\expandafter\noexpand\csname tikz@lgc@#1@true\endcsname}%
+ \edef\tikz@lg@new@col{\expandafter\noexpand\csname tikz@lgc@##1@true\endcsname}%
+ \let\tikz@lg@do\tikz@lg@change@color%
+ \tikz@lib@graph@node@list%
+ },
+ graph node/not #1/.style=!#1,
+ },
+ new graph color=in,
+ new graph color=in',
+ new graph color=in'',
+ new graph color=out,
+ new graph color=out',
+ new graph color=all
+}
+
+\def\tikz@lg@init@color#1#2{%
+ \expandafter\gdef\csname tikz@lgc@#1\endcsname{#2}%
+}
+
+\def\tikz@lib@graph@cleanup#1{%
+ \expandafter\global\expandafter\let\csname tikz@lgc@#1\endcsname\relax%
+}
+
+\def\tikz@lg@colorize#1{%
+ \expandafter\let\expandafter\pgf@temp\csname tikz@lgc@#1\endcsname%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@temp%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\tikz@lg@col\pgf@temp}%
+ \expandafter\global\expandafter\let\csname tikz@lgc@#1\endcsname\pgf@temp%
+}
+
+\def\tikz@lg@change@color#1{%
+ \def\tikz@lg@temp@save{#1}%
+ \let\tikz@lg@collect\pgfutil@empty%
+ \expandafter\let\expandafter\pgf@temp\csname tikz@lgc@#1\endcsname%
+ \expandafter\tikz@lg@change@check\pgf@temp\pgf@stop%
+}
+\def\tikz@lg@change@check#1{%
+ \ifx#1\pgf@stop%
+ \tikz@lg@change@write@back%
+ \else%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\tikz@lg@old@col%
+ \expandafter\tikz@lg@change@add\expandafter{\tikz@lg@new@col}% Found!
+ \else%
+ \tikz@lg@change@add{#1}%
+ \fi%
+ \expandafter\tikz@lg@change@check
+ \fi%
+}
+\def\tikz@lg@change@add#1{%
+ \expandafter\def\expandafter\tikz@lg@collect\expandafter{\tikz@lg@collect#1}%
+}
+
+\def\tikz@lg@change@write@back{%
+ \expandafter\global\expandafter\let\csname tikz@lgc@\tikz@lg@temp@save\endcsname\tikz@lg@collect%
+}
+
+
+
+\def\tikz@lg@if@has@color#1#2#3#4{%
+ {%
+ \csname tikz@lgc@#1\endcsname%
+ \expandafter\let\expandafter\pgf@temp\csname iftikz@lgc@#2@\endcsname%
+ \ifx\pgf@temp\relax%
+ \tikz@lib@reset@temp%
+ \fi%
+ \pgf@temp%
+ \global\tikz@color@testtrue%
+ \else%
+ \global\tikz@color@testfalse%
+ \fi%
+ }%
+ \iftikz@color@test#3\else#4\fi%
+}
+\newif\iftikz@color@test
+
+\def\tikz@lg@if@local@node#1#2#3{\expandafter\ifx\csname tikz@lgc@#1\endcsname\relax#3\else#2\fi}
+
+\def\tikz@lib@reset@temp{\let\pgf@temp\iffalse}
+
+
+
+%
+% Color functions
+%
+
+% Do something for all nodes having a certain color
+%
+% #1 = the color name
+% #2 = a macro
+%
+% Description:
+%
+% For each node having color #1, the macro #2 will be called. This
+% macro should take a single parameter, which will be set
+% to the node's name.
+
+\def\tikzlibgraphforeachcolorednode#1#2{%
+ \expandafter\def\expandafter\iftikz@lib@graph@color@picker\expandafter{\csname iftikz@lgc@#1@\endcsname}%
+ \let\tikz@lib@graph@action#2%
+ \let\tikz@lg@do\tikz@lg@pick%
+ \tikz@lib@graph@node@list%
+}
+\def\tikz@lg@pick#1{
+ {%
+ \csname tikz@lgc@#1\endcsname%
+ \iftikz@lib@graph@color@picker
+ \global\tikz@color@testtrue%
+ \else%
+ \global\tikz@color@testfalse%
+ \fi%
+ }%
+ \iftikz@color@test\tikz@lib@graph@action{#1}\fi%
+}
+
+
+% Prepare a color
+%
+% #1 is the color name
+% #2 is a counter
+% #3 is a prefix
+%
+% Description:
+%
+% You can call this function inside a connector. It will do the
+% following: First, its counts how many nodes exist that have color
+% #1. This number is stored in the counter passed as #2. Furthermore,
+% let <name> be the name of the <i>-th vertex that has color #1. Then, a
+% macro called \#3<i> will store <name>. For instance, if #1 is "red"
+% and the third red node is called foo and if #3 is "bar", then a
+% macro called "\bar3" is set to "foo" as if you had said
+% "\expandafter\def\csname bar3\endcsname{foo}".
+%
+% The bottom line of all this is that after a preparation you can
+% easily iterate over nodes having a certain color. If you wish to
+% iterate over a single color, it will be quicker and easier to call
+% \tikzlibgraphforeachcolorednode, but if you need to iterate over two
+% colors simultaneously, it will be better to first prepare the color.
+
+\def\tikzlibgraphpreparecolor#1#2#3{%
+ \let\tikz@lib@graph@count#2%
+ \def\tikz@lib@graph@prefix{#3}%
+ \tikzlibgraphforeachcolorednode{#1}\tikz@lib@graph@prepare%
+}
+
+\def\tikz@lib@graph@prepare#1{%
+ \advance\tikz@lib@graph@count by1\relax%
+ \expandafter\def\csname \tikz@lib@graph@prefix\the\tikz@lib@graph@count\endcsname{#1}%
+}
+
+
+
+
+%
+% The bipartite connector
+%
+
+\tikzset{
+ connectors/bipartite/.code 2 args={
+ \def\tikz@lg@shoreb{#2}%
+ \tikzlibgraphforeachcolorednode{#1}\tikz@lib@graph@bipartite@outer
+ },
+ connectors/bipartite/.default={out'}{in'}
+}
+
+\def\tikz@lib@graph@bipartite@outer#1{%
+ \def\tikz@lib@graph@from{#1}%
+ {%
+ \tikzlibgraphforeachcolorednode{\tikz@lg@shoreb}\tikz@lib@graph@bipartite@inner%
+ }%
+}
+
+\def\tikz@lib@graph@bipartite@inner#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\tikz@lib@graph@from\else%
+ \tikz@lib@graph@default@new@edge{\tikz@lib@graph@from}{#1}%
+ \fi%
+}
+
+\def\tikz@lib@graph@default@new@edge{%
+ \pgfkeysgetvalue{/tikz/graphs/@edges styling}\pgf@temp
+ \expandafter\tikz@lib@graph@default@new@edge@\expandafter{\pgf@temp}%
+}
+\def\tikz@lib@graph@default@new@edge@#1#2#3{%
+ \pgfkeys{/tikz/graphs/.cd,new edge \pgfkeysvalueof{/tikz/graphs/default edge kind}={#2}{#3}{#1}}%
+}
+
+
+%
+% The clique connector
+%
+
+\tikzset{
+ connectors/clique/.code={
+ \tikzlibgraphpreparecolor{#1}\c@pgf@counta{tikz@lg}%
+ \tikz@lg@clique@loop%
+ },
+ connectors/clique/.default=all
+}
+
+\def\tikz@lg@clique@loop{%
+ \ifnum\c@pgf@counta=0\relax%
+ \else
+ \c@pgf@countb=\c@pgf@counta\relax%
+ \tikz@lg@clique@loop@inner%
+ \advance\c@pgf@counta by-1\relax%
+ \expandafter\tikz@lg@clique@loop%
+ \fi%
+}
+
+\def\tikz@lg@clique@loop@inner{%
+ \advance\c@pgf@countb by-1\relax%
+ \ifnum\c@pgf@countb>0\relax%
+ \tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@counta\endcsname}{\csname tikz@lg\the\c@pgf@countb\endcsname}%
+ \expandafter\tikz@lg@clique@loop@inner%
+ \fi%
+}
+
+
+%
+% The path connector
+%
+
+\tikzset{
+ connectors/path/.code={%
+ \let\tikz@lg@prev\relax%
+ \tikzlibgraphforeachcolorednode{#1}\tikz@lib@graph@path@do%
+ },
+ connectors/path/.default=all
+}
+
+\def\tikz@lib@graph@path@do#1{%
+ \ifx\tikz@lg@prev\relax%
+ \else%
+ \tikz@lib@graph@default@new@edge{\tikz@lg@prev}{#1}%
+ \fi
+ \def\tikz@lg@prev{#1}%
+}
+
+
+%
+% The cycle connector
+%
+
+\tikzset{
+ connectors/cycle/.code={%
+ \let\tikz@lg@prev\relax%
+ \let\tikz@lg@first\relax%
+ \tikzlibgraphforeachcolorednode{#1}\tikz@lib@graph@cycle@do%
+ \ifx\tikz@lg@first\relax%
+ \else%
+ \tikz@lib@graph@default@new@edge{\tikz@lg@prev}{\tikz@lg@first}%
+ \fi%
+ },
+ connectors/cycle/.default=all
+}
+
+\def\tikz@lib@graph@cycle@do#1{%
+ \ifx\tikz@lg@prev\relax%
+ \def\tikz@lg@prev{#1}%
+ \let\tikz@lg@first\tikz@lg@prev%
+ \else%
+ \tikz@lib@graph@default@new@edge{\tikz@lg@prev}{#1}%
+ \def\tikz@lg@prev{#1}%
+ \fi%
+}
+
+
+
+
+%
+% The match connector
+%
+
+\tikzset{
+ connectors/match/.code 2 args={
+ {%
+ \tikzlibgraphpreparecolor{#1}\c@pgf@counta{tikz@lg}
+ \c@pgf@countb=0\relax%
+ \let\tikz@lg@prev\relax
+ \tikzlibgraphforeachcolorednode{#2}\tikz@lib@graph@match@do%
+ \tikz@lib@graph@match@rest%
+ }%
+ },
+ connectors/match/.default={out'}{in'}
+}
+
+\def\tikz@lib@graph@match@do#1{%
+ \advance\c@pgf@countb by1\relax%
+ \ifnum\c@pgf@countb>\c@pgf@counta\relax%
+ \c@pgf@countb=\c@pgf@counta\relax%
+ \fi%
+ \tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countb\endcsname}{#1}%
+ \def\tikz@lg@prev{#1}%
+}
+
+\def\tikz@lib@graph@match@rest{%
+ \ifnum\c@pgf@countb<\c@pgf@counta\relax%
+ \advance\c@pgf@countb by1\relax%
+ \tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countb\endcsname}{\tikz@lg@prev}%
+ \expandafter\tikz@lib@graph@match@rest%
+ \fi%
+}
+
+
+
+%
+% The butterfly connector
+%
+
+\tikzset{
+ connectors/butterfly/.code={
+ {}{%
+ \pgfkeys{/tikz/connectors/butterfly/.cd,#1}%
+ \ifnum\pgfkeysvalueof{/tikz/connectors/butterfly/level}=0\relax%
+ \pgfkeysalso{/tikz/connectors/match={\pgfkeysvalueof{/tikz/connectors/butterfly/from}}{\pgfkeysvalueof{/tikz/connectors/butterfly/to}}}%
+ \else%
+ {%
+ \tikzlibgraphpreparecolor{\pgfkeysvalueof{/tikz/connectors/butterfly/from}}\c@pgf@counta{tikz@lg}
+ \c@pgf@countb=0\relax%
+ \tikzlibgraphforeachcolorednode{\pgfkeysvalueof{/tikz/connectors/butterfly/to}}\tikz@lib@graph@butterfly@do%
+ }%
+ \iftikz@butterfly@prime\else\pgfkeysalso{/tikz/connectors/match={\pgfkeysvalueof{/tikz/connectors/butterfly/from}}{\pgfkeysvalueof{/tikz/connectors/butterfly/to}}}\fi%
+ \fi%
+ }%
+ },
+ connectors/butterfly/.default=,
+ connectors/butterfly/level/.initial=1,
+ connectors/butterfly/from/.initial=out',
+ connectors/butterfly/to/.initial=in',
+ connectors/butterfly'/.code={%
+ {}{\tikz@butterfly@primetrue\pgfkeysalso{butterfly={#1}}}},
+ connectors/butterfly'/.default=,
+}
+
+\newif\iftikz@butterfly@prime
+
+\def\tikz@lib@graph@butterfly@do#1{%
+ \advance\c@pgf@countb by1\relax%
+ % Compute other side...
+ \c@pgf@countc=\pgfkeysvalueof{/tikz/connectors/butterfly/level}\relax%
+ {%
+ % Computer countb mod (2level)
+ \count0=\c@pgf@countc\relax%
+ \multiply\count0 by2\relax%
+ \count1=\c@pgf@countb\relax%
+ \advance\count1 by-1\relax%
+ \count2=\count1\relax%
+ \count3=\count1\relax%
+ \divide\count1 by\count0\relax%
+ \multiply\count1 by\count0\relax%
+ \advance\count2 by-\count1\relax%
+ % count0 = 2*level
+ % count2 = countb mod (2level) (starting with 0)
+ % count1 = countb - count2 (starting with 0)
+ \ifnum\count2<\c@pgf@countc\relax%
+ \advance\count3 by \c@pgf@countc\relax%
+ \else%
+ \advance\count3 by -\c@pgf@countc\relax%
+ \fi%
+ \expandafter%
+ }%
+ \expandafter\c@pgf@countc\the\count3\relax%
+ \advance\c@pgf@countc by1\relax%
+ \ifnum\c@pgf@countc>\c@pgf@counta\relax%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \fi%
+ \tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countc\endcsname}{#1}%
+}
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex
new file mode 100644
index 00000000000..8c22215eda4
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex
@@ -0,0 +1,1394 @@
+% Copyright 2008-2010 by Christian Feuersaenger
+%
+% 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.
+%
+% ******************************
+% This here is the shared implementation of TeX-dialect specific files
+% tikzlibraryexternal.code.tex
+% ******************************
+%
+%
+% This file provides a high-level automatic export feature for tikz pictures.
+% It allows to export EACH SINGLE FIGURE into a separate PDF.
+%
+% The simplest way is to use the 'convert with system call' option; it simply converts every figure using the write18 method. If that is not possible, a list of figure file names is generated and you need to generate these figures manually (or with a script).
+%
+%
+% It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes \beginpgfgraphicnamed ... \endpgfgraphicnamed
+% commands if necessary.
+
+% handle with extreme care and only in small, local groups:
+\toksdef\t@tikzexternal@tmpa=0
+\toksdef\t@tikzexternal@tmpb=1
+
+\newwrite\tikzexternal@outfile
+\newif\iftikzexternal@nestedflag
+\newif\iftikzexternal@verboseio
+\newif\iftikzexternal@genfigurelist
+\newif\iftikzexternal@onlynamed
+\newif\iftikzexternal@file@isuptodate
+\newif\iftikzexternal@force@remake
+\newif\iftikzexternal@optimize
+\newif\iftikzexternal@export@enabled
+\tikzexternal@export@enabledtrue
+
+% This 'if' can be used as part of the public user interface.
+%
+% It is set by the 'remake next' key.
+%
+% It disables any up-to-date checks for the *next* picture, forcing a
+% remake of it.
+%
+% It applies only to *one* picture.
+\newif\iftikzexternalremakenext
+\newif\iftikzexternal@verbose@optimize
+\tikzexternal@verbose@optimizetrue
+
+% A global boolean which can be used to skip single figures.
+\newif\iftikzexternalexportnext
+\tikzexternalexportnexttrue
+
+% Invokes '#1' if the external lib is currently externalizing
+% something and '#2' if not.
+%
+% This command must be called *after* \tikzexternalize.
+\def\tikzifexternalizing#1#2{%
+ \ifpgf@external@grabshipout #1\else #2\fi
+}%
+% Invokes '#1' if the external lib is currently externalizing the NEXT FOLLOWING
+% tikzpicture. It invokes '#2' if that is not the case.
+\def\tikzifexternalizingnext#1#2{%
+ \ifpgf@external@grabshipout
+ \tikzexternalgetnextfilename\tikzexternal@temp
+ \tikzifexternaljobnamematches\tikzexternal@temp{#1}{#2}%
+ \else
+ #2%
+ \fi
+}%
+% Invokes '#1' if the external lib is currently externalizing the
+% current picture. It invokes '#2' if that is not the case.
+%
+% If the command is invoked outside of a picture, '#2' will be
+% invoked.
+\def\tikzifexternalizingcurrent#1#2{%
+ \ifpgf@external@grabshipout
+ \tikzexternalgetcurrentfilename\tikzexternal@temp
+ \ifx\tikzexternal@temp\pgfutil@empty
+ #2%
+ \else
+ \tikzifexternaljobnamematches\tikzexternal@temp{#1}{#2}%
+ \fi
+ \else
+ #2%
+ \fi
+}%
+
+% Invokes '#2' if \jobname equals '#1' and '#3' if not.
+% I suppose that '#1' is a macro containing the file name.
+%
+\def\tikzifexternaljobnamematches#1#2#3{%
+ \edef\pgf@tempa{\expandafter\string\csname#1\endcsname}%
+ \edef\pgf@tempb{\expandafter\string\csname\pgfactualjobname\endcsname}%
+ \ifx\pgf@tempa\pgf@tempb #2\else#3 \fi%
+}%
+
+
+\pgfutil@ifundefined{pdfshellescape}{%
+ \def\tikzexternalcheckshellescape{}%
+}{%
+ \ifnum\pdfshellescape=1
+ \def\tikzexternalcheckshellescape{\pgfkeysvalueof{/tikz/external/shell escape}\space}%
+ \else
+ \def\tikzexternalcheckshellescape{}%
+ \fi
+}%
+\newif\iftikzexternal@auto@detect@jobname
+
+\pgfqkeys{/tikz/external}{
+ figure list/.is if=tikzexternal@genfigurelist,
+ aux in dpth/.style={/pgf/images/aux in dpth=#1},%
+ % 'mode' applies only if \jobname==real job name.
+ mode/.is choice,
+ mode/only graphics/.code = {%
+ \def\tikzexternal@opmode{0}%
+ \pgfkeysalso{/pgf/images/aux in dpth=true}%
+ },
+ mode/no graphics/.code = {\def\tikzexternal@opmode{1}},
+ % an alias for 'no graphics:'
+ mode/only pictures/.code = {\def\tikzexternal@opmode{1}},
+ mode/graphics if exists/.code= {%
+ \def\tikzexternal@opmode{2}%
+ \pgfkeysalso{/pgf/images/aux in dpth=true}%
+ },
+ mode/list only/.code = {\def\tikzexternal@opmode{3}\tikzexternal@genfigurelisttrue},
+ mode/convert with system call/.code={%
+ \def\tikzexternal@opmode{4}%
+ \pgfkeysalso{/tikz/external/figure list=false,/pgf/images/aux in dpth=true}% ATTENTION: this *can't* work if \label{} contains pictures!
+ },
+ mode/list and make/.code = {%
+ \def\tikzexternal@opmode{5}%
+ \pgfkeysalso{/tikz/external/figure list=true,/pgf/images/aux in dpth=true}%
+ },
+ mode=convert with system call,
+ system call/.initial={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"},
+% system call/.initial={pdflatex -interaction=batchmode -jobname '\image' '\texsource'; pdftops -eps \image.pdf},
+ force remake/.is if=tikzexternal@force@remake,
+ force remake/.default=true,
+ failed ref warnings for/.initial={\ref,\cite,\pageref},
+ export next/.is if=tikzexternalexportnext,
+ export/.is if=tikzexternal@export@enabled,
+ remake next/.is if=tikzexternalremakenext,
+ remake next/.default=true,
+ verbose IO/.is if=tikzexternal@verboseio,
+ verbose IO/.default=true,
+ verbose IO=true,
+ verbose optimize/.is if=tikzexternal@verbose@optimize,
+ verbose/.style={
+ verbose IO=#1,
+ verbose optimize=#1,
+ },
+ shell escape/.initial=-shell-escape,
+ read main aux/.is if=pgfexternalreadmainaux,
+ image discarded text/.initial={%
+ [[ \textsc{Image Discarded Due To} \texttt{`/tikz/external/%
+ \ifcase\tikzexternal@opmode\relax
+ mode=only graphics%
+ \or
+ mode=no graphics%
+ \or
+ mode=graphics if exists%
+ \or
+ mode=list only%
+ \or
+ mode=convert with system call%
+ \or
+ mode=list and make%
+ \fi
+ '}~]]%
+ \pgfutil@ifundefined{tikzexternal@warning@at@end}{%
+ \pgfutil@ifundefined{AtEndDocument}{}{%
+ \AtEndDocument{%
+ \message{! Package tikz Warning: Some images are not up-to-date and need to be generated. }%
+ }%
+ }%
+ \gdef\tikzexternal@warning@at@end{1}%
+ }{}%
+ },
+ optimize/.is choice,
+ optimize/true/.code={%
+ \tikzexternal@optimizetrue
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ % we have already started the externalization! Install
+ % optimization commands to activate the new one:
+ \tikzexternal@optimize@REPLACE
+ \fi
+ \fi
+ },
+ optimize/false/.code={%
+ \tikzexternal@optimizefalse%
+ \tikzexternal@optimize@RESTORE
+ },%
+ optimize=true,
+ optimize away text/.code={[ \textsc{\string#1\ optimized away because it does not contribute to exported PDF}]},
+ optimize/install/.code={},%
+ optimize/restore/.code={},%
+ % Expects two arguments, the command name and (optionally) a count
+ % of expected arguments.
+ % Example:
+ % 'optimize command away=\includegraphics'
+ % 'optimize command away={\mycommand}{3}'
+ %
+ % It accepts commands which have '[]' arguments and whose first
+ % argument always begins with '{'.
+ %
+ % #1: the command name
+ % #2: either empty or a number of EXPECTED arguments. It will be checked
+ % for one optional argument in square brackets as well.
+ optimize command away/.code 2 args={%
+ \expandafter\global\expandafter\let\csname\string#1@ORIG\endcsname=#1%
+ \pgfkeysalso{%
+ /tikz/external/optimize/install/.append code={%
+ \def#1{\tikzexternal@optimize@away@cmd{#1}{#2}}%
+ },
+ /tikz/external/optimize/restore/.append code={%
+ \expandafter\let\expandafter#1\csname\string#1@ORIG\endcsname
+ }
+ }%
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ % we have already started the externalization! Install
+ % optimization commands to activate the new one:
+ \tikzexternal@optimize@REPLACE
+ \fi
+ \fi
+ },
+ optimize command away=\includegraphics,
+ % EXPERIMENTAL (UNTESTED):
+ optimize latex env away/.code={%
+ \expandafter\let\expandafter\pgf@tempa\csname #1\endcsname
+ \expandafter\global\expandafter\let\csname #1@ORIG\endcsname=\pgf@tempa%
+ \pgfkeysalso{%
+ /tikz/external/optimize/install/.append code={%
+ \pgfutil@namedef{#1}{\tikzexternal@optimize@away@latex@env{#1}}%
+ },
+ /tikz/external/optimize/restore/.append code={%
+ \pgfutil@namelet{#1}{#1@ORIG}%
+ }%
+ }%
+ },
+ only named/.is if=tikzexternal@onlynamed,
+ only named/.default=true,
+ figure name/.initial=\tikzexternal@realjob-figure,
+ reset counter/.code={%
+ \expandafter\gdef\csname c@tikzext@no@#1\endcsname{0}%
+ },%
+ prefix/.code={\tikzsetexternalprefix{#1}},
+}
+
+\def\tikzsetfigurename#1{\pgfkeyssetvalue{/tikz/external/figure name}{#1}}%
+\def\tikzappendtofigurename#1{\pgfkeys{/tikz/external/figure name/.add={}{#1}}}
+
+% This method sets the file name prefix used for every import/export.
+%
+% It is invoked by the '/tikz/external/prefix' key.
+\def\tikzsetexternalprefix#1{\def\tikzexternal@filenameprefix{#1}}
+\tikzsetexternalprefix{}
+
+% This method initialises automatic externalization.
+%
+% The command does need any argument, but it has two optional ones:
+%
+% 1. \tikzexternalize[<options>]
+%
+% 2. \tikzexternalize{<real job's name>}
+%
+% 3. \tikzexternalize[<options>]{<real job's name>}
+%
+% The <real job's name> is the job's file name, without the suffix
+% .tex .
+% If the <real job's name> is omitted, it will be deduced
+% automatically.
+%
+% The effect is:
+% 1. automatically surround EVERY tikzpicture by \beginpgfgraphicnamed % sections.
+% 2. in case that the job's real name and the current \jobname differ,
+% it will process ONLY the matching tikzpicture.
+\def\tikzexternalize{%
+ \pgfutil@ifnextchar[{%
+ \tikzexternalize@opt
+ }{%
+ \tikzexternalize@opt[]%
+ }%
+}%
+\def\tikzexternalize@opt[#1]{%
+ \pgfutil@ifnextchar\bgroup{%
+ \tikzexternal@auto@detect@jobnamefalse
+ \tikzexternalize@opt@withname[#1]%
+ }{%
+ \tikzexternal@auto@detect@jobnametrue
+ \pgfutil@ifundefined{tikzexternalrealjob}{%
+ % ok, \tikzexternalrealjob is not known.
+ % Assume we are currently *not* externalizing.
+ \let\tikzexternalrealjob=\jobname
+ }{}%
+ \def\pgf@tempa{\tikzexternalize@opt@withname[#1]}%
+ \expandafter\pgf@tempa\expandafter{\tikzexternalrealjob}%
+ }%
+}%
+\def\tikzexternalize@opt@withname[#1]#2{%
+ \gdef\tikzexternalrealjob{#2}%
+ \if1\tikzexternalize@hasbeencalled
+ \else
+ \pgfqkeys{/tikz/external}{#1}%
+ \def\tikzexternal@realjob{#2}%
+ \tikzexternalauxlock@init
+ \pgfrealjobname{#2}%
+ \def\tikzexternalize@hasbeencalled{1}%
+ \tikzexternalenable
+ \def\tikzexternal@determineimgextension##1:##2\relax{\gdef\tikzexternalimgextension{##1}}%
+ \xdef\pgf@tempa{\pgfsys@imagesuffixlist}%
+ \expandafter\tikzexternal@determineimgextension\pgf@tempa:\relax
+ \pgfutil@ifundefined{includegraphics}{%
+ \let\tikzexternal@orig@includegraphics=\relax
+ }{%
+ \let\tikzexternal@orig@includegraphics=\includegraphics
+ }%
+ \let\tikzexternalfiledependsonfile=\tikzexternalfiledependsonfile@ACTIVE
+ \let\tikzpicturedependsonfile=\tikzpicturedependsonfile@ACTIVE
+ \fi
+}
+\def\tikzexternalize@hasbeencalled{0}%
+
+% If mode=`convert with system call', the boolean \ifpgfexternalreadmainaux
+% will be set depending on the current lock file.
+%
+% The idea is as follows: Suppose
+% pdflatex -shell-escape mainjob.tex
+% is running.
+%
+% While it runs,
+% a) it modifies its mainjob.aux file,
+% b) it issues pdflatex -jobname mainjob-figure0 mainjob.tex .
+%
+% The call (b) will try to read mainjob.aux in order to resolve \ref
+% commands. This may fail since the aux
+% file is not complete; it may be subject to output buffering. To
+% avoid such failure, a locking mechanism is established.
+%
+% The locking mechanisms causes (a) to write a lock command into
+% mainjob.auxlock
+% just before (b) is called. Then, (b) will check it. After (b) has
+% completed, the lock will be reset.
+%
+% Thus: mode=convert with system call does NOT support \ref commands
+% inside of images. You will need to call the externalization command
+% manually. In this case, it should work.
+%
+% The lock file allows to detect automatically whether an image is created by
+% 'convert with system call' or if the user issued the required command manually.
+%
+% @PRECONDITION : this command must be invoked AFTER
+% \tikzexternal@realjob has been defined but BEFORE \pgfrealjobname is
+% called.
+%
+% @POSTCONDITION : If \ifpgfexternalreadmainaux=\iffalse, we won't do
+% anything. Otherwise, it will be changed depending for 'mode=convert
+% with system call' if necessary.
+\def\tikzexternalauxlock@init{%
+ \if4\tikzexternal@opmode
+ % mode=convert with system call
+ \ifpgfexternalreadmainaux
+ % ohoh. This case needs care because the main.aux might
+ % not be ready at this time!
+ % check.
+ %
+ \edef\pgf@tempa{\expandafter\string\csname\tikzexternal@realjob\endcsname}%
+ \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}%
+ \ifx\pgf@tempa\pgf@tempb
+ % we are *not* externalizing. Set lock into its
+ % initial "unlocked" state.
+ \tikzexternalauxlock@setlock{0}%
+ \else
+ % we are externalizing. Query the lock's value:
+ \tikzexternalauxlock@getlockvalue
+ \if1\tikzexternallocked
+ \pgfexternalreadmainauxfalse
+ % the main .aux file won't be read. Handle \ref commands:
+ \tikzexternalauxlock@handleref
+ \else
+ \pgfexternalreadmainauxtrue
+ \fi
+ \fi
+ \else
+ % NO-OP. We won't read the main aux file anyway.
+ \def\tikzexternalauxlock@setlock##1{}%
+ \fi
+ \fi
+}
+% defines \tikzexternallocked to be either 0 or 1, depending on the
+% lock file.
+\def\tikzexternalauxlock@getlockvalue{%
+ \openin\r@pgf@reada=\tikzexternal@realjob.auxlock
+ \ifeof\r@pgf@reada
+ % no lock file. Unlock.
+ \def\tikzexternallocked{0}%
+ \else
+ % read first line...
+ \read\r@pgf@reada to\pgf@tempa
+ % ... and execute it.
+ \pgf@tempa
+ % it should contain a definition of \tikzexternallocked. If
+ % not, lock it anyway.
+ \pgfutil@ifundefined
+ {tikzexternallocked}
+ {\def\tikzexternallocked{1}}%
+ {}%
+ \fi
+ \closein\r@pgf@reada
+}%
+\def\tikzexternalauxlock@setlock#1{%
+ \immediate\openout\w@pgf@writea=\tikzexternal@realjob.auxlock
+ \immediate\write\w@pgf@writea{\noexpand\def\noexpand\tikzexternallocked{#1}}%
+ \immediate\closeout\w@pgf@writea
+}
+
+
+% Installs a special \ref{} command such that externalized pictures
+% can use \ref and the user gets a warning if something fails.
+%
+% The special \ref handling is installed for every reference command
+% in the list '/tikz/external/failed ref warnings for' which contains
+% '\ref,\pageref,\cite'.
+%
+% For use in the aux lock handling only.
+\def\tikzexternalauxlock@handleref{%
+ \let\pgf@external@grab@refundefinedtrue=\pgf@external@grab@refundefinedtrue@orig
+ %
+ \pgfkeysgetvalue{/tikz/external/failed ref warnings for}\tikzexternal@temp
+ \expandafter\tikzexternalauxlock@handleref@loop\tikzexternal@temp,\@EOI,%
+}
+\def\tikzexternalauxlock@handleref@loop#1,{%
+ \def\tikzexternal@temp{#1}%
+ \ifx\tikzexternal@temp\pgfutil@empty
+ \expandafter\tikzexternalauxlock@handleref@loop
+ \else
+ \ifx#1\@EOI
+ \else
+ {%
+ % strip the leading '\'
+ % this allows proper \protect ion when you write
+ % \caption{...\cite{..}} and #1=\cite
+ \escapechar=-1
+ \xdef\pgf@temp{\string#1}%
+ }%
+ \expandafter\let\csname tikzexternalauxlock@handleref@orig@\pgf@temp\endcsname=#1%
+ \edef#1{\noexpand\pgf@texdist@protect\noexpand\tikzexternalauxlock@handleref@repl{\pgf@temp}}%
+ \expandafter\expandafter\expandafter\tikzexternalauxlock@handleref@loop
+ \fi
+ \fi
+}%
+\def\tikzexternalauxlock@handleref@repl#1{\pgfutil@ifnextchar[{\tikzexternalauxlock@handleref@repl@{#1}}{\tikzexternalauxlock@handleref@repl@{#1}[]}}%
+\def\tikzexternalauxlock@handleref@repl@#1[#2]#3{%
+ \tikzifexternalizingcurrent{%
+ % note that '#1' is NO control sequence! it is a protected string
+ \csname tikzexternalauxlock@handleref@orig@#1\endcsname{#3}%
+ \begingroup
+ \def\n{\pgfexternal@hat\pgfexternal@hat J}%
+ \tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}%
+ \def\space{\noexpand\space}%
+ \pgfexternalstorecommand{%
+ \noexpand\begingroup
+ \noexpand\toks0={\pgf@tempa}%
+ \noexpand\immediate\noexpand\write16{\tikzexternalauxlock@handleref@warning{#3}{\noexpand\the\noexpand\toks0}}%
+ \noexpand\G@refundefinedtrue
+ \noexpand\endgroup
+ }%
+ \endgroup
+ }{%
+ % ok. We are not externalizing this part of the document.
+ % Throw the citation away without further notice.
+ }%
+}%
+\def\tikzexternalauxlock@handleref@warning#1#2{%
+ \n
+ LaTeX Warning: Reference `#1' in external picture `\pgfactualjobname' could not be resolved\noexpand\on@line.\n
+ This is because the \tikzexternal@realjob.aux file is not accessable in this context, you will need to issue the externalize command\n
+ \space\space\space#2\n
+ manually.\n%
+}
+
+% Expands to the default image extension (it is set by
+% \tikzexternalize).
+%
+% This image extension may not resemble the correct one; you may need
+% to overwrite this macro *after* \tikzexternalize in this case.
+%
+% The default setting uses the first registered image extension.
+\def\tikzexternalimgextension{}%
+
+% can be used to (temporarily) disable the externalization.
+\def\tikzexternaldisable{%
+ \let\tikz=\tikzexternal@origtikz
+ \tikzexternal@TEXDIALECT@restore@picture
+ \pgfutil@ifundefined{tikzexternal@orig@tikzfadingfrompicture}
+ {}% NOP
+ {%
+ \let\tikzfadingfrompicture=\tikzexternal@orig@tikzfadingfrompicture
+ \let\endtikzfadingfrompicture=\tikzexternal@orig@endtikzfadingfrompicture
+ \let\tikzfading=\tikzexternal@orig@tikzfading
+ }%
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ \tikzexternal@optimize@RESTORE
+ \fi
+ \fi
+}%
+% re-enables externalization after a \tikzexternalizedisable.
+\def\tikzexternalenable{%
+ \if\tikzexternalize@hasbeencalled1%
+ \let\tikz=\tikzexternal@tikz@replacement
+ \tikzexternal@TEXDIALECT@installreplacement@picture
+ \pgfutil@ifundefined{tikzfadingfrompicture}%
+ {}% no special handling for 'fading lib'
+ {%
+ % oh, ok -- patch fading lib!
+ \pgfutil@ifundefined{tikzexternal@orig@tikzfadingfrompicture}{%
+ \let\tikzexternal@orig@tikzfadingfrompicture=\tikzfadingfrompicture
+ \let\tikzexternal@orig@endtikzfadingfrompicture=\endtikzfadingfrompicture
+ \let\tikzexternal@orig@tikzfading=\tikzfading
+ }{}%
+ \def\tikzfadingfrompicture{%
+ \begingroup
+ \tikzexternaldisable
+ \tikzexternal@orig@tikzfadingfrompicture}%
+ \def\endtikzfadingfrompicture{%
+ \tikzexternal@orig@endtikzfadingfrompicture
+ \endgroup}%
+ \def\tikzfading[##1]{%
+ \begingroup
+ \tikzexternaldisable
+ \tikzexternal@orig@tikzfading[##1]%
+ \endgroup}%
+ }%
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ \tikzexternal@optimize@REPLACE
+ \fi
+ \fi
+ \fi
+}%
+
+% Sets the filename for the next tikzpicture or \tikz shortcommand.
+%
+% It will *only* be used for the next picture.
+%
+% If you don't call \tikzsetnextfilename for a picture, a file name
+% will be assembled automatically.
+%
+% Please note that the global file prefix will be prepended anyway.
+\def\tikzsetnextfilename#1{\gdef\tikzexternal@nextfile{#1}}
+\tikzsetnextfilename{}
+
+
+% These are few TeX dialect-specific commands which need to be overriden when used with
+% something different than plain TeX:
+%
+% 1. this command collects a complete image into a macro, up to (but not including) the
+% final TeX-dialect specific end-image command.
+% This is really difficult for LaTeX because \end{tikzpicture} either involves dirty
+% catcode-hacks to parse the braces or an ugly loop which loops until it
+% finds \end followed by {tikzpicture}.
+%
+% #1: a macro which will be called with the collected environment contents.
+% all following tokens: the environment contents.
+\long\gdef\tikzexternal@TEXDIALECT@collectpicture#1#2\endtikzpicture{#1{#2}}
+%
+% 2. the following commands should expand to the TeX-dialect specific begin and end image command, i.e.
+% \tikzpicture / \endtikzpicture
+% or
+% \begin{tikzpicture} / \end{tikzpicture}
+% or
+% \starttikzpicture / \stoptikzpicture
+\def\tikzexternal@TEXDIALECT@begpicture{\tikzpicture}
+\def\tikzexternal@TEXDIALECT@endpicture{\endtikzpicture}%
+%
+% 3. This installs the replacement macros:
+\def\tikzexternal@TEXDIALECT@installreplacement@picture{%
+ \let\tikzpicture=\tikzexternal@tikzpicture@replacement
+}%
+\def\tikzexternal@TEXDIALECT@restore@picture{%
+ \let\tikzpicture=\tikzexternal@origpicture
+}%
+
+
+
+
+\let\tikzexternal@origtikz=\tikz
+\let\tikzexternal@origpicture=\tikzpicture
+\let\tikzexternal@origendpicture=\endtikzpicture
+\let\tikzexternal@curfilename=\relax
+
+% Replacement for '\tikzpicture'.
+%
+% There are two different states in which this method is applied:
+% - normal typesetting. Then, the 'mode' key controls its behavior.
+% - externalize mode (i.e. jobname != real job name). Then, it will
+% externalize the picture selected by 'jobname' (and only this picture).
+\def\tikzexternal@tikzpicture@replacement{%
+ \leavevmode
+ \global\tikzexternal@file@isuptodatetrue% may be set to false during checks.
+ \tikzexternal@getnextfilename\tikzexternal@curfilename
+ \ifx\tikzexternal@curfilename\pgfutil@empty
+ \ifpgf@external@grabshipout
+ % This picture won't be externalized.
+ % But maybe we can optimize it away:
+ \iftikzexternal@optimize
+ % -> it won't be shipped out anyway, so save typesetting time!
+ \let\tikzexternal@next=\tikzexternal@skipfigure
+ \else
+ % include this graphics into the output (even if
+ % it will be discarded anyway).
+ \let\tikzexternal@next=\tikzexternal@normalpicture@nographics
+ \fi
+ \else
+ \let\tikzexternal@next=\tikzexternal@normalpicture@nographics
+ \fi
+ \else
+ \ifpgf@external@grabshipout
+ \tikzifexternaljobnamematches\tikzexternal@curfilename{%
+ % ok, this here IS the picture for which
+ % pdflatex --jobname <my name>
+ % has been invoked.
+ \let\tikzexternal@next=\tikzexternal@externalizefig
+ }{%
+ \iftikzexternal@optimize
+ % No, another picture should be exported. Simply skip this one
+ % -> it won't be shipped out anyway, so save typesetting time!
+ \let\tikzexternal@next=\tikzexternal@skipfigure
+ \else
+ % include this graphics into the output (even it
+ % it will be discarded anyway).
+ \let\tikzexternal@next=\tikzexternal@normalpicture@nographics
+ \fi
+ }%
+ \else
+ \ifcase\tikzexternal@opmode\relax
+ % 'mode=only graphics'
+ \let\tikzexternal@next=\tikzexternal@forcegraphics
+ \or
+ % 'mode=no graphics'
+ \let\tikzexternal@next=\tikzexternal@normalpicture@nographics
+ \or
+ % 'mode=graphics if exists'
+ \let\tikzexternal@next=\tikzexternal@externalizefig
+ \or
+ % 'mode=list only'
+ \let\tikzexternal@next=\tikzexternal@listmodepicture
+ \or
+ % 'mode=convert with system call'
+ \let\tikzexternal@next=\tikzexternal@externalizefig@systemcall
+ \or
+ % 'mode=list and make'
+ \let\tikzexternal@next=\tikzexternal@list@and@makefile@mode@picture
+ \fi
+ \fi
+ \fi
+ \tikzexternal@next
+}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Replacement for \tikz short command:
+\def\tikzexternal@tikz@replacement{%
+ \pgfutil@ifnextchar[{\tikzexternal@tikz@replacement@opt}{\tikzexternal@tikz@replacement@opt[]}%
+}%
+\def\tikzexternal@tikz@replacement@opt[#1]{%
+ \pgfutil@ifnextchar\bgroup{\tikzexternal@tikz@replacement@opt@{#1}}{\tikzexternal@tikz@replacement@opt@@{#1}}%
+}
+\long\def\tikzexternal@tikz@replacement@opt@#1#2{%
+ \tikzexternal@tikz@replacement@opt@process{#1}{#2}%
+}%
+\def\tikzexternal@tikz@replacement@opt@@#1{%
+ \def\tikz@next{\tikzexternal@tikz@replacement@collectnormalsemicolon{#1}}%
+ \ifnum\the\catcode`\;=\active\relax%
+ \def\tikz@next{\tikzexternal@tikz@replacement@collectactivesemicolon{#1}}%
+ \fi%
+ \tikz@next}
+\long\def\tikzexternal@tikz@replacement@collectnormalsemicolon#1#2;{%
+ \tikzexternal@tikz@replacement@opt@process{#1}{#2;}%
+}%
+{
+ \catcode`\;=\active
+ \long\gdef\tikzexternal@tikz@replacement@collectactivesemicolon#1#2;{%
+ \tikzexternal@tikz@replacement@opt@process{#1}{#2;}%
+ }
+}
+\long\def\tikzexternal@tikz@replacement@opt@process#1#2{%
+ \begingroup
+ \t@tikzexternal@tmpa=\expandafter{\tikzexternal@TEXDIALECT@begpicture[#1]#2}%
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@TEXDIALECT@endpicture}%
+ \xdef\pgf@tempa{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}%
+ \endgroup
+ \pgf@tempa
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\tikzexternal@getnextfilename@advancecount{%
+ \begingroup
+ \c@pgf@counta=\csname c@tikzext@no@\tikzexternal@figurename\endcsname\relax
+ \advance\c@pgf@counta by1
+ \expandafter\xdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{\the\c@pgf@counta}%
+ \endgroup
+}%
+
+% Returns the file name which will be used for the next tikzpicture (based on the currently available information only, of course).
+\def\tikzexternalgetnextfilename#1{%
+ \begingroup
+ \let\tikzexternal@getnextfilename@advancecount\relax% NOP
+ \def\tikzexternal@protocol@to@file##1{}% NOP
+ \tikzexternal@getnextfilename#1%
+ \pgfmath@smuggleone#1%
+ \endgroup
+}%
+
+% Returns the file name of the current picture.
+%
+% It returns the empty string in case the command is invoked outside
+% of a picture.
+% #1 the macro which will contain the file name.
+% @see \tikzexternalgetnextfilename
+\def\tikzexternalgetcurrentfilename#1{%
+ \ifx\tikzexternal@curfilename\relax
+ % we are outside of a picture.
+ \let#1=\pgfutil@empty
+ \else
+ % we are inside of a picture.
+ \let#1=\tikzexternal@curfilename
+ \fi
+}
+
+% Fills #1 with a filename for the current picture.
+%
+% The filename will be generated automatically by appending '-figure<number>' to the real jobname.
+%
+% This method deals with
+% - \tikzsetnextfilename
+% - \tikzexternalexportnextfalse
+%
+% It returns #1={} if the current figure shall NOT be exported.
+%
+% Please note that both, \tikzsetnextfilename and \tikzexternalexportnextfalse
+% affect only ONE picture. They will be reset afterwards.
+\def\tikzexternal@getnextfilename#1{%
+ \let#1=\pgfutil@empty
+ % determine next file name:
+ \iftikzexternal@export@enabled
+ \iftikzexternalexportnext
+ \begingroup
+ \t@tikzexternal@tmpa=\expandafter{\tikzexternal@filenameprefix}%
+ \ifx\tikzexternal@nextfile\pgfutil@empty
+ \iftikzexternal@onlynamed
+ \xdef\pgf@tempa{}%
+ \else
+ \pgfkeysgetvalue{/tikz/external/figure name}\tikzexternal@figurename
+ \pgfutil@ifundefined{c@tikzext@no@\tikzexternal@figurename}{%
+ % initialise on first usage:
+ \expandafter\gdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{0}%
+ }{}%
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}%
+ \xdef\pgf@tempa{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\csname c@tikzext@no@\tikzexternal@figurename\endcsname}%
+ % advance the counter for 'figure name':
+ \tikzexternal@getnextfilename@advancecount
+ \fi
+ \else
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}%
+ \xdef\pgf@tempa{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}%
+ \fi
+ \endgroup
+ \let#1=\pgf@tempa
+ \fi
+ \fi
+ %
+ % Reset global flags:
+ \global\let\tikzexternal@nextfile=\pgfutil@empty
+ \global\tikzexternalexportnexttrue
+ %
+ \tikzexternal@protocol@to@file#1%
+}%
+
+% #1: the image file name which should be protocolled. (can be a
+% macro)
+\def\tikzexternal@protocol@to@file#1{%
+ \ifpgf@external@grabshipout%
+ \else
+ \iftikzexternal@genfigurelist
+ \edef\tikzexternal@temp{#1}%
+ \ifx\tikzexternal@temp\pgfutil@empty
+ \else
+ \pgfutil@ifundefined{tikzexternal@listmode@openedfile}{%
+ \message{Opening '\tikzexternal@realjob.figlist' for writing.}%
+ \immediate\openout\tikzexternal@outfile=\tikzexternal@realjob.figlist\relax
+ \gdef\tikzexternal@listmode@openedfile{1}%
+ \if\tikzexternal@opmode5% mode='list and make'
+ \tikzexternal@list@and@make@prepare
+ \fi
+ }{}%
+ \iftikzexternal@verboseio
+ \immediate\write16{Writing '#1' to '\tikzexternal@realjob.figlist'.}%
+ \fi
+ \immediate\write\tikzexternal@outfile{#1}%
+ \if\tikzexternal@opmode5% mode='list and make'
+ \tikzexternal@list@and@make@gentarget{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+}%
+
+\def\tikzexternal@list@and@make@gentarget#1{%
+ \tikzexternal@assemble@systemcall{#1}{\pgf@tempa}%
+ \iftikzexternal@verboseio
+ \immediate\write16{Writing '#1' to '\tikzexternal@realjob.makefile'.}%
+ \fi
+ \global\tikzexternal@file@isuptodatetrue% only check for force remake:
+ \tikzexternal@checkforceremake%
+ \immediate\write\tikzexternal@outmakefile{#1\tikzexternalimgextension: \iftikzexternal@file@isuptodate\else FORCEREMAKE\fi}%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar\pgf@tempa}%
+ \immediate\write\tikzexternal@outmakefile{}%
+}
+
+\def\tikzexternal@list@and@make@prepare{%
+ \iftikzexternal@verboseio
+ \immediate\write16{Opening '\tikzexternal@realjob.makefile' for writing.}%
+ \fi
+ \begingroup
+ % this makes \tikzexternal@outmakefile global:
+ \globaldefs=1
+ % this gets round '\outer\newwrite' in plain TeX:
+ \csname newwrite\endcsname\tikzexternal@outmakefile
+ \endgroup
+ \immediate\openout\tikzexternal@outmakefile=\tikzexternal@realjob.makefile\relax
+ \immediate\write\tikzexternal@outmakefile{ALL_FIGURE_NAMES=\tikzexternal@DOLLARchar(shell cat \tikzexternal@realjob.figlist)}%
+ \immediate\write\tikzexternal@outmakefile{ALL_FIGURES=\tikzexternal@DOLLARchar(ALL_FIGURE_NAMES:\tikzexternal@PERCENTchar=\tikzexternal@PERCENTchar\tikzexternalimgextension)}%
+ \immediate\write\tikzexternal@outmakefile{}%
+ \immediate\write\tikzexternal@outmakefile{allimages: \tikzexternal@DOLLARchar(ALL_FIGURES)}%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar @echo All images exist now. Use make -B to re-generate them.}%
+ \immediate\write\tikzexternal@outmakefile{}%
+ \immediate\write\tikzexternal@outmakefile{FORCEREMAKE:}%
+ \immediate\write\tikzexternal@outmakefile{}%
+ %
+ % support for .dep files and auto-dependencies:
+ \immediate\write\tikzexternal@outmakefile{include $(ALL_FIGURE_NAMES:\tikzexternal@PERCENTchar=\tikzexternal@PERCENTchar.\tikzexternaldepext)}%
+ \immediate\write\tikzexternal@outmakefile{}%
+ \tikzexternalmakefiledefaultdeprule
+ \immediate\write\tikzexternal@outmakefile{}%
+ \tikzexternal@outmakefile@pendingcommands
+ \pgfutil@ifundefined{AtEndDocument}{}{%
+ \AtEndDocument{\immediate\write16{===== mode=`list and make': Use 'make -f \tikzexternal@realjob.makefile' to generate all images. Then, re-run (pdf)latex \tikzexternal@realjob. =====}}%
+ }%
+}%
+\def\tikzexternaldepext{dep}
+
+\def\tikzexternalmakefiledefaultdeprule{%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@PERCENTchar.\tikzexternaldepext:}%
+ \immediate\write\tikzexternal@outmakefile{\tikzexternal@TABchar touch $@ \tikzexternal@HASHchar\space will be filled later.}%
+}%
+
+% Invokes '#1' if a makefile is to be written and '#2' if not.
+\def\tikzexternalifwritesmakefile#1#2{%
+ \if5\tikzexternal@opmode #1\else #2\fi
+}%
+\def\tikzexternal@outmakefile@pendingcommands{}%
+
+% Will write something to the make file. If the makefile is not yet
+% opened, #1 will be written as soon as it *is* opened.
+\def\tikzexternalwritetomakefile#1{%
+ \pgfutil@ifundefined{tikzexternal@outmakefile}{%
+ \expandafter\gdef\expandafter\tikzexternal@outmakefile@pendingcommands\expandafter{%
+ \tikzexternal@outmakefile@pendingcommands
+ \immediate\write\tikzexternal@outmakefile{#1}%
+ }%
+ }{%
+ \immediate\write\tikzexternal@outmakefile{#1}%
+ }%
+}%
+
+\def\tikzexternal@dep@file@name{}
+
+% Adds a dependency for the externalized picture file name `#1',
+% namely another file `#2'.
+%
+% #1: the fully qualified path name (without image extension) of the
+% external graphics for which we are adding a dependency.
+% #2: a file name. If this file gets changed, #1 shall be remade.
+%
+% This command will be actived as soons as \tikzexternalize has been
+% called.
+\def\tikzexternalfiledependsonfile@ACTIVE#1#2{%
+ \begingroup
+ \def\tikzpicturedependsonfile@name{#1}%
+ \ifx\tikzpicturedependsonfile@name\pgfutil@empty
+ % could be auto-generated: empty file name means "picture
+ % won't be externalized". Skip it.
+ \else
+ \edef\tikzpicturedependsonfile@name{#1.\tikzexternaldepext}%
+ \ifx\tikzexternal@dep@file@name\tikzpicturedependsonfile@name
+ % file is open and ready.
+ \else
+ % create new output file.
+ \pgfutil@ifundefined{tikzexternal@dep@file}{%
+ \begingroup
+ % this makes \tikzexternal@dep@file global:
+ \globaldefs=1
+ % this gets round '\outer\newwrite' in plain TeX:
+ \csname newwrite\endcsname\tikzexternal@dep@file
+ \endgroup
+ }{}%
+ \ifx\tikzexternal@dep@file@name\pgfutil@empty
+ \else
+ % it is already open. Close it.
+ \immediate\closeout\tikzexternal@dep@file
+ \fi
+ \global\let\tikzexternal@dep@file@name=\tikzpicturedependsonfile@name
+ \immediate\openout\tikzexternal@dep@file=\tikzexternal@dep@file@name\relax
+ \fi
+ \immediate\write\tikzexternal@dep@file{#1\tikzexternalimgextension: #2}%
+ \fi
+ \endgroup
+}%
+\def\tikzexternalfiledependsonfile#1#2{}% NO-OP until \tikzexternalize has been called.
+
+% Adds a dependency for the NEXT picture which is about to be
+% externalized. If we are currently inside of a picture, the
+% dependency is added for this current picture.
+%
+% #1: a file name. If this file gets changed, the tikzpicture's
+% externalized graphics shall be remade.
+%
+% This command will be actived as soons as \tikzexternalize has been
+% called.
+\def\tikzpicturedependsonfile@ACTIVE#1{%
+ \begingroup
+ \tikzexternalgetcurrentfilename\tikzpicturedependsonfile@name
+ \ifx\tikzpicturedependsonfile@name\pgfutil@empty
+ \tikzexternalgetnextfilename\tikzpicturedependsonfile@name
+ \fi
+ \expandafter\tikzexternalfiledependsonfile\expandafter{\tikzpicturedependsonfile@name}{#1}%
+ \endgroup
+}%
+\def\tikzpicturedependsonfile#1{}% NO-OP until \tikzexternalize has been called.
+
+
+% This command is invoked
+% if and only if ( (grab mode && --jobname matches) || 'mode=graphics if exists' )
+%
+% It converts the current tikzpicture into an image in grab mode
+% or processes the 'graphics if exist' mode.
+\def\tikzexternal@externalizefig{%
+ \ifpgf@external@grabshipout%
+ % In this case, we already KNOW that the filename matches.
+ \expandafter\tikzexternal@externalizefig@GRAB%
+ \else
+ \expandafter\tikzexternal@externalizefig@mode@graphics@if@exists
+ \fi%
+}
+\def\tikzexternal@externalizefig@mode@graphics@if@exists{%
+ % check if there is already a file.
+ % In that case, use it. If not, typeset the picture normally.
+ \gdef\pgf@filename{}%
+ \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
+ \pgf@tempa
+ \ifx\pgf@filename\pgfutil@empty%
+ % Note: since we have no 'GRAB' mode, we do not have to deal with optimization.
+ % there is no graphics.
+ \expandafter\tikzexternal@normalpicture@nographics
+ \else
+ \expandafter\tikzexternal@forcegraphics
+ \fi
+}%
+
+
+% Used by the optimization code.
+% It will be called if GRAB mode is on.
+% See the 'optimize command away' key.
+\def\tikzexternal@optimize@away@cmd#1#2{%
+ \pgfutil@ifnextchar[{%
+ \tikzexternal@optimize@away@cmd@{#1}{#2}%
+ }{%
+ \tikzexternal@optimize@away@cmd@{#1}{#2}[]%
+ }%
+}%
+\def\tikzexternal@optimize@away@cmd@#1#2[#3]{%
+ \def\tikz@temp{#2}%
+ \ifx\tikz@temp\pgfutil@empty
+ \def\tikz@temp{\tikzexternal@optimize@away@cmd@auto{#1}{#3}}%
+ \else
+ \ifcase#2\relax
+ \def\tikzexternal@optimize@away@cmd@manual{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4##5{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}{##5}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4##5##6{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}{##5}{##6}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4##5##6##7{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}{##5}{##6}{##7}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4##5##6##7##8{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}}%
+ }%
+ \or
+ \def\tikzexternal@optimize@away@cmd@manual##1##2##3##4##5##6##7##8##9{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#3}{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}%
+ }%
+ \fi
+ \def\tikz@temp{\tikzexternal@optimize@away@cmd@manual}%
+ \fi
+ \tikz@temp
+}%
+\def\tikzexternal@optimize@away@cmd@auto#1#2{%
+ \pgfutil@ifnextchar\bgroup{%
+ \tikzexternal@optimize@away@cmd@auto@{#1}{#2}%
+ }{%
+ \tikzexternal@optimize@away@cmd@auto@{#1}{#2}{<no argument in curly braces>}% give empty argument.
+ }
+}%
+
+\def\tikzexternal@optimize@away@cmd@auto@#1#2#3{%
+ \tikzexternal@optimize@away@cmd@@@{#1}{#2}{{#3}}% <-- provide braces
+}%
+\def\tikzexternal@optimize@away@cmd@@@#1#2#3{%
+ \begingroup
+ \toks0={#1[#2]#3}%
+ \iftikzexternal@verbose@optimize
+ \immediate\write16{The command '\the\toks0' has been optimized away. Use '/tikz/external/optimize=false' to disable this.}%
+ \fi
+ \endgroup
+ \begingroup
+ \pgfkeysvalueof{/tikz/external/optimize away text/.@cmd}#1\pgfeov%
+ \endgroup
+}%
+
+\def\tikzexternal@optimize@away@latex@env#1{%
+ \def\tikzexternal@optimize@away@latex@env@{#1}%
+ \begingroup
+ \def\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring{#1}%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@optimize@away@latex@env@close
+}%
+\long\def\tikzexternal@optimize@away@latex@env@close#1{%
+ \iftikzexternal@verbose@optimize
+ \immediate\write16{The complete contents of \string\begin{tikzexternal@optimize@away@latex@env@} up to the next \end{tikzexternal@optimize@away@latex@env@} has been optimized away because it does not contribute to exported PDF. Use '/tikz/external/optimize=false' to disable this.}%
+ \fi
+ \endgroup
+ % we still need to invoke \end{<name>} in latex because \begin{<name>}
+ % starts a local group - that must be closed properly. Make sure then \end<name> does nothing:
+ \expandafter\let\csname end\tikzexternal@optimize@away@latex@env@\endcsname=\relax
+ \expandafter\end\expandafter{\tikzexternal@optimize@away@latex@env@}%
+}%
+
+\def\tikzexternal@optimize@REPLACE{%
+ \pgfkeysvalueof{/tikz/external/optimize/install/.@cmd}\pgfeov
+}%
+
+\def\tikzexternal@optimize@RESTORE{%
+ \pgfkeysvalueof{/tikz/external/optimize/restore/.@cmd}\pgfeov
+}%
+
+% Closes one 'tikzpicture' environment. This is only used for LaTeX,
+% because the '\end{tikzpicture}' command would raise an exception otherwise.
+% It does *not* call \endtikzpicture.
+\def\tikzexternal@closeenvironments{%
+ \let\endtikzpicture=\relax
+ \tikzexternal@TEXDIALECT@endpicture
+ \let\endtikzpicture=\tikzexternal@origendpicture
+ \let\tikzexternal@curfilename=\relax
+}
+
+% Throws a tikzpicture away - without further notice.
+% Used if we are currently converting *another* picture. No need to waste time
+% with expensive pictures if they are not shipped out anyway.
+%
+% See the 'optimize' key to disable this.
+\def\tikzexternal@skipfigure{%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@skipfigure@@
+}
+\long\def\tikzexternal@skipfigure@@#1{%
+ \iftikzexternal@verbose@optimize
+ \immediate\write16{A tikzpicture has been optimized away. Use '/tikz/external/optimize=false' to disable this.}%
+ \fi
+ \tikzexternal@closeenvironments
+}
+
+% Processes tikzpicture normally; without any externalization.
+%
+% We need to do further work here to deal with NESTED tikzpicture environments
+% because all of them shall also be typeset normally.
+%
+% Idea:
+% 1. restore the original \tikzpicture macro
+% 2. install the replacement \tikzpicture in \end{tikzpicture}.
+% and keep track of nesting.
+%
+% FIXME: could it be possible that nested tikzpictures use other code anyway?
+\def\tikzexternal@normalpicture@nographics{%
+ \tikzexternal@nestedflagfalse
+ \let\tikzpicture=\tikzexternal@normalpicture@begreplace
+ \let\endtikzpicture=\tikzexternal@normalpicture@endreplace
+ \tikzpicture
+}
+\def\tikzexternal@normalpicture@begreplace{%
+ \begingroup
+ \tikzexternal@nestedflagtrue
+ \tikzexternal@origpicture
+}
+\def\tikzexternal@normalpicture@endreplace{%
+ \tikzexternal@origendpicture
+ \endgroup
+ \iftikzexternal@nestedflag
+ \else
+ \let\tikzpicture=\tikzexternal@tikzpicture@replacement
+ \let\endtikzpicture=\tikzexternal@origendpicture
+ \fi
+}%
+
+% Assumes there is an image on disk and reads it. The tikzpicture is thrown away.
+\def\tikzexternal@forcegraphics{%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@forcegraphics@@
+}
+\long\def\tikzexternal@forcegraphics@@#1{%
+ \expandafter\pgfincludeexternalgraphics\expandafter{\tikzexternal@curfilename}%
+ \tikzexternal@closeenvironments
+}
+
+% Simply replaces the complete picture by some placeholder text.
+% It is used by 'mode=list only' to reduce runtime.
+\def\tikzexternal@listmodepicture{%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@listmodepicture@@
+}
+\long\def\tikzexternal@listmodepicture@@#1{%
+ \pgfkeysvalueof{/tikz/external/image discarded text}%
+ \tikzexternal@closeenvironments
+}
+
+% check if there is already a file.
+% In that case, use it. If not, skip it.
+\def\tikzexternal@list@and@makefile@mode@picture{%
+ \gdef\pgf@filename{}%
+ \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
+ \pgf@tempa
+ \ifx\pgf@filename\pgfutil@empty%
+ % Note: since we have no 'GRAB' mode, we do not have to deal with optimization.
+ % there is no graphics.
+ \expandafter\tikzexternal@listmodepicture
+ \else
+ \expandafter\tikzexternal@forcegraphics
+ \fi
+}%
+
+\def\tikzexternal@externalizefig@GRAB{%
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ \tikzexternal@optimize@RESTORE
+ \fi
+ \fi
+ \def\tikzpicture{%
+ \def\tikzpicture{% make sure that nested \tikzpicture are processed normally.
+ \begingroup
+ \def\endtikzpicture{%
+ \tikzexternal@origendpicture
+ \endgroup
+ }%
+ \tikzexternal@origpicture
+ }%
+ \pgf@external@grab{\tikzexternal@curfilename}%
+ \tikzexternal@origpicture
+ }%
+ \def\endtikzpicture{%
+ \tikzexternal@origendpicture
+ \pgf@externalend
+ \let\tikzpicture=\tikzexternal@tikzpicture@replacement
+ \let\endtikzpicture=\tikzexternal@origendpicture
+ \iftikzexternal@optimize
+ \ifpgf@external@grabshipout
+ \tikzexternal@optimize@REPLACE
+ \fi
+ \fi
+ }%
+ \tikzpicture
+}%
+
+
+% 1. Discards the current picture in this document.
+% 2. Checks whether an image exists already. If that is the case: acquire it.
+% 3. If no image exists: call '/tikz/external/system call'. This will
+% process \tikzexternal@externalizefig.
+% 4. Assert that finally an image exists and use it.
+\def\tikzexternal@externalizefig@systemcall{%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@externalizefig@systemcall@@
+}
+
+{
+\catcode`\"=12
+\catcode`\'=12
+\catcode`\;=12
+\catcode`\&=12
+\catcode`\-=12
+\xdef\tikzexternal@normal@dq{"}
+\xdef\tikzexternal@normal@sq{'}
+\xdef\tikzexternal@normal@semic{;}
+\xdef\tikzexternal@normal@and{&}
+\xdef\tikzexternal@normal@dash{-}
+\catcode`\"=13
+\catcode`\'=13
+\catcode`\;=13
+\catcode`\&=13
+\catcode`\-=13
+\gdef\tikzexternal@activate@normal@dq{\let"=\tikzexternal@normal@dq}
+\gdef\tikzexternal@activate@normal@sq{\let'=\tikzexternal@normal@sq}
+\gdef\tikzexternal@activate@normal@semic{\let;=\tikzexternal@normal@semic}
+\gdef\tikzexternal@activate@normal@and{\let&=\tikzexternal@normal@and}
+\gdef\tikzexternal@activate@normal@dash{\let-=\tikzexternal@normal@dash}
+\catcode`\|=0
+\catcode`\\=12
+|xdef|tikzexternal@normal@backslash{\}%
+}
+{
+\catcode`\^^I=12
+\catcode`\$=12
+\catcode`\%=12
+\catcode`\#=12
+\gdef\tikzexternal@HASHchar{#}
+\gdef\tikzexternal@TABchar{^^I}\gdef\tikzexternal@PERCENTchar{%}\xdef\tikzexternal@DOLLARchar{$}}
+
+% Creates the '/tikz/external/system call' command as string and
+% returns it into the (global!) macro #2.
+% #1: the image file name (as returned by
+% \tikzexternalgetnextfilename)
+% #2: the global return value macro
+%
+\def\tikzexternal@assemble@systemcall#1#2{%
+ \begingroup
+ \def\image{#1}%
+ \iftikzexternal@auto@detect@jobname
+ \edef\texsource{\string\def\string\tikzexternalrealjob{\tikzexternal@realjob}\string\input{\tikzexternal@realjob}}%
+ \else
+ \let\texsource=\tikzexternal@realjob
+ \fi
+ \ifnum\the\catcode`\"=13 \tikzexternal@activate@normal@dq\fi
+ \ifnum\the\catcode`\'=13 \tikzexternal@activate@normal@sq\fi
+ \ifnum\the\catcode`\;=13 \tikzexternal@activate@normal@semic\fi
+ \ifnum\the\catcode`\-=13 \tikzexternal@activate@normal@dash\fi
+ \let\\=\tikzexternal@normal@backslash
+ \xdef#2{\pgfkeysvalueof{/tikz/external/system call}}%
+ \endgroup
+}%
+\long\def\tikzexternal@externalizefig@systemcall@@#1{%
+ \tikzexternal@externalizefig@systemcall@uptodatecheck%
+ \iftikzexternal@file@isuptodate
+ \iftikzexternal@verboseio
+ \immediate\write16{===== Image '\tikzexternal@curfilename' is up-to-date. ======}%
+ \fi
+ \let\pgf@filename=\tikzexternal@curfilename
+ \else
+ \begingroup
+ % no such image. Generate it!
+ \tikzexternal@assemble@systemcall{\tikzexternal@curfilename}{\pgf@tempa}%
+ \iftikzexternal@verboseio
+ \immediate\write16{===== 'mode=convert with system call': Invoking '\pgf@tempa' ========}%
+ \fi
+ %
+ \tikzexternalauxlock@setlock1%
+ \immediate\write18{\pgf@tempa}%
+ \tikzexternalauxlock@setlock0%
+ \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\pgf@tempa}%
+ \pgfmath@smuggleone\pgf@filename
+ \endgroup
+ \fi
+ \ifx\pgf@filename\pgfutil@empty
+ % error recovery: something did not work! Try to load it
+ % anyway. Perhaps it was just that shell-escape wasn't
+ % enabled.
+ \begingroup
+ \toks0={%
+ \tikzexternaldisable
+ \pgfutil@ifundefined{scantokens}{\long\def\scantokens##1{##1}}{}%
+ }%
+ % FIXME : THIS WILL FAIL IF THERE IS '##' INSIDE OF '#1'!
+ % for example something like /.style={#1} in the picture environment *will* fail.
+ \toks1={%
+ \tikzpicture#1%
+ }%
+ \toks2={%
+ \tikzexternal@TEXDIALECT@endpicture
+ \tikzexternalenable
+ }%
+ \xdef\tikzexternal@externalizefig@systemcall@next{%
+ \the\toks0
+ % try reading them again as if they were in the input file.
+ \noexpand\scantokens{\the\toks1 }%
+ \the\toks2
+ }%
+ \endgroup
+ \else
+ % ok, take the image!
+ \expandafter\pgfincludeexternalgraphics\expandafter{\tikzexternal@curfilename}%
+ \gdef\tikzexternal@externalizefig@systemcall@next{\tikzexternal@closeenvironments}%
+ \fi
+ \tikzexternal@externalizefig@systemcall@next
+}%
+
+% Sets \iftikzexternal@file@isuptodate to false if one of the "force
+% remake" things is active.
+\def\tikzexternal@checkforceremake{%
+ \iftikzexternal@force@remake
+ \global\tikzexternal@file@isuptodatefalse
+ \else
+ \iftikzexternalremakenext
+ \global\tikzexternal@file@isuptodatefalse
+ \global\tikzexternalremakenextfalse
+ \fi
+ \fi
+}
+
+% Checks whether the current picture needs to be externalized.
+%
+% This is the case if
+% a) there is no external image yet,
+% b) the picture has been invalidated manually.
+%
+% It returns \iftikzexternal@file@isuptodate accordingly.
+\def\tikzexternal@externalizefig@systemcall@uptodatecheck{%
+ \tikzexternal@checkforceremake
+ \iftikzexternal@file@isuptodate
+ % check if there is already a file.
+ % In that case, use it. If that is not the case, generate it and include it afterwards.
+ \gdef\pgf@filename{}%
+ \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
+ \pgf@tempa
+ \ifx\pgf@filename\pgfutil@empty%
+ \global\tikzexternal@file@isuptodatefalse
+ \fi
+ \fi
+}%
+
+% \pgf@filename will be empty if the assertion failed.
+\def\tikzexternal@externalizefig@systemcall@assertsuccess#1{%
+ % check if there is a file now and raise an error message if not.
+ \gdef\pgf@filename{}%
+ \xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
+ \pgf@tempa
+ \ifx\pgf@filename\pgfutil@empty%
+ \PackageError{tikz}{Sorry, the system call '#1' did NOT result in a usable output file '\tikzexternal@curfilename' (expected one of \pgfsys@imagesuffixlist). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in '\tikzexternal@curfilename.log'. If you continue now, I'll try to typeset the picture}%
+ \fi
+}%
+
+% Overwrite error message of pgf.
+% This happens if the generated image was empty, i.e. if there was no \shipout.
+\def\pgfexternal@error@no@shipout{%
+ \begingroup
+ \tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}%
+ \toks0=\expandafter{\pgf@tempa}%
+ \PackageError{tikz}{Sorry, image externalization failed: the resulting image was EMPTY. I tried to externalize '\pgfactualjobname', but it seems there is no such image in the document!?
+ \if\tikzexternal@opmode4 ^^J
+\space\space You are currently using 'mode=convert with system call'. This problem can happen if the image (or one of the images preceeding it) was declared inside of a \string\label{} (i.e. in the .aux file): 'convert with system call' has no access to the main aux file.^^J
+\space\space Possible solutions in this case:^^J
+\space\space a) Try using 'mode=list and make',^^J
+\space\space b) Issue the externalization command '\the\toks0' *manually* (also check the preceeding externalized images, perhaps the file name sequence is not correct).^^J
+\space\space Repeat: the resulting image was EMPTY, your attention is required
+\else
+ \if\tikzexternal@opmode5 ^^J
+\space\space You are currently using 'mode=list and make'. Possible solutions:^^J
+\space\space a) Try to delete `\tikzexternal@realjob.makefile'. Perhaps it is not up-to-date.^^J
+\space\space b) Perhaps pictures are declared inside of \string\label{} and the .aux file is not up-to-date. Re-run latex, perhaps re-generate the graphics as well.^^J
+\space\space Repeat: the resulting image was EMPTY, your attention is required
+ \fi
+\fi}%
+ \endgroup
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
index 12b6bddfe0d..d2aa190d618 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
@@ -7,8 +7,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex,v 1.2 2008/02/14 10:31:22 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex,v 1.3 2008/07/14 10:30:36 tantau Exp $
+\usetikzlibrary{shapes.multipart}
% Styles for states:
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
index c1a25628a08..cd68855bbab 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex,v 1.2 2010/02/08 11:21:46 tantau Exp $
% Layers
@@ -16,6 +16,12 @@
\pgfsetlayers{background,main}
+% Switch command
+\tikzset{on background layer/.style={
+ execute at begin scope={\pgfonlayer{background}},
+ execute at end scope={\endpgfonlayer}}}
+
+
% Main style
\tikzstyle{background rectangle}= [draw]
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
index f79f5343bb5..1a0ea356c24 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex,v 1.5 2008/02/04 17:19:55 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex,v 1.6 2009/09/04 17:22:59 tantau Exp $
%
%
@@ -378,7 +378,7 @@
\pgfmathparse{veclen(\the\pgf@xa,\the\pgf@ya)}
\pgfmathparse{acos(\the\pgf@xc/\pgfmathresult)}
\ifnum\pgfkeysvalueof{/tikz/cs/solution}>1\relax%
- \pgfmathsubtract{0}{\pgfmathresult}%
+ \pgfmathparse{0-\pgfmathresult}%
\fi%
\let\tikz@lib@temp=\pgfmathresult%
%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
index 0f7e0082611..24019031a36 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
@@ -7,7 +7,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex,v 1.4 2008/02/12 23:41:59 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex,v 1.5 2008/02/27 09:14:09 tantau Exp $
+
+\usetikzlibrary{positioning}
\tikzset{start chain/.default=,
start chain/.code={%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
index 62d1cbda803..4ab723f711c 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
@@ -110,8 +110,9 @@
\pgfpathmoveto{\pgfqpoint{\the\tikz@lastxsaved}{\the\tikz@lastysaved}}%
\fi%
}
-
+\newbox\tikz@lib@dec@box
\def\tikz@enddecoration{%
+ \global\setbox\tikz@lib@dec@box=\box\tikz@tempbox%
\ifx\tikz@decoration@name\tikz@nonetext%
% ignore this.
\else
@@ -123,6 +124,7 @@
\fi%
\fi
\endgroup%
+ \setbox\tikz@tempbox=\box\tikz@lib@dec@box%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
index f7c86aeba5d..ec4c6001f55 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
@@ -10,4 +10,27 @@
\usetikzlibrary{decorations}
\usepgflibrary{decorations.pathreplacing}
+
+\def\tikz@lib@dec@installinputsegmentpoints{%
+ \pgf@process{\pgf@decorate@inputsegment@first}%
+ \edef\tikzinputsegmentfirst{\the\pgf@x,\the\pgf@y}%
+ %
+ \pgf@process{\pgf@decorate@inputsegment@last}%
+ \edef\tikzinputsegmentlast{\the\pgf@x,\the\pgf@y}%
+ %
+ \pgf@process{\pgf@decorate@inputsegment@supporta}%
+ \edef\tikzinputsegmentsupporta{\the\pgf@x,\the\pgf@y}%
+ %
+ \pgf@process{\pgf@decorate@inputsegment@supportb}%
+ \edef\tikzinputsegmentsupportb{\the\pgf@x,\the\pgf@y}%
+}
+
+\pgfkeys{
+ /pgf/decoration/.cd,
+ moveto code/.code=\def\pgfdecoratedinputsegmentmovetocode{\tikz@lib@dec@installinputsegmentpoints#1},
+ lineto code/.code=\def\pgfdecoratedinputsegmentlinetocode{\tikz@lib@dec@installinputsegmentpoints#1},
+ curveto code/.code=\def\pgfdecoratedinputsegmentcurvetocode{\tikz@lib@dec@installinputsegmentpoints#1},
+ closepath code/.code=\def\pgfdecoratedinputsegmentclosepathcode{\tikz@lib@dec@installinputsegmentpoints#1}
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
index ec43475f6a0..589c3356f65 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex,v 1.2 2009/11/15 18:53:00 ludewich Exp $
\usepgflibrary{fadings}
@@ -28,8 +28,9 @@
\endgroup%
}
-\let\starttikzfadingfrompicture=\tikzfadingfrompicture
-\let\stopttikzfadingfrompicture=\endtikzfadingfrompicture
+% This makes it easier to maintain compatibility with the external lib:
+\def\starttikzfadingfrompicture{\tikzfadingfrompicture}
+\def\stopttikzfadingfrompicture{\endtikzfadingfrompicture}
\def\tikzfading[#1]{%
{%
@@ -44,4 +45,4 @@
}%
\pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
}%
-} \ No newline at end of file
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
index 1181dabea5f..2ae21de0420 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
@@ -7,15 +7,22 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex,v 1.2 2008/02/06 22:18:29 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex,v 1.3 2008/06/21 18:59:25 vibrovski Exp $
-\pgfkeys{/tikz/fit/.code=\tikz@lib@fit{#1}}
+\pgfkeys{/tikz/fit/.code=\tikz@lib@fit{#1},
+ /tikz/rotate fit/.code=\def\tikz@lib@fit@rotate{#1}\pgfkeysalso{/tikz/rotate=#1}
+}
+
+\def\tikz@lib@fit@rotate{0}
\def\tikz@lib@fit#1{%
\pgf@xb=-16000pt\relax%
\pgf@xa=16000pt\relax%
\pgf@yb=-16000pt\relax%
\pgf@ya=16000pt\relax%
+ %
+ \pgfmathsetmacro\tikz@lib@fit@rotate{\tikz@lib@fit@rotate}%
+ %
% Now iterate over the coordinates
\tikz@lib@fit@scan#1\pgf@stop%
% Now, let's see what has happend
@@ -29,6 +36,30 @@
\advance\pgf@y by-\pgf@ya%
\advance\pgf@xa by.5\pgf@x%
\advance\pgf@ya by.5\pgf@y%
+ \ifdim\tikz@lib@fit@rotate pt=0pt\relax%
+ \edef\tikz@node@at{\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \else%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ {%
+ \pgf@xc=\pgf@xa%
+ \pgf@yc=\pgf@ya%
+ \pgfgettransform\tikz@lib@fit@transform%
+ \pgftransforminvert%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \pgftransformreset%
+ \pgftransformrotate{\tikz@lib@fit@rotate}%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \pgfsettransform\tikz@lib@fit@transform%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \global\pgf@x=\pgf@xc%
+ \global\pgf@y=\pgf@yc%
+ }%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@x=\pgf@xc%
+ \pgf@y=\pgf@yc%
+ \fi%
\edef\tikz@node@at{\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}%
\pgfkeysalso{/tikz/anchor=center,/tikz/text centered}%
\pgfkeysalso{/tikz/text width/.expanded=\the\pgf@x}%
@@ -59,7 +90,25 @@
}
\def\tikz@lib@fit@adjust#1{%
- \pgf@process{#1}%
+ \ifdim\tikz@lib@fit@rotate pt=0pt\relax%
+ \pgf@process{#1}%
+ \else%
+ {%
+ #1%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfgettransform\tikz@lib@fit@transform%
+ \pgftransforminvert%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \pgftransformreset%
+ \pgftransformrotate{-\tikz@lib@fit@rotate}%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \pgfsettransform\tikz@lib@fit@transform%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}%
+ \global\pgf@x=\pgf@xc%
+ \global\pgf@y=\pgf@yc%
+ }%
+ \fi%
\ifdim\pgf@x<\pgf@xa%
\pgf@xa=\pgf@x%
\fi%
@@ -74,4 +123,5 @@
\fi%
}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex
new file mode 100644
index 00000000000..56d35c5008b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex
@@ -0,0 +1,10 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+\usepgflibrary{fixedpointarithmetic}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex
new file mode 100644
index 00000000000..eda3ce51996
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex
@@ -0,0 +1,10 @@
+% Copyright 2008/2009 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU General Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgflibrary{fpu}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex
new file mode 100644
index 00000000000..dd842033fc8
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex
@@ -0,0 +1,156 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgflibrary{intersections}
+
+\let\tikz@intersect@def=\def
+
+\pgfkeys{%
+ /tikz/name path global/.code={%
+ % it might have been more efficient to eliminate the storage macro
+ % \tikz@intersect@namedpaths. But I keep it maintain compatibility
+ % with mixed occurances of local/global names.
+ \let\tikz@intersect@def=\gdef
+ \pgfkeys{/tikz/name path={#1}}%
+ },
+ /tikz/name path local/.code={%
+ \let\tikz@intersect@def=\def
+ \pgfkeys{/tikz/name path={#1}}%
+ },
+ /tikz/name path/.code={%
+ \tikz@addmode{%
+ \pgfsyssoftpath@getcurrentpath\tikz@intersect@temppath%
+ \ifx\tikz@intersect@namedpaths\pgfutil@empty%
+ \else%
+ \tikz@intersect@namedpaths%
+ \pgfutil@ifundefined{tikz@intersect@path@name@#1}{}%
+ {%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@intersect@@temppath%
+ \expandafter\expandafter\expandafter{\csname tikz@intersect@path@name@#1\endcsname}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@intersect@temppath%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@intersect@temppath\tikz@intersect@temppath}%
+ }%
+ \fi%
+ \tikz@intersect@addto@path@names{#1}%
+ }%
+ }
+}
+
+\def\tikz@intersect@addto@path@names#1{%
+ % FIXME : I have the impression that something is not correct
+ % here... the \tikz@intersect@def is not used correctly!
+ % if I am not mistaken, the \tikz@intersect@def will NOT be
+ % invoked until \tikz@intersect@namedpaths. CHECK IT
+ % It seems it works, but only partially.
+ \def\tikz@marshal{\expandafter\tikz@intersect@def\csname tikz@intersect@path@name@#1\endcsname}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@marshal%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@marshal\expandafter{\tikz@intersect@temppath}}%
+ \ifx\tikz@intersect@def\gdef
+ % This here is to *ensure* that the \gdef is invoked.
+ %
+ % I think this solves the problem.
+ %
+ % Please revise this routine such that it works better.
+ \tikz@marshal
+ \fi
+ \expandafter\pgfutil@g@addto@macro\expandafter\tikz@intersect@namedpaths\expandafter{\tikz@marshal}%
+}
+
+
+\let\tikz@finish@orig=\tikz@finish
+\def\tikz@finish{%
+ \tikz@finish@orig%
+ \tikz@intersect@finish%
+}
+
+\def\tikz@intersect@finish{%
+ \ifx\tikz@intersect@namedpaths\pgfutil@empty%
+ \else%
+ \tikz@intersect@namedpaths%
+ \let\tikz@intersect@namedpaths=\pgfutil@empty%
+ \fi%
+}
+
+\let\tikz@intersect@namedpaths=\pgfutil@empty
+\let\tikz@intersect@path@a=\pgfutil@empty
+\let\tikz@intersect@path@b=\pgfutil@empty
+\let\tikz@intersect@name=\pgfutil@empty
+\let\tikz@intersect@total=\pgfutil@empty
+
+\tikzset{
+ name intersections/.code={%
+ \tikzset{/tikz/intersection/.cd,
+ by=,
+ #1}%
+ \pgfutil@ifundefined{tikz@intersect@path@name@\tikz@intersect@path@a}{%
+ \PackageError{tikz}{I do not know the path named `\tikz@intersect@path@a'. Perhaps you misspelt it}{}}%
+ {\pgfutil@ifundefined{tikz@intersect@path@name@\tikz@intersect@path@b}{%
+ \PackageError{tikz}{I do not know the path named `\tikz@intersect@path@b'. Perhaps you misspelt it}{}}%
+ {%
+ \pgfintersectionofpaths%
+ {%
+ \expandafter\pgfsetpath\csname tikz@intersect@path@name@\tikz@intersect@path@a\endcsname%
+ }%
+ {%
+ \expandafter\pgfsetpath\csname tikz@intersect@path@name@\tikz@intersect@path@b\endcsname%
+ }%
+ \ifx\tikz@intersect@total\pgfutil@empty%
+ \else%
+ \expandafter\let\tikz@intersect@total=\pgfintersectionsolutions%
+ \fi%
+ \ifx\tikz@intersect@name\pgfutil@empty%
+ \def\tikz@intersect@@name{intersection}%
+ \else%
+ \let\tikz@intersect@@name=\tikz@intersect@name%
+ \fi%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgfintersectionsolutions\relax%
+ \else%
+ \path[reset cm]\pgfextra{\pgftransformshift{\pgfpointintersectionsolution{\pgfmathcounter}}}%
+ coordinate (\tikz@intersect@@name-\pgfmathcounter);
+ \repeatpgfmathloop%
+ \ifx\tikz@intersect@by\pgfutil@empty%
+ \else%
+ \foreach\tikz@intersect@name[count=\tikz@intersection@count] in \tikz@intersect@by%
+ {\expandafter\tikz@intersect@name@parse\tikz@intersect@name\pgf@stop}%
+ \fi%
+ }%
+ }%
+ },%
+ intersection/.cd,
+ of/.code=\tikz@intersect@path@names@parse#1\tikz@stop,%
+ name/.store in=\tikz@intersect@name,
+ total/.store in=\tikz@intersect@total,
+ by/.store in=\tikz@intersect@by,
+ sort by/.code=\edef\tikz@intersect@sort@by{#1}\tikz@intersect@check@sort@by%
+}
+
+
+\def\tikz@intersect@check@sort@by{%
+ \ifx\tikz@intersect@sort@by\tikz@intersect@path@a%
+ \pgfintersectionsortbyfirstpath%
+ \else%
+ \ifx\tikz@intersect@sort@by\tikz@intersect@path@b%
+ \pgfintersectionsortbysecondpath%
+ \else%
+ \pgf@intersect@sortfalse%
+ \fi%
+ \fi%
+}
+\def\tikz@intersect@path@names@parse#1 and #2\tikz@stop{%
+ \def\tikz@intersect@path@a{#1}%
+ \def\tikz@intersect@path@b{#2}%
+}
+
+\def\tikz@intersect@name@parse{\pgfutil@ifnextchar[\tikz@intersect@name@parse@opt{\tikz@intersect@name@parse@opt[]}}%}
+\def\tikz@intersect@name@parse@opt[#1]#2\pgf@stop{%
+ \coordinate [#1] (#2) at (\tikz@intersect@@name-\tikz@intersection@count);
+}%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex
new file mode 100644
index 00000000000..4095f3a376c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex
@@ -0,0 +1,81 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+\usepgflibrary{lindenmayersystems}
+
+\def\tikz@@lsystem-system{%
+ \pgfutil@ifnextchar[{\tikz@lsystem@options}{\tikz@lsystem@options[]}}
+
+\def\tikz@lsystem indenmayer system{%
+ \pgfutil@ifnextchar[{\tikz@lsystem@options}{\tikz@lsystem@options[]}}
+
+\def\tikz@lsystem@options[#1]{%
+ \tikzset{#1}%
+ \ifx\tikz@lsystem@rules\pgfutil@empty%
+ \else%
+ \tikz@lsystem@declare%
+ \def\tikz@lsystem@name{tikz@temp}%
+ \fi%
+ \ifx\tikz@lsystem@anchor\pgfutil@empty%
+ \pgfpathmoveto{\pgfqpoint{\tikz@lastxsaved}{\tikz@lastysaved}}%
+ \pgflindenmayersystem{\tikz@lsystem@name}{\tikz@lsystem@axiom}{\tikz@lsystem@order}%
+ \else%
+ \pgfextract@process\tikz@lsystem@pos{\pgfqpoint{\tikz@lastxsaved}{\tikz@lastysaved}}%
+ \setbox\pgfnodeparttextbox=\hbox{%
+ \pgfinterruptpicture%
+ \pgfpicture%
+ \pgfpathmoveto{\pgfpointorigin}%
+ \pgflindenmayersystem{\tikz@lsystem@name}{\tikz@lsystem@axiom}{\tikz@lsystem@order}%
+ \begingroup%
+ \tikz@finish%
+ \endpgfpicture%
+ \endpgfinterruptpicture%
+ }%
+ {%
+ \pgftransformshift{\tikz@lsystem@pos}%
+ \tikzset{inner sep=0pt, outer sep=0pt, minimum size=0pt}%
+ \pgfmultipartnode{rectangle}{\tikz@lsystem@anchor}{lindenmayer system}{\pgfusepath{discard}}%
+ }%
+ \fi%
+ \tikz@scan@next@command}
+
+\tikzset{%
+ lindenmayer system/.style={/pgf/lindenmayer system/.cd, #1,/tikz/.cd},
+ l-system/.style={lindenmayer system={#1}},
+}
+\pgfkeys{/pgf/lindenmayer system/.cd,
+ name/.code=\edef\tikz@lsystem@name{#1}\let\tikz@lsystem@rules=\pgfutil@empty,%
+ axiom/.store in=\tikz@lsystem@axiom,%
+ order/.store in=\tikz@lsystem@order,
+ .unknown/.code={%
+ \pgfutil@ifundefined{pgf@lsystem@\pgfkeyscurrentname}{%
+ \pgfkeys{/errors/unknown key={/pgf/lindenmayer system/\pgfkeyscurrentname}{#1}}%
+ \let\tikz@lsystem@name=\pgfutil@empty%
+ }%
+ {\edef\tikz@lsystem@name{\pgfkeyscurrentname}}
+ },%
+ anchor/.store in=\tikz@lsystem@anchor,%
+ rule set/.store in=\tikz@lsystem@rules
+}
+\let\tikz@lsystem@anchor=\pgfutil@empty%
+\let\tikz@lsystem@rules=\pgfutil@empty%
+
+\def\tikz@lsystem@declare{%
+ \expandafter\let\csname pgf@lsystem@tikz@temp\endcsname=\relax%
+ \pgfdeclarelindenmayersystem{tikz@temp}{%
+ \expandafter\tikz@lsystem@parse@rules\tikz@lsystem@rules,\tikz@stop,%
+ }%
+}
+\def\tikz@lsystem@parse@rules#1,{%
+ \ifx#1\tikz@stop%
+ \else%
+ \rule{#1}%
+ \expandafter\tikz@lsystem@parse@rules%
+ \fi%
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
index 124e70f2278..f1f03c457dd 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex,v 1.2 2008/06/18 23:34:49 tantau Exp $
% A matrix of nodes contains a node in each cell.
@@ -84,7 +84,7 @@
% Provide a delimiter
-\tikzoption{left delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+\tikzoption{left delimiter}{\tikzset{append after command={\tikz@delimiter%
{south east}%
{south west}%
{every delimiter,every left delimiter}%
@@ -92,9 +92,9 @@
{north}%
{#1}%
{.}%
- {\pgf@y}}}
+ {\pgf@y}}}}
-\tikzoption{right delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+\tikzoption{right delimiter}{\tikzset{append after command={\tikz@delimiter%
{south west}%
{south east}%
{every delimiter,every right delimiter}%
@@ -102,9 +102,9 @@
{north}%
{.}%
{#1}%
- {\pgf@y}}}
+ {\pgf@y}}}}
-\tikzoption{above delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+\tikzoption{above delimiter}{\tikzset{append after command={\tikz@delimiter%
{south east}%
{north west}%
{every delimiter,every above delimiter,rotate=-90}%
@@ -112,9 +112,9 @@
{east}%
{#1}%
{.}%
- {\pgf@x}}}
+ {\pgf@x}}}}
-\tikzoption{below delimiter}{\tikz@add@after@node@path{\tikz@delimiter%
+\tikzoption{below delimiter}{\tikzset{append after command={\tikz@delimiter%
{south west}%
{south west}%
{every delimiter,every below delimiter,rotate=-90}%
@@ -122,7 +122,7 @@
{east}%
{.}%
{#1}%
- {\pgf@x}}}
+ {\pgf@x}}}}
\def\tikz@delimiter#1#2#3#4#5#6#7#8{%
\bgroup
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
index 06f42f5c457..981d747a3e5 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex,v 1.5 2008/02/10 16:29:07 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex,v 1.9 2009/11/12 09:53:02 ludewich Exp $
\usetikzlibrary{trees,decorations}
@@ -99,11 +99,12 @@
\tikzstyle{circle connection bar}=
[to path={
\pgfextra{\tikz@compute@circle@radii\tikz@compute@segmentamplitude}
- [fill=\tikz@concept@color,draw=none]
[every circle connection bar]
decorate [decoration=circle connection bar]
{ -- (\tikztotarget) \tikztonodes}
-}]
+},
+append after command={[fill=\tikz@concept@color,draw=none]}
+]
\tikzstyle{every circle connection bar}=[]
\def\tikz@compute@circle@radii{%
@@ -132,21 +133,87 @@
\tikzoption{circle connection bar switch color}{\tikz@parse@switch#1\pgf@unique}
\def\tikz@parse@switch from (#1) to (#2)\pgf@unique{%
- \def\tikz@to@path{%
- \pgfextra{%
- \pgfutil@colorlet{tikz@switch@from}{#1}%
- \pgfutil@colorlet{tikz@switch@to}{#2}%
- \tikz@compute@circle@radii\tikz@compute@segmentamplitude%
- \tikz@compute@rotation%
- }
- [fill=none,draw=none]
- [every circle connection bar]
- decorate [decoration=circle connection bar]
- {-- (\tikztotarget) \tikztonodes}
- [shading=tikz@shade@bar]
+ \tikzset{to path={%
+ \pgfextra{%
+ \tikz@compute@circle@radii\tikz@compute@segmentamplitude%
+ \global\let\tikz@lib@save@start=\tikztostart%
+ \global\let\tikz@lib@save@target=\tikztotarget%
+ \pgfkeysgetvalue{/pgf/decoration/start radius}\pgf@temp%
+ \global\let\tikz@lib@saved@start@radius=\pgf@temp%
+ \pgfkeysgetvalue{/pgf/decoration/end radius}\pgf@temp%
+ \global\let\tikz@lib@saved@end@radius=\pgf@temp%
+ }%
+ [every circle connection bar]
+ decorate [decoration=circle connection bar]
+ { -- (\tikztotarget) \tikztonodes}
+ },
+ append after command={
+ [fill=none,draw=none,path picture=\tikz@lib@shade@pic]
+ \pgfextra{
+ \pgfutil@colorlet{tikz@switch@from}{#1}%
+ \pgfutil@colorlet{tikz@switch@to}{#2}%
+ }}
}
}
+\def\tikz@lib@shade@pic{%
+ % We have to draw the shading...
+ % compute start point:
+ \pgftransformreset%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgfpointanchor{\tikz@lib@save@start}{center}}{\pgfpointanchor{\tikz@lib@save@target}{center}}}}%
+ \edef\tikz@lib@mm@vec{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfmathsetlength\pgf@xc{\tikz@lib@saved@start@radius}
+ \pgf@process{\pgfpointadd{\pgfpointtransformed{\pgfpointanchor{\tikz@lib@save@start}{center}}}
+ {\pgfpointscale{\pgf@sys@tonumber{\pgf@xc}}{\tikz@lib@mm@vec}}}
+ \edef\tikz@lib@mm@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfmathsetlength\pgf@xc{\tikz@lib@saved@end@radius}
+ \pgf@process{\pgfpointdiff{\tikz@lib@mm@start}{\pgfpointadd{\pgfpointtransformed{\pgfpointanchor{\tikz@lib@save@target}{center}}}
+ {\pgfpointscale{-\pgf@sys@tonumber{\pgf@xc}}{\tikz@lib@mm@vec}}}}
+ \edef\tikz@lib@mm@end{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgftransformshift{\tikz@lib@mm@start}
+ \pgflowlevelsynccm
+ \pgf@process{\tikz@lib@mm@vec}
+ {
+ \pgf@xa=-\pgf@x%
+ \pgftransformcm{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
+ {\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@xa}}%
+ {\pgfpointorigin}%
+ \pgf@process{\pgfpointtransformed{\tikz@lib@mm@end}}%
+ \expandafter
+ }
+ \edef\tikz@lib@mm@length{\the\pgf@x}%
+ \pgf@process{\tikz@lib@mm@vec}
+ \pgf@ya=-\pgf@y%
+ \pgftransformcm{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
+ {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}%
+ {\pgfpointorigin}%
+ % Y scale:
+ \pgfmathsetlength\pgf@y{\tikz@lib@saved@start@radius}%
+ \pgfmathsetlength\pgf@ya{\tikz@lib@saved@end@radius}%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@y=\pgf@ya%
+ \fi%
+ \pgf@y=0.01992528\pgf@y%
+ \pgftransformyscale{\pgf@sys@tonumber{\pgf@y}}%
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\tikz@lib@saved@start@radius}{-50bp}}
+ {\pgfpoint{1pt}{50bp}}
+ \pgfsetfillcolor{tikz@switch@from}
+ \pgfusepath{fill}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\tikz@lib@mm@length+\tikz@lib@saved@end@radius}{-50bp}}
+ {\pgfpoint{\tikz@lib@mm@length-1pt}{50bp}}
+ \pgfsetfillcolor{tikz@switch@to}
+ \pgfusepath{fill}
+ % X scale:
+ \pgf@x=\tikz@lib@mm@length%
+ \pgf@x=0.009962\pgf@x%
+ \pgftransformxscale{\pgf@sys@tonumber{\pgf@x}}%
+ \pgftransformxshift{50bp}
+ \pgflowlevelsynccm%
+ \pgfuseshading{tikz@shade@bar}
+}
+
\tikzoption{concept color}{%
\let\tikz@old@concept@color=\tikz@concept@color%
\def\tikz@edge@to@parent@path{
@@ -158,24 +225,8 @@
\pgfdeclarehorizontalshading[tikz@switch@from,tikz@switch@to]{tikz@shade@bar}{100bp}{%
color(0pt)=(tikz@switch@from);
- color(50bp)=(tikz@switch@from);
- color(55bp)=(tikz@switch@to);
color(100bp)=(tikz@switch@to)}
-\def\tikz@compute@rotation{%
- \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgfpointanchor{\tikztostart}{center}}{\pgfpointanchor{\tikztotarget}{center}}}}%
- \pgf@ya=-\pgf@y%
- \edef\pgf@marshal{%
- \noexpand\pgfsetadditionalshadetransform{%
- \noexpand\pgftransformcm
- {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}%
- {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}%
- {\noexpand\pgfpointorigin}%
- }%
- }%
- \pgf@marshal%
-}
-
@@ -234,6 +285,32 @@
level distance=1.85cm,%
sibling angle=30,%
font=\pgfutil@font@tiny]
+
+\tikzstyle{small mindmap}=
+ [%
+ root concept/.style={minimum size=2.3cm,text width=2.1cm,font=\pgfutil@font@footnotesize},
+ level 1 concept/.style={%
+ minimum size=1.5cm,
+ level distance=2.8cm,
+ text width=1.4cm,
+ sibling angle=75,
+ font=\pgfutil@font@scriptsize},%
+ level 2 concept/.style={%
+ minimum size=1.1cm,%
+ level distance=2.2cm,%
+ text width=1.1cm,%
+ sibling angle=60,%
+ font=\pgfutil@font@tiny},%
+ level 3 concept/.style={%
+ level 2 concept,
+ sibling angle=30,%
+ font=\pgfutil@font@tiny},%
+ level 4 concept/.style={%
+ level 3 concept,
+ },
+ mindmap,%
+ line width=2pt
+ ]
\tikzstyle{large mindmap}=
[%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
index e9e79e986bb..524bea7a28f 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex,v 1.2 2008/06/18 23:34:49 tantau Exp $
% Styles for places:
@@ -48,17 +48,17 @@
\tikzoption{tokens}{%
\ifnum#1>0\relax%
- \tikz@add@after@node@path{%
+ \tikzset{append after command={}
{[children are tokens]child foreach \tikz@dummy in {1,...,#1} {node[token]{}}}}%
\fi}
\tikzoption{colored tokens}{%
- \tikz@add@after@node@path{%
+ \tikzset{append after command={}%
{[children are tokens]child foreach \tikz@child@color in {#1} {node[token,\tikz@child@color]{}}}}%
}
\tikzoption{structured tokens}{%
- \tikz@add@after@node@path{%
+ \tikzset{append after command={}%
{[children are tokens]child foreach \tikz@child@name in {#1} {node[token]{\tikz@child@name}}}}%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
index 0ebb15e18ca..7a9066e691e 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex,v 1.5 2008/02/12 23:41:59 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex,v 1.7 2008/10/06 09:35:29 tantau Exp $
\tikzset{above/.code=\tikz@lib@place@handle@{#1}{south}{0}{1}{north}{1}}
@@ -19,8 +19,8 @@
\tikzset{below left/.code=\tikz@lib@place@handle@{#1}{north east}{-1}{-1}{south west}{0.707106781}}
\tikzset{below right/.code=\tikz@lib@place@handle@{#1}{north west}{1}{-1}{south east}{0.707106781}}
\tikzset{left/.code =\tikz@lib@place@handle@{#1}{east}{-1}{0}{west}{1}}
-\tikzset{mid left/.code =\tikz@lib@place@handle@{#1}{mid east}{-1}{0}{base west}{1}}
-\tikzset{mid right/.code=\tikz@lib@place@handle@{#1}{mid west}{1}{0}{base east}{1}}
+\tikzset{mid left/.code =\tikz@lib@place@handle@{#1}{mid east}{-1}{0}{mid west}{1}}
+\tikzset{mid right/.code=\tikz@lib@place@handle@{#1}{mid west}{1}{0}{mid east}{1}}
\tikzset{right/.code=\tikz@lib@place@handle@{#1}{west}{1}{0}{east}{1}}
\newif\iftikz@lib@ignore@size
@@ -34,6 +34,7 @@
\def\tikz@lib@place@handle@#1#2#3#4#5#6{%
\def\tikz@anchor{#2}%
+ \let\tikz@do@auto@anchor=\relax%
\edef\tikz@temp{#1}%
\def\tikz@lib@place@single@factor{#6}%
\expandafter\tikz@lib@place@handle@@\expandafter{\tikz@temp}{#3}{#4}{#5}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
index 4209c3e939d..808e34578d6 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
@@ -7,19 +7,23 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex,v 1.1 2008/02/08 01:18:38 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex,v 1.2 2008/06/27 17:00:24 vibrovski Exp $
% Redefine the after command hook...
\def\tikz@lib@scope@check{%
- \pgfutil@ifnextchar\par{%
- \afterassignment\tikz@lib@scope@check\let\tikz@next%
- }%
- {\pgfutil@ifnextchar\bgroup{%gotcha
- \afterassignment\tikz@lib@scope@gotcha\let\tikz@next%
- }%
- {}%
- }
+ \pgfutil@ifnextchar\tikz@intersect@finish{%
+ \tikz@intersect@finish\afterassignment\tikz@lib@scope@check\let\tikz@next%
+ }{%
+ \pgfutil@ifnextchar\par{%
+ \afterassignment\tikz@lib@scope@check\let\tikz@next%
+ }%
+ {\pgfutil@ifnextchar\bgroup{%gotcha
+ \afterassignment\tikz@lib@scope@gotcha\let\tikz@next%
+ }%
+ {}%
+ }%
+ }%
}
\def\tikz@lib@scope@gotcha{%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex
new file mode 100644
index 00000000000..962d9956af9
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex
@@ -0,0 +1,21 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex,v 1.1 2008/10/29 21:58:38 tantau Exp $
+
+\usepgflibrary{shadings}
+
+\tikzset{
+ lower left/.style={shading=bilinear interpolation,/utils/exec=\colorlet{lower left}{#1}},
+ upper left/.style={shading=bilinear interpolation,/utils/exec=\colorlet{upper left}{#1}},
+ lower right/.style={shading=bilinear interpolation,/utils/exec=\colorlet{lower right}{#1}},
+ upper right/.style={shading=bilinear interpolation,/utils/exec=\colorlet{upper right}{#1}}
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex
new file mode 100644
index 00000000000..fd45a761535
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex
@@ -0,0 +1,122 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex,v 1.2 2009/12/04 11:59:38 tantau Exp $
+
+
+
+% Spy styles
+
+\tikzset{
+ spy using outlines/.style={
+ spy scope={
+ every spy on node/.style={very thin,draw},
+ every spy in node/.style={thick,draw},
+ #1
+ }
+ },
+ spy using overlays/.style={
+ spy scope={
+ every spy on node/.style={fill,fill opacity=0.2,text opacity=1},
+ every spy in node/.style={fill,fill opacity=0.2,text opacity=1},
+ #1
+ }
+ },
+ connect spies/.style={
+ spy connection path={\draw[thin] (tikzspyonnode) -- (tikzspyinnode);}
+ }
+}
+
+\newbox\tikz@lib@spybox
+
+\let\tikz@lib@spy@collection=\pgfutil@empty%
+
+\tikzset{spy scope/.style={
+ size/.style={minimum size=##1},
+ height/.style={minimum height=##1},
+ width/.style={minimum width=##1},
+ execute at begin scope={%
+ \let\tikz@lib@spy@save=\tikz@lib@spy@collection%
+ \setbox\tikz@lib@spybox=\hbox\bgroup%
+ \let\spy=\tikz@lib@spy@parse},
+ execute at end scope={%
+ \egroup%
+ {%
+ \copy\tikz@lib@spybox%
+ \tikz@lib@spy@collection%
+ }%
+ \global\let\tikz@lib@spy@collection=\tikz@lib@spy@save%
+ },%
+ tikz@lib@spy@style/.style={#1},
+ tikz@lib@reset@gs
+ },
+ lens/.store in=\tikz@lib@spy@lens,
+ lens=,
+ magnification/.style={lens={scale=#1}},
+ spy connection path/.store in=\tikz@lib@spy@path,
+ spy connection path=
+}
+
+\tikzset{
+ tikz@lib@reset@gs/.style={black,thin,solid,opaque,line cap=butt,line join=miter}
+}
+
+\def\tikz@lib@spy@parse{%
+ \pgfutil@ifnextchar[{\tikz@lib@spy@parse@opt}{\tikz@lib@spy@parse@opt[]}%]
+}
+\def\tikz@lib@spy@parse@opt[#1]{
+ \pgfutil@ifnextchar x{\tikz@lib@spy@parse@opta[#1]}{\tikz@lib@spy@parse@opta[#1]}%]
+}
+\def\tikz@lib@spy@parse@opta[#1]on#2in node#3;{%
+ \pgfutil@g@addto@macro\tikz@lib@spy@collection{\tikz@lib@spy@do{#1}{#2}{#3}}%
+}
+
+\def\tikz@lib@spy@do#1#2#3{%
+ \scope[tikz@lib@spy@style,#1]
+ \node [alias=tikzspyonnode,inner sep=0pt,outer sep=0pt,every spy on node/.try,
+ /utils/exec={
+ {%
+ \let\tikz@transform=\relax
+ \pgftransformreset%
+ \expandafter\tikzset\expandafter{\tikz@lib@spy@lens}
+ \pgftransforminvert%
+ \pgfgettransformentries\a\b\c\d\e\f%
+ \global\let\pgf@lib@svg@a=\a%
+ \global\let\pgf@lib@svg@b=\b%
+ \global\let\pgf@lib@svg@c=\c%
+ \global\let\pgf@lib@svg@d=\d%
+ }%
+ \tikz@addtransform{%
+ \tikz@scan@one@point\pgftransformshift#2%
+ \pgftransformcm{\pgf@lib@svg@a}{\pgf@lib@svg@b}{\pgf@lib@svg@c}{\pgf@lib@svg@d}{\pgfpointorigin}%
+ }
+ }]{};
+ \node [alias=tikzspyinnode,inner sep=0pt,outer sep=0pt,at={#2},every spy in node/.try,
+ path picture={\node[anchor=center,tikz@lib@reset@gs]{\nullfont%
+ \pgftransformreset%
+ \let\tikz@transform=\relax%
+ \expandafter\tikzset\expandafter{\tikz@lib@spy@lens}%
+ \pgflowlevelsynccm%
+ \tikz@scan@one@point\tikz@lib@spy@shift#2%
+ \pgflowlevelsynccm%
+ \copy\tikz@lib@spybox};}]#3{};
+ \tikz@lib@spy@path
+ \endscope
+}
+
+\def\tikz@lib@spy@shift#1{%
+ \pgf@process{#1}%
+ \pgf@x=-\pgf@x%
+ \pgf@y=-\pgf@y%
+ \pgftransformshift{}%
+}
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex
new file mode 100644
index 00000000000..0cee69a2fde
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex
@@ -0,0 +1,31 @@
+% Copyright 2009 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex,v 1.1 2009/01/24 17:07:14 tantau Exp $
+
+\usepgflibrary{svg.path}
+
+\def\tikz@svg@path vg{\pgfutil@ifnextchar[\tikz@svg@@path{\tikz@svg@@path[]}}%}
+
+\def\tikz@svg@@path[#1]#2"#3"{%
+ {%
+ \tikzset{#1}%
+ \pgfpathsvg{#3}%
+ }%
+ {
+ \pgftransforminvert
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@path@lastx}{\pgf@path@lasty}}}
+ }
+ \tikz@lastx=\pgf@x%
+ \tikz@lasty=\pgf@y%
+ \tikz@lastxsaved=\tikz@lastx%
+ \tikz@lastysaved=\tikz@lasty%
+ \tikz@updatecurrenttrue%
+ \tikz@scan@next@command
+} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
index 2be37e7d3d3..ea87a5bd394 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
@@ -7,7 +7,12 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex,v 1.2 2008/06/17 21:23:44 tantau Exp $
+
+
+% Move to
+
+\tikzstyle{move to}= [to path={(\tikztotarget) \tikztonodes}]
% Straight to
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
index 838bb20be21..7d34c2d6819 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex,v 1.2 2008/02/24 10:00:52 tantau Exp $
@@ -53,6 +53,8 @@
\pgf@temp%
}
+
+
%
% Circle grow
%
@@ -81,6 +83,10 @@
+
+
+
+
%
% Connections
%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex
new file mode 100644
index 00000000000..c0306b4d304
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex
@@ -0,0 +1,84 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex,v 1.3 2008/06/18 23:34:49 tantau Exp $
+
+
+\tikzset{turtle/.style={/tikz/turtle/.cd,#1}}
+
+% The current angle is stored in this key.
+\tikzset{turtle/direction/.code=\gdef\tikz@lib@turtle@dir{#1},turtle/direction=90}
+
+% The current angle is stored in this key.
+\tikzset{turtle/distance/.initial=1cm}
+
+% The to path options that are used to move the turtle
+\tikzset{turtle/how/.style=}
+
+% Let the turtle jump home
+\tikzset{turtle/home/.style={/tikz/insert path={(0,0) [turtle/direction=90]}}}
+
+% Moves the turtle forward by the given distance or, if no distance is
+% given, by turtle distance
+\tikzset{
+ turtle/forward/.default=\pgfkeysvalueof{/tikz/turtle/distance},
+ turtle/forward/.style={/tikz/insert path={to[/tikz/turtle/how]++(\tikz@lib@turtle@dir:#1)}}
+}
+
+
+
+% Moves the turtle backward by the given distance or, if no distance is
+% given, by turtle distance
+\tikzset{
+ turtle/back/.default=\pgfkeysvalueof{/tikz/turtle/distance},
+ turtle/back/.style={turtle forward=-#1}
+}
+
+
+
+% Turns the turle left by the given number of degrees
+\tikzset{
+ turtle/left/.default=90,
+ turtle/left/.code={%
+ \pgfmathparse{#1+\tikz@lib@turtle@dir}%
+ \ifdim\pgfmathresult pt>360pt\relax%
+ \pgfmathparse{\pgfmathresult-360}%
+ \fi%
+ \global\let\tikz@lib@turtle@dir\pgfmathresult
+ }
+}
+
+
+% Turns the turle left by the given number of degrees
+\tikzset{
+ turtle/right/.default=90,
+ turtle/right/.code={%
+ \pgfmathparse{#1}
+ \pgfmathparse{\tikz@lib@turtle@dir-\pgfmathresult}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathparse{\pgfmathresult+360}%
+ \fi%
+ \global\let\tikz@lib@turtle@dir\pgfmathresult
+ }
+}
+
+
+% Shortcuts:
+\tikzset{turtle/.cd,
+ fd/.style={forward=#1},
+ fd/.default=\pgfkeysvalueof{/tikz/turtle/distance},
+ bk/.style={back=#1},
+ bk/.default=\pgfkeysvalueof{/tikz/turtle/distance},
+ lt/.style={left=#1},
+ lt/.default=90,
+ rt/.style={right=#1},
+ rt/.default=90}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
index cb8ad420ea8..e2a9cb2d649 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
@@ -7,19 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/tikz.code.tex,v 1.27 2008/02/13 19:48:11 tantau Exp $
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/tikz.code.tex,v 1.76 2010/10/13 09:20:31 ludewich Exp $
-% Always-present libraries:
-
+% Always-present libraries (|\usepgflibrary| defined in
+% \file{pgfutil-common.tex}).
\usepgflibrary{plothandlers}
-% TikZ is a key family
-\pgfkeys{/tikz/.is family}
-
-\def\tikzset{\pgfqkeys{/tikz}}
-
-
\newdimen\tikz@lastx
\newdimen\tikz@lasty
\newdimen\tikz@lastxsaved
@@ -41,32 +35,61 @@
\newif\iftikz@snaked
\newif\iftikz@decoratepath
+% |\pgfutil@empty| is defined in \file{pgfutil-common.tex}.
\let\tikz@options=\pgfutil@empty
-\def\tikz@addoption#1{\expandafter\def\expandafter\tikz@options\expandafter{\tikz@options#1}}
-\def\tikz@addmode#1{\expandafter\def\expandafter\tikz@mode\expandafter{\tikz@mode#1}}
+% |\tikz@addoption| adds \texttt{#1} at the end of the replacement
+% text of |\tikz@options| without expansion.
+\def\tikz@addoption#1{%
+ \expandafter\def\expandafter\tikz@options\expandafter{\tikz@options#1}}
+% Same as |tikz@addoption| for |\tikz@mode|. Note that |\tikz@mode| is
+% initially let to |\pgfutil@empty| later (see path usage options).
+\def\tikz@addmode#1{%
+ \expandafter\def\expandafter\tikz@mode\expandafter{\tikz@mode#1}}
+% Same as |tikz@addoption| for |\tikz@transform|. Works even if
+% |\tikz@transform| is not defined. In that case, nothing is added to
+% |\tikz@transform|: \texttt{#1} is expanded.
\def\tikz@addtransform#1{%
- \ifx\tikz@transform\relax%
+ \ifx\tikz@transform\relax
#1%
- \else%
+ \else
\expandafter\def\expandafter\tikz@transform\expandafter{\tikz@transform#1}%
- \fi%
-}
-
+ \fi}
-% TikZ options:
+% TikZ options management.
-% This command is supported for compatibility only:
+% Setting up the tikz key family (key management needs
+% \file{pgfkeys.code.tex});
+\pgfkeys{/tikz/.is family}
-\def\tikzoption#1{\pgfutil@ifnextchar[{\tikzoption@opt{#1}}{\tikzoption@noopt{#1}}}%}
+% |\tikzset| is a shortcut to set keys that belongs to the tikz
+% family.
+\def\tikzset{\pgfqkeys{/tikz}}
-\def\tikzoption@opt#1[#2]#3{\pgfkeysdef{/tikz/#1}{#3}\pgfkeyssetvalue{/tikz/#1/.@def}{#2}}
-\def\tikzoption@noopt#1#2{\pgfkeysdef{/tikz/#1}{#2}\pgfkeyssetvalue{/tikz/#1/.@def}{\pgfkeysvaluerequired}}
+% Note: |\tikzoption| is supported for compatibility only. |\tikzset|
+% should be used instead.
+\def\tikzoption#1{%
+ \pgfutil@ifnextchar[%]
+ {\tikzoption@opt{#1}}{\tikzoption@noopt{#1}}}
+\def\tikzoption@opt#1[#2]#3{%
+ \pgfkeysdef{/tikz/#1}{#3}%
+ \pgfkeyssetvalue{/tikz/#1/.@def}{#2}}
+\def\tikzoption@noopt#1#2{%
+ \pgfkeysdef{/tikz/#1}{#2}%
+ \pgfkeyssetvalue{/tikz/#1/.@def}{\pgfkeysvaluerequired}}
% Baseline options
-\tikzoption{baseline}[0pt]{\pgfutil@ifnextchar({\tikz@baseline@coordinate}{\tikz@baseline@simple}#1\@nil}%)
+\tikzoption{baseline}[0pt]{%
+ \pgfutil@ifnextchar(%)
+ {\tikz@baseline@coordinate}{\tikz@baseline@simple}#1\@nil}
\def\tikz@baseline@simple#1\@nil{\pgfsetbaseline{#1}}
-\def\tikz@baseline@coordinate#1\@nil{\pgfsetbaselinepointlater{\tikz@scan@one@point\pgfutil@firstofone#1}}
+\def\tikz@baseline@coordinate#1\@nil{%
+ \pgfsetbaselinepointlater{\tikz@scan@one@point\pgfutil@firstofone#1}}
+
+\tikzoption{trim left}[0pt]{\pgfutil@ifnextchar({\tikz@trim@coordinate{left}}{\tikz@trim@simple{left}}#1\@nil}%)
+\tikzoption{trim right}{\pgfutil@ifnextchar({\tikz@trim@coordinate{right}}{\tikz@trim@simple{right}}#1\@nil}%)
+\def\tikz@trim@simple#1#2\@nil{\csname pgfsettrim#1\endcsname{#2}}
+\def\tikz@trim@coordinate#1#2\@nil{\csname pgfsettrim#1pointlater\endcsname{\tikz@scan@one@point\pgfutil@firstofone#2}}
% Draw options
\tikzoption{line width}{\tikz@semiaddlinewidth{#1}}%
@@ -96,6 +119,7 @@
\expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
}%
\def\tikz@dashphase{0pt}
+\def\tikz@dashpattern{}
\def\tikz@scandashon n#1o{%
\expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
@@ -114,17 +138,44 @@
\else%
\ifx\tikz@temp\pgfutil@empty%
\else%
- \def\tikz@double@color{#1}%
+ \pgfsetinnerstrokecolor{#1}%
\fi%
\tikz@addmode{\tikz@mode@doubletrue}%
+ \tikzset{every double/.try}%
\fi}
\tikzoption{double distance}{%
\pgfmathsetlength{\pgf@x}{#1}%
- \edef\tikz@double@width@distance{\the\pgf@x}%
- \tikz@addmode{\tikz@mode@doubletrue}}
+ \edef\tikz@double@setup{%
+ \pgf@x=\the\pgf@x%
+ \advance\pgf@x by2\pgflinewidth%
+ \pgflinewidth=\pgf@x%
+ \noexpand\pgfsetlinewidth{\pgflinewidth}%
+ \noexpand\pgfsetinnerlinewidth{\the\pgf@x}%
+ }%
+ \tikzset{double}}
+\def\tikz@double@setup{%
+ \pgf@x=2\pgflinewidth%
+ \advance\pgf@x by0.6pt%
+ \pgflinewidth=\pgf@x%
+ \pgfsetlinewidth{\pgflinewidth}%
+ \pgfsetinnerlinewidth{0.6pt}%
+}%
+\tikzset{double distance between line centers/.code={
+ \pgfmathsetlength{\pgf@x}{#1}%
+ \edef\tikz@double@setup{%
+ \pgf@x=\pgflinewidth%
+ \pgf@xa=\the\pgf@x%
+ \advance\pgf@x by\pgf@xa%
+ \advance\pgf@xa by-\pgflinewidth%
+ \pgflinewidth=\pgf@x%
+ \noexpand\pgfsetlinewidth{\pgflinewidth}%
+ \noexpand\pgfsetinnerlinewidth{\pgf@xa}%
+ }%
+ \tikzset{double}}}
+\tikzset{double equal sign distance/.style={double distance between line centers=0.45ex}}
+
+
-\def\tikz@double@width@distance{0.6pt}
-\def\tikz@double@color{white}
% Fill options
@@ -167,6 +218,13 @@
\tikzoption{rounded corners}[4pt]{\pgfsetcornersarced{\pgfpoint{#1}{#1}}}
\tikzoption{sharp corners}[]{\pgfsetcornersarced{\pgfpointorigin}}
+% Radii and arc options
+\tikzset{x radius/.initial=0pt}
+\tikzset{y radius/.initial=0pt}
+\tikzset{radius/.style={/tikz/x radius=#1,/tikz/y radius=#1}}
+\tikzset{start angle/.initial=}
+\tikzset{end angle/.initial=}
+\tikzset{delta angle/.initial=}
% Coordinate options
@@ -302,13 +360,17 @@
\let\tikz@fillcolor=\pgfutil@empty
\let\tikz@strokecolor=\pgfutil@empty
+% Insert a path using an option
+\tikzset{insert path/.code=\tikz@scan@next@command#1\pgf@stop}
% Pattern options
\tikzset{pattern/.code=\PackageError{tikz}{You need to say \string\usetikzlibrary{patterns}}{},
pattern color/.style=pattern}
+% Path pictures
+\tikzset{path picture/.code=\tikz@addmode{\def\tikz@path@picture{#1}}}
-% Shading options
+% Fading options
\tikzset{path fading/.code={
\def\tikz@temp{#1}%
\ifx\tikz@temp\tikz@nonetext%
@@ -412,59 +474,139 @@
% Pin options
-\tikzoption{pin}{\pgfutil@ifnextchar[{\tikz@parse@pin}{\tikz@parse@pin[]}#1\pgf@nil}
-\tikzoption{pin distance}{\def\tikz@pin@distance{#1}}
-\tikzoption{pin edge}{\def\tikz@pin@edge@style{#1}}
-
-\tikzoption{tikz@pin@post}[]{%
- \tikz@compute@direction{\tikz@label@angle}{\tikz@pin@distance}%
- \global\let\tikz@pin@edge@style@smuggle=\tikz@pin@edge@style%
-}
-\tikzoption{tikz@pre@pin@edge}[]{\def\pgf@marshal{\tikzstyle{tikz@pin@options}=}
- \expandafter\pgf@marshal\expandafter[\tikz@pin@edge@style@smuggle]%
+\tikzset{
+ pin/.code={\pgfutil@ifnextchar[{\tikz@parse@pin}{\tikz@parse@pin[]}#1:\pgf@nil},%}
+ pin distance/.store in=\tikz@pin@distance,
+ pin distance=3ex,
+ pin position/.store in=\tikz@pin@default@pos,
+ pin position=above,
+ pin edge/.store in=\tikz@pin@edge@style,
+ pin edge={},
+ tikz@pin@post/.code={\global\let\tikz@pin@edge@style@smuggle=\tikz@pin@edge@style},
+ tikz@pre@pin@edge/.code={%
+ \def\pgf@marshal{\tikzstyle{tikz@pin@options}=}
+ \expandafter\pgf@marshal\expandafter[\tikz@pin@edge@style@smuggle]%
+ }%
}
-\def\tikz@pin@distance{3ex}
-\def\tikz@pin@edge@style{}
+\long\def\tikz@parse@pin[#1]#2:#3\pgf@nil{%
+ \def\tikz@temp{#3}%
+ \ifx\tikz@temp\pgfutil@empty%
+ % no position, use default
+ \tikz@@parse@pin[#1]\tikz@pin@default@pos:#2:\pgf@nil%
+ \else%
+ \tikz@@parse@pin[#1]#2:#3\pgf@nil%
+ \fi%
+}
-\def\tikz@parse@pin[#1]#2:#3\pgf@nil{%
- \tikz@add@after@node@path{%
+\long\def\tikz@@parse@pin[#1]#2:#3:\pgf@nil{%
+ \tikzset{append after command={%
\bgroup
[current point is local=true]
\pgfextra{\let\tikz@save@last@node=\tikzlastnode}%
- node [every pin,tikz@label@angle=#2,#1,at=(\tikzlastnode.\tikz@label@angle),%
- after node path={(\tikz@save@last@node) edge[every pin edge,tikz@pre@pin@edge,tikz@pin@options] (\tikzlastnode)},
- tikz@pin@post]
+ node [every pin,tikz@label@angle=#2,#1,%
+ append after command={(\tikz@save@last@node) edge[every pin edge,tikz@pre@pin@edge,tikz@pin@options] (\tikzlastnode)},
+ tikz@label@post=\tikz@pin@distance,tikz@pin@post]
{#3}
\egroup%
- }
+ }}
}
% Label and pin options
-\tikzoption{label}{\pgfutil@ifnextchar[{\tikz@parse@label}{\tikz@parse@label[]}#1\pgf@nil}
-\tikzoption{label distance}{\def\tikz@label@distance{#1}}
-
-\tikzoption{tikz@label@angle}{\def\tikz@label@angle{#1}\csname tikz@label@angle@is@#1\endcsname}
-
-\tikzoption{tikz@label@post}[]{\tikz@compute@direction{\tikz@label@angle}{\tikz@label@distance}}
-
-\def\tikz@label@distance{0pt}
+\tikzset{
+ label/.code={\pgfutil@ifnextchar[{\tikz@parse@label}{\tikz@parse@label[]}#1:\pgf@nil},%}
+ label distance/.store in=\tikz@label@distance,
+ label distance=0pt,
+ label position/.store in=\tikz@label@default@pos,
+ label position=above,
+ absolute/.is if=tikz@absolute,
+ tikz@label@angle/.store in=\tikz@label@angle
+}
+
+\newif\iftikz@absolute
+\def\tikz@on@text{center}
+
+\tikzset{tikz@label@post/.code 2 args={
+ \edef\tikz@label@angle{\tikz@label@angle}%
+ \csname tikz@label@angle@is@\tikz@label@angle\endcsname
+ \ifx\tikz@label@angle\tikz@on@text%
+ \def\tikz@node@at{\pgfpointanchor{\tikzlastnode}{center}}%
+ \def\tikz@anchor{center}%
+ \else%
+ \iftikz@absolute%
+ \pgftransformreset%
+ \pgf@process{%
+ \pgfpointshapeborder{\tikzlastnode}%
+ {\pgfpointadd{\pgfpointanchor{\tikzlastnode}{center}}{\pgfpointpolar{\tikz@label@angle}{1pt}}}}%
+ \edef\tikz@node@at{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \tikz@compute@direction{\tikz@label@angle}%
+ \tikz@addtransform{\pgftransformshift{\pgfpointpolar{\tikz@label@angle}{#1}}}%
+ \else%
+ \pgf@process{\pgfpointanchor{\tikzlastnode}{\tikz@label@angle}}%
+ \edef\tikz@node@at{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@process{\pgfpointanchor{\tikzlastnode}{center}}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \tikz@label@simplefalse%
+ \iftikz@fullytransformed%
+ \tikz@label@simpletrue%
+ \else
+ \ifdim\pgf@xc=\pgf@xb\relax%
+ \ifdim\pgf@yc=\pgf@yb\relax%
+ \tikz@label@simpletrue%
+ \fi%
+ \fi%
+ \fi%
+ \iftikz@label@simple%
+ \tikz@compute@direction{\tikz@label@angle}%
+ \tikz@addtransform{\pgftransformshift{\pgfpointpolar{\tikz@label@angle}{#1}}}%
+ \else%
+ \pgf@process{\pgfpointnormalised{%
+ \pgfpointdiff{\pgfpointtransformed{\pgfqpoint{\pgf@xc}{\pgf@yc}}}{\pgfpointtransformed{\pgfqpoint{\pgf@xb}{\pgf@yb}}}}}%
+ \edef\pgf@marshal{%
+ \noexpand\tikz@addtransform{\noexpand\pgftransformshift{\noexpand\pgfpointscale{#1}{
+ \noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}}}%
+ \pgf@marshal%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@x=\pgf@yc%
+ \pgf@y=-\pgf@xc%
+ \tikz@auto@anchor%
+ \fi%
+ \fi%
+ \fi}
+}
+
+\newif\iftikz@label@simple%
\def\tikz@parse@label[#1]#2:#3\pgf@nil{%
- \tikz@add@after@node@path{
+ \def\tikz@temp{#3}%
+ \ifx\tikz@temp\pgfutil@empty%
+ % no position, use default
+ \tikz@@parse@label[#1]\tikz@label@default@pos:#2:\pgf@nil%
+ \else%
+ \tikz@@parse@label[#1]#2:#3\pgf@nil%
+ \fi%
+}
+
+\def\tikz@@parse@label[#1]#2:#3:\pgf@nil{%
+ \tikzset{append after command={
\bgroup
+ [current point is local=true]
\pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name}%
node
[every label,%
tikz@label@angle=#2,%
#1,%
- at=(\tikzlastnode.\tikz@label@angle),tikz@label@post]%
+ tikz@label@post=\tikz@label@distance]%
{#3}%
\pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}%
\egroup%
- }
+ }}
}
\expandafter\def\csname tikz@label@angle@is@right\endcsname{\def\tikz@label@angle{0}}
@@ -476,9 +618,9 @@
\expandafter\def\csname tikz@label@angle@is@below\endcsname{\def\tikz@label@angle{270}}
\expandafter\def\csname tikz@label@angle@is@below right\endcsname{\def\tikz@label@angle{315}}
-\def\tikz@compute@direction#1#2{%
+\def\tikz@compute@direction#1{%
\let\tikz@do@auto@anchor=\relax
- \c@pgf@counta=#1\relax%
+ \pgfmathsetcount{\c@pgf@counta}{#1}%
\ifnum\c@pgf@counta<0\relax
\advance\c@pgf@counta by 360\relax%
\fi%
@@ -504,11 +646,9 @@
\else%
\def\tikz@anchor{west}%
\fi\fi\fi\fi\fi\fi\fi\fi%
- \tikz@addtransform{\pgftransformshift{\pgfpointpolar{#1}{#2}}}%
}
-
% General node options
\tikzoption{name}{\edef\tikz@fig@name{#1}}
@@ -521,14 +661,9 @@
\tikzset{alias/.code={\tikz@fig@mustbenamed\expandafter\def\expandafter\tikz@alias\expandafter{\tikz@alias\pgfnodealias{#1}{\tikz@fig@name}}}}
-\tikzoption{after node path}{\tikz@add@after@node@path{#1}}%
-\def\tikz@add@after@node@path#1{\expandafter\def\expandafter\tikz@after@node\expandafter{\tikz@after@node#1}}
-
-\def\tikzaddafternodepathoption#1{%
- #1%
- \expandafter\def\expandafter\tikz@afternodepathoptions\expandafter{\tikz@afternodepathoptions#1}}
-
-\let\tikz@afternodepathoptions=\pgfutil@empty
+% deprecated:
+\def\tikzaddafternodepathoption#1{#1\tikzset{prefix after command={\pgfextra{#1}}}}
+\tikzset{after node path/.style={append after command={#1}}}
\tikzoption{anchor}{\def\tikz@anchor{#1}\let\tikz@do@auto@anchor=\relax}
@@ -623,8 +758,6 @@
\fi%
}
-\def\tikz@time{.5}
-
\def\tikz@install@auto@anchor@{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on}
\def\tikz@install@auto@anchor@false{\let\tikz@do@auto@anchor=\relax}
\def\tikz@install@auto@anchor@left{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{left}}
@@ -647,15 +780,15 @@
\tikzoption{text height}{\def\tikz@text@height{#1}}
\tikzoption{text depth}{\def\tikz@text@depth{#1}}
\tikzoption{text ragged}[]%
-{\def\tikz@text@action{\raggedright\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
+{\def\tikz@text@action{\raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
\tikzoption{text badly ragged}[]{\def\tikz@text@action{\raggedright\relax}}
\tikzoption{text ragged left}[]%
-{\def\tikz@text@action{\raggedleft\leftskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
+{\def\tikz@text@action{\raggedleft\leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
\tikzoption{text badly ragged left}[]{\def\tikz@text@action{\raggedleft\relax}}
-\tikzoption{text justified}[]{\def\tikz@text@action{\leftskip\z@\rightskip\z@\relax}}
+\tikzoption{text justified}[]{\def\tikz@text@action{\leftskip0pt\rightskip0pt\relax}}
\tikzoption{text centered}[]{\def\tikz@text@action{%
- \leftskip\z@ plus2em%
- \rightskip\z@ plus2em%
+ \leftskip0pt plus2em%
+ \rightskip0pt plus2em%
\spaceskip.3333em \xspaceskip.5em%
\parfillskip=0pt%
\let\\=\@centercr% for latex
@@ -674,9 +807,25 @@
\let\tikz@textfont=\pgfutil@empty
\let\tikz@textopacity=\pgfutil@empty
-\def\tikz@text@action{\raggedright\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}
+\def\tikz@text@action{\raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}
+% Alignment
+\tikzset{
+ node halign header/.initial=,
+ align/.is choice,
+ align/left/.style ={text ragged,node halign header=\tikz@align@left@header},
+ align/flush left/.style ={text badly ragged,node halign header=\tikz@align@left@header},
+ align/right/.style ={text ragged left,node halign header=\tikz@align@right@header},
+ align/flush right/.style ={text badly ragged left,node halign header=\tikz@align@right@header},
+ align/center/.style={text centered,node halign header=\tikz@align@center@header},
+ align/flush center/.style={text badly centered,node halign header=\tikz@align@center@header},
+ align/justify/.style ={text justified,node halign header=\tikz@align@left@header},
+ align/none/.style ={text justified,node halign header=}
+}
+\def\tikz@align@left@header{##\hfil\cr}
+\def\tikz@align@right@header{\hfil##\cr}
+\def\tikz@align@center@header{\hfil##\hfil\cr}
@@ -708,8 +857,8 @@
\pgfutil@namedef{tikz@special@arrow@end>|}{tikz@>|@#2}%
\pgfutil@namedef{tikz@special@arrow@start<<}{tikzs@<<@#2}%
\pgfutil@namedef{tikz@special@arrow@end>>}{tikze@>>@#2}%<<
- \pgfutil@namedef{tikz@special@arrow@start>>}{tikzs@<<@#2}%<<
- \pgfutil@namedef{tikz@special@arrow@end<<}{tikze@>>@#2}%<<
+ \pgfutil@namedef{tikz@special@arrow@start>>}{tikzs@>>@#2}%<<
+ \pgfutil@namedef{tikz@special@arrow@end<<}{tikze@<<@#2}%<<
}
\def\tikz@processarrows#1{%
@@ -749,7 +898,7 @@
\def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}}
% Axis options
-\tikzoption{domain}{\def\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
+\tikzoption{domain}{\edef\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
\tikzoption{range}{\def\tikz@plot@range{#1}}
% Plot options
@@ -762,6 +911,15 @@
\tikzoption{xcomb}[]{\let\tikz@plot@handler=\pgfplothandlerxcomb}
\tikzoption{ycomb}[]{\let\tikz@plot@handler=\pgfplothandlerycomb}
\tikzoption{polar comb}[]{\let\tikz@plot@handler=\pgfplothandlerpolarcomb}
+\tikzoption{ybar}[]{\let\tikz@plot@handler=\pgfplothandlerybar}
+\tikzoption{ybar interval}[]{\let\tikz@plot@handler=\pgfplothandlerybarinterval}
+\tikzoption{xbar interval}[]{\let\tikz@plot@handler=\pgfplothandlerxbarinterval}
+\tikzoption{xbar}[]{\let\tikz@plot@handler=\pgfplothandlerxbar}
+\tikzoption{const plot}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto}
+\tikzoption{const plot mark left}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto}
+\tikzoption{const plot mark right}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkright}
+\tikzoption{jump mark right}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkright}
+\tikzoption{jump mark left}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkleft}
\tikzoption{raw gnuplot}[true]{\csname tikz@plot@raw@gnuplot#1\endcsname}
\tikzoption{prefix}{\def\tikz@plot@prefix{#1}}
@@ -775,8 +933,20 @@
\tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard}
-\tikzoption{mark}{\def\tikz@plot@mark{#1}}
-\tikzoption{mark options}{\def\tikz@plot@mark@options{#1}}
+\tikzoption{mark}{%
+ \def\tikz@plot@mark{#1}%
+ \def\tikz@temp{none}%
+ \ifx\tikz@temp\tikz@plot@mark
+ \let\tikz@plot@mark=\pgfutil@empty
+ \fi
+}
+\tikzset{
+ no marks/.style={mark=none},%
+ no markers/.style={mark=none},%
+ every mark/.style={},
+ mark options/.style={%
+ every mark/.style={#1}%
+ }}
\tikzoption{mark size}{\pgfsetplotmarksize{#1}}
\tikzoption{mark indices}{\def\tikz@mark@list{#1}}
@@ -785,21 +955,19 @@
\let\tikz@mark@list=\pgfutil@empty
-\let\tikz@plot@mark@options=\pgfutil@empty
-
\let\tikz@plot@handler=\pgfplothandlerlineto
\let\tikz@plot@mark=\pgfutil@empty
\def\tikz@plot@samples{25}
\def\tikz@plot@domain{-5:5}
\def\tikz@plot@var{\x}
-\def\tikz@plot@samplesat{-5,-4.6,...,5}
+\def\tikz@plot@samplesat{-5,-4.5833333,...,5}
\def\tikz@plot@samples@recalc#1:#2\relax{%
\pgfmathparse{#1}%
\let\tikz@temp@start=\pgfmathresult%
\pgfmathparse{#2}%
\let\tikz@temp@end=\pgfmathresult%
- \pgfmathparse{\tikz@temp@start+(\tikz@temp@end-\tikz@temp@start)/\tikz@plot@samples}%
+ \pgfmathparse{\tikz@temp@start+(\tikz@temp@end-\tikz@temp@start)/(\tikz@plot@samples-1)}%
\edef\tikz@plot@samplesat{\tikz@temp@start,\pgfmathresult,...,\tikz@temp@end}%
}
@@ -817,6 +985,19 @@
\def\tikz@to@path{-- (\tikztotarget) \tikztonodes}
+% After command options
+\tikzset{
+ append after command/.code=\expandafter\def\expandafter\tikz@after@path\expandafter{\tikz@after@path#1},
+ prefix after command/.code={%
+ \def\tikz@temp{#1}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@after@path%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\tikz@temp\tikz@after@path}%
+ }
+}
+\let\tikz@after@path\pgfutil@empty
+
% Tree options
\newif\iftikz@child@missing
@@ -831,6 +1012,9 @@
\tikzoption{sibling distance}{\pgfmathsetlength\tikzsiblingdistance{#1}}
\tikzoption{growth function}{\let\tikz@grow=#1}
+
+\tikzset{grow siblings on line/.style={growth function=\tikz@grow@direction}}
+
\tikzoption{growth parent anchor}{\def\tikz@growth@anchor{#1}}
\tikzoption{grow}{\tikz@set@growth{#1}\edef\tikz@special@level{\the\tikztreelevel}}%
\tikzoption{grow'}{\tikz@set@growth{#1}\tikz@swap@growth\edef\tikz@special@level{\the\tikztreelevel}}%
@@ -1026,6 +1210,13 @@
\tikzstyle{dashed}= [dash pattern=on 3pt off 3pt]
\tikzstyle{densely dashed}= [dash pattern=on 3pt off 2pt]
\tikzstyle{loosely dashed}= [dash pattern=on 3pt off 6pt]
+\tikzstyle{dashdotted}= [dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt]
+\tikzstyle{densely dashdotted}= [dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt]
+\tikzstyle{loosely dashdotted}= [dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt]
+\tikzstyle{dashdotdotted}= [dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt]
+\tikzstyle{densely dashdotdotted}= [dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt on \the\pgflinewidth off 1pt]
+\tikzstyle{loosely dashdotdotted}= [dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt on \the\pgflinewidth off 4pt]
+
\tikzstyle{transparent}= [opacity=0]
\tikzstyle{ultra nearly transparent}=[opacity=0.05]
@@ -1105,6 +1296,7 @@
\let\tikz@atbegin@picture=\pgfutil@empty%
\let\tikz@atend@picture=\pgfutil@empty%
\let\tikz@transform=\relax%
+ \def\tikz@time{.5}%
\tikz@installcommands\scope[every picture,#1]%
\expandafter\tikz@atbegin@picture%
\tikz@lib@scope@check%
@@ -1112,9 +1304,13 @@
\def\endtikzpicture{%
\tikz@atend@picture%
\global\let\pgf@shift@baseline=\pgf@baseline%
+ \global\let\pgf@trimleft@final=\pgf@trimleft%
+ \global\let\pgf@trimright@final=\pgf@trimright%
\global\let\pgf@remember@smuggle=\ifpgfrememberpicturepositiononpage%
\endscope%
\let\pgf@baseline=\pgf@shift@baseline%
+ \let\pgf@trimleft=\pgf@trimleft@final%
+ \let\pgf@trimright=\pgf@trimright@final%
\let\ifpgfrememberpicturepositiononpage=\pgf@remember@smuggle%
\endpgfpicture}
@@ -1131,6 +1327,16 @@
% The rectangle \tikz{\draw (0,0) rectangle (1em,1ex)} has width 1em and
% height 1ex.
+% This code does not work for some inline \tikz. For example
+% \tikz\foreach \x in {1,...,10} \draw (\x,0) circle (0.4cm);
+% makes tikz crash.
+% Begin suspected code
+% \def\tikz{\pgfutil@ifnextchar[{\tikz@opt}{\tikz@opt[]}}
+% \def\tikz@opt[#1]{\tikzpicture[#1]\pgfutil@ifnextchar\bgroup{\tikz@}{\tikz@@}}
+% \def\tikz@{\bgroup\tikz@auto@end@pathtrue\aftergroup\endtikzpicture\let\pgf@temp=}
+% \def\tikz@@{\begingroup\def\tikz@path@do@at@end{\endgroup\endtikzpicture}}
+% End suspected code
+% Begin old code
\def\tikz{\pgfutil@ifnextchar[{\tikz@opt}{\tikz@opt[]}}
\def\tikz@opt[#1]{\tikzpicture[#1]\pgfutil@ifnextchar\bgroup{\tikz@}{\tikz@@}}
\def\tikz@#1{#1\endtikzpicture}
@@ -1145,8 +1351,14 @@
\catcode`\;=\active
\gdef\tikz@collectactivesemicolon#1;{#1;\endtikzpicture}
}
+% End old code
-
+% Invokes '#1' if the command is invoked withing a tikzpicture and
+% '#2' if not.
+\def\tikzifinpicture#1#2{%
+ \pgfutil@ifundefined{filldraw}{#2}{#1}% TT: This is a wrong
+ % test! Who uses this?...
+}%
%
% Environment for scoping graphic state settings
@@ -1174,6 +1386,28 @@
\tikz@lib@scope@check%
}
+% Install a shortcut command which is only valid inside of a
+% tikzpicture.
+%
+% It works in the same way as the '\path' shortcut does: it introduces
+% a \let#1=#2 at the beginning of tikzpicture.
+%
+% #1: shortcut command inside of tikzpicture
+% #2: real command name
+\def\tikzaddtikzonlycommandshortcutlet#1#2{%
+ \expandafter\def\expandafter\tikz@installcommands\expandafter{\tikz@installcommands
+ \let#1=#2
+ }%
+}%
+
+% Has the same effect as \tikzaddtikzonlycommandshortcutlet but uses
+% \def#1{#2} instead of \let.
+\def\tikzaddtikzonlycommandshortcutdef#1#2{%
+ \expandafter\def\expandafter\tikz@installcommands\expandafter{\tikz@installcommands
+ \def#1{#2}%
+ }%
+}%
+
%
% Install the abbreviated commands
%
@@ -1199,6 +1433,8 @@
\let\tikz@origcoordinate=\coordinate%
\let\tikz@origmatrix=\matrix%
\let\tikz@origcalendar=\calendar%
+ \let\tikz@origdv=\datavisualization%
+ \let\tikz@origgraph=\graph%
%
\tikz@deactivatthings%
%
@@ -1216,14 +1452,19 @@
\def\shade{\path[shade]}
\def\shadedraw{\path[shade,draw]}
\def\clip{\path[clip]}
+ \def\graph{\path graph}
\def\useasboundingbox{\path[use as bounding box]}
\def\node{\tikz@path@overlay{node}}
\def\coordinate{\tikz@path@overlay{coordinate}}
\def\matrix{\tikz@path@overlay{node[matrix]}}
- \def\calendar{\tikz@lib@cal@calendar}%
+ \def\calendar{\tikz@lib@cal@calendar}%
+ \def\datavisualization{\tikz@lib@datavisualization}%
}
\ifx\tikz@lib@cal@calendar\@undefined
-\def\tikz@lib@cal@calendar{\PackageError{tikz}{You need to load the calendar library}{}}
+\def\tikz@lib@cal@calendar{\PackageError{tikz}{You need to say \string\usetikzlibrary{calendar} to use the \string\calendar{} command}{}}
+\fi
+\ifx\tikz@lib@datavisualization\@undefined
+\def\tikz@lib@datavisualization{\PackageError{tikz}{You need to say \string\usetikzlibrary{datavisualization} to use the \string\datavisualization{} command}{}}
\fi
\def\tikz@path@overlay#1{%
@@ -1253,6 +1494,8 @@
\let\coordinate=\tikz@origcoordinate%
\let\matrix=\tikz@origmatrix%
\let\calendar=\tikz@origcalendar%
+ \let\datavisualization=\tikz@origdv%
+ \let\graph=\tikz@origgraph%
}
@@ -1263,18 +1506,23 @@
\gdef\tikz@nonactivecolon{:}
\catcode`\|=12
\gdef\tikz@nonactivebar{|}
+ \catcode`\!=12
+ \gdef\tikz@nonactiveexlmark{!}
\catcode`\;=\active
\catcode`\:=\active
\catcode`\|=\active
\catcode`\"=\active
+ \catcode`\!=\active
\gdef\tikz@activesemicolon{;}%
\gdef\tikz@activecolon{:}%
\gdef\tikz@activebar{|}%
\gdef\tikz@activequotes{"}%
+ \gdef\tikz@activeexlmark{!}%
\gdef\tikz@deactivatthings{%
- \def;{\tikz@nonactivesemicolon}
- \def:{\tikz@nonactivecolon}
- \def|{\tikz@nonactivebar}
+ \def;{\tikz@nonactivesemicolon}%
+ \def:{\tikz@nonactivecolon}%
+ \def|{\tikz@nonactivebar}%
+ \def!{\tikz@nonactiveexlmark}%
}
}
@@ -1300,15 +1548,16 @@
\let\tikz@next=\tikz@eargactivesemicolon%
\fi%
\tikz@next}
-\long\def\tikz@eargnormalsemicolon<#1>#2;{\only<#1>{\tikz@@command@path#2;}}
+\long\def\tikz@eargnormalsemicolon<#1>#2;{\alt<#1>{\tikz@@command@path#2;}{\tikz@path@do@at@end}}
{
\catcode`\;=\active
- \long\global\def\tikz@eargactivesemicolon<#1>#2;{\only<#1>{\tikz@@command@path#2;}}
+ \long\global\def\tikz@eargactivesemicolon<#1>#2;{\alt<#1>{\tikz@@command@path#2;}{\tikz@path@do@at@end}}
}
\def\tikz@@command@path{%
\edef\tikzscope@linewidth{\the\pgflinewidth}%
\begingroup%
+ \let\tikz@path@do@at@end=\tikz@lib@scope@check%
\let\tikz@options=\pgfutil@empty%
\let\tikz@mode=\pgfutil@empty%
\let\tikz@moveto@waiting=\relax%
@@ -1319,7 +1568,7 @@
\tikz@snakedfalse%
\tikz@decoratepathfalse%
\tikz@node@is@a@labelfalse%
- \tikz@expandcount=1000\relax%
+ \tikz@expandcount=100\relax%
\tikz@lastx=0pt%
\tikz@lasty=0pt%
\tikz@lastxsaved=0pt%
@@ -1396,10 +1645,10 @@
\let\@next=\tikz@e@char%
\else%
\ifx\@let@token g%
- \let\@next=\tikz@grid%
+ \let\@next=\tikz@g@char%
\else%
\ifx\@let@token s%
- \let\@next=\tikz@sine%
+ \let\@next=\tikz@schar%
\else%
\ifx\@let@token |%
\let\@next=\tikz@vh@lineto%
@@ -1427,7 +1676,7 @@
\let\@next=\tikz@decoration%
\else%
\ifx\@let@token l%
- \let\@next=\tikz@let@command%
+ \let\@next=\tikz@l@char%\tikz@let@command%
\else%
\let\@next=\tikz@expand%
\fi%
@@ -1446,6 +1695,24 @@
\@next%
}
+\def\tikz@l@char{%
+ \pgfutil@ifnextchar e{\tikz@let@command}{%
+ \pgfutil@ifnextchar i{\tikz@lsystem}{%
+ \pgfutil@ifnextchar-{\tikz@@lsystem}{\tikz@expand}%
+ }%
+ }%
+}
+
+\def\tikz@lsystem{%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{lindenmayersystems} to
+ draw Lindenmayer systems}{}
+}
+
+\def\tikz@@lsystem{%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{lindenmayersystems} to
+ draw L-systems}{}
+}
+
\def\tikz@pchar{\pgfutil@ifnextchar l{\tikz@plot}{\tikz@parabola}}
\def\tikz@cchar{%
\pgfutil@ifnextchar i{\tikz@circle}%
@@ -1457,6 +1724,18 @@
\def\tikz@@e@char dge{%
\pgfutil@ifnextchar f{\tikz@edgetoparent}{\tikz@edge@plain}}%
+\def\tikz@schar{\pgfutil@ifnextchar i{\tikz@sine}{\tikz@svg@path}}
+
+\def\tikz@g@char r{\pgfutil@ifnextchar i{\tikz@grid}{\tikz@graph}}
+
+% svg syntax
+% svg[options] "..."
+
+\def\tikz@svg@path{%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{svg.path} to
+ use the svg path command}{}
+}
+
\def\tikz@finish{%
% Rendering pipeline
@@ -1480,6 +1759,7 @@
%
% Reset modes
%
+ \let\tikz@path@picture=\pgfutil@empty%
\tikz@mode@fillfalse%
\tikz@mode@drawfalse%
\tikz@mode@doublefalse%
@@ -1525,7 +1805,7 @@
\tikz@options%
\fi%
%
- % Step 4: Do a fill if shade follows.
+ % Step 4: Do a fill if shade or a path picture follows.
%
\iftikz@mode@fill%
\iftikz@mode@shade%
@@ -1535,6 +1815,16 @@
\pgfsyssoftpath@invokecurrentpath%
\pgfsys@fill%
\tikz@mode@fillfalse% no more filling...
+ \else%
+ \ifx\tikz@path@picture\pgfutil@empty%
+ \else%
+ \pgfsyssoftpath@getcurrentpath\tikz@temppath
+ \pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
+ \pgfsyssoftpath@setcurrentpath\tikz@temppath%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@fill%
+ \tikz@mode@fillfalse% no more filling...
+ \fi%
\fi%
\fi%
%
@@ -1548,6 +1838,34 @@
\tikz@mode@shadefalse% no more shading...
\fi%
%
+ % Step 5a: Do a path picture if necessary.
+ %
+ \ifx\tikz@path@picture\pgfutil@empty%
+ \else%
+ \begingroup%
+ \pgfsys@beginscope%
+ \pgfsyssoftpath@getcurrentpath\tikz@temppath
+ \pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
+ \pgfsyssoftpath@setcurrentpath\tikz@temppath%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@clipnext%
+ \pgfsys@discardpath%
+ \pgf@relevantforpicturesizefalse%
+ \expandafter\def\csname pgf@sh@ns@path picture bounding box\endcsname{rectangle}
+ \expandafter\edef\csname pgf@sh@np@path picture bounding box\endcsname{%
+ \def\noexpand\southwest{\noexpand\pgfqpoint{\the\pgf@pathminx}{\the\pgf@pathminy}}%
+ \def\noexpand\northeast{\noexpand\pgfqpoint{\the\pgf@pathmaxx}{\the\pgf@pathmaxy}}%
+ }
+ \expandafter\def\csname pgf@sh@nt@path picture bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}}
+ \expandafter\def\csname pgf@sh@pi@path picture bounding box\endcsname{\pgfpictureid}
+ \pgfinterruptpath%
+ \tikz@path@picture%
+ \endpgfinterruptpath%
+ \pgfsys@endscope%
+ \endgroup%
+ \let\tikz@path@picture=\pgfutil@empty%
+ \fi%
+ %
% Step 6: Double stroke, if necessary
%
\iftikz@mode@draw%
@@ -1555,10 +1873,7 @@
% Change line width
\begingroup%
\pgfsys@beginscope%
- \pgf@x=2\pgflinewidth%
- \advance\pgf@x by\tikz@double@width@distance%
- \pgflinewidth=\pgf@x%
- \pgfsetlinewidth{\the\pgflinewidth}%
+ \tikz@double@setup%
\fi%
\fi%
%
@@ -1576,16 +1891,7 @@
%
\iftikz@mode@draw%
\iftikz@mode@double%
- \pgfsyssoftpath@setcurrentpath\pgf@last@used@path% reinstall
- \pgf@x=\tikz@double@width@distance%
- \pgfsetlinewidth{\the\pgf@x}%
- \pgfsetstrokecolor{\tikz@double@color}%
- \pgfsyssoftpath@flushcurrentpath%
- \pgfsys@stroke%
\pgfsys@endscope%
- \ifpgf@drawarrows% set in pgfusepath...
- \pgf@add@arrows@as@needed%
- \fi%
\endgroup%
\fi%
\fi%
@@ -1617,16 +1923,17 @@
\fi%
\endgroup%
\global\pgflinewidth=\tikzscope@linewidth%
- \tikz@lib@scope@check%
+ \tikz@path@do@at@end%
}
\let\tikz@lib@scope@check\pgfutil@empty% this is a hook for the scopes library
+\def\tikz@path@do@at@end{\tikz@lib@scope@check}
% Extra actions
\def\tikz@extra@preaction#1{%
{%
\pgfsys@beginscope%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\path[#1];% do extra path
\pgfsyssoftpath@setcurrentpath\tikz@actions@path% restore
\tikz@restorepathsize%
@@ -1637,7 +1944,7 @@
\def\tikz@extra@postaction#1{%
{%
\pgfsys@beginscope%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\tikz@restorepathsize%
\path[#1]\pgfextra{\pgfsyssoftpath@setcurrentpath\tikz@actions@path};% do extra path
\pgf@resetpathsizes%
@@ -1666,22 +1973,36 @@
% Syntax for scopes:
% {scoped path commands}
-\def\tikz@beginscope{\begingroup\tikz@scan@next@command}
+\newif\iftikz@auto@end@path
+
+\def\tikz@beginscope{\begingroup\tikz@auto@end@pathfalse\tikz@scan@next@command}
\def\tikz@endscope{%
+ \iftikz@auto@end@path\expandafter\tikz@finish\expandafter\egroup\else\expandafter\tikz@@endscope\fi%
+}
+\def\tikz@@endscope{%
\global\setbox\tikz@tempbox=\box\tikz@figbox%
- \xdef\tikz@scope@save@lastx{\the\tikz@lastx}%
- \xdef\tikz@scope@save@lasty{\the\tikz@lasty}%
- \iftikz@current@point@local%
- \endgroup%
- \else%
- \xdef\tikz@scope@save@lastxsaved{\the\tikz@lastxsaved}%
- \xdef\tikz@scope@save@lastysaved{\the\tikz@lastysaved}%
- \endgroup%
- \tikz@lastxsaved=\tikz@scope@save@lastxsaved%
- \tikz@lastysaved=\tikz@scope@save@lastysaved%
- \fi%
- \tikz@lastx=\tikz@scope@save@lastx%
- \tikz@lasty=\tikz@scope@save@lasty%
+ \edef\tikz@marshal{%
+ \tikz@lastx=\the\tikz@lastx%
+ \tikz@lasty=\the\tikz@lasty%
+ \iftikz@current@point@local%
+ \else%
+ \tikz@lastxsaved=\the\tikz@lastxsaved%
+ \tikz@lastysaved=\the\tikz@lastysaved%
+ \ifx\tikz@moveto@waiting\relax%
+ \let\tikz@moveto@waiting\relax%
+ \else%
+ \def\noexpand\tikz@moveto@waiting{\tikz@moveto@waiting}%
+ \fi%
+ \iftikz@shapeborder%
+ \noexpand\tikz@shapebordertrue%
+ \def\noexpand\tikz@shapeborder@name{\tikz@shapeborder@name}%
+ \else%
+ \noexpand\tikz@shapeborderfalse%
+ \fi%
+ \fi%
+ }%
+ \expandafter%
+ \endgroup\tikz@marshal%
\setbox\tikz@figbox=\box\tikz@tempbox%
\tikz@scan@next@command}
@@ -1705,7 +2026,12 @@
% \draw (0,0) \foreach \x in {1,2,3} {-- (\x,0) circle (1cm)} -- (5,5);
\def\tikz@foreach{%
- \def\pgffor@beginhook{\setbox\tikz@figbox=\box\tikz@tempbox\expandafter\tikz@scan@next@command\pgfutil@firstofone}%
+ \def\pgffor@beginhook{%
+ \tikz@lastx=\tikz@foreach@save@lastx%
+ \tikz@lasty=\tikz@foreach@save@lasty%
+ \tikz@lastxsaved=\tikz@foreach@save@lastxsaved%
+ \tikz@lastysaved=\tikz@foreach@save@lastysaved%
+ \setbox\tikz@figbox=\box\tikz@tempbox\expandafter\tikz@scan@next@command\pgfutil@firstofone}%
\def\pgffor@endhook{\pgfextra{%
\xdef\tikz@foreach@save@lastx{\the\tikz@lastx}%
\xdef\tikz@foreach@save@lasty{\the\tikz@lasty}%
@@ -1719,6 +2045,10 @@
\tikz@lastysaved=\tikz@foreach@save@lastysaved%
\setbox\tikz@figbox=\box\tikz@tempbox\tikz@scan@next@command}%
\global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \xdef\tikz@foreach@save@lastx{\the\tikz@lastx}%
+ \xdef\tikz@foreach@save@lasty{\the\tikz@lasty}%
+ \xdef\tikz@foreach@save@lastxsaved{\the\tikz@lastxsaved}%
+ \xdef\tikz@foreach@save@lastysaved{\the\tikz@lastysaved}%
\foreach}
@@ -1987,17 +2317,15 @@
% [options]
\def\tikz@parse@options#1]{%
\tikzset{#1}%
- \tikz@lib@dec@hook% for decorations...
\tikz@scan@next@command%
}
-\let\tikz@lib@dec@hook=\relax
% Syntax for edges:
% edge [options] (coordinate)
% edge [options] node {node text} (coordinate)
\def\tikz@edge@plain{%
\begingroup%
- \tikz@to@use@whom%
+ \ifx\tikz@to@use@whom\pgfutil@undefined\else\tikz@to@use@whom\fi
\let\tikz@to@or@edge@function=\tikz@do@edge%
\tikz@to@or@edge}
@@ -2016,11 +2344,12 @@
\tikz@@to@collect%
}
\def\tikz@@to@collect{%
- \pgfutil@ifnextchar(\tikz@@to@or@edge@coordinate
+ \pgfutil@ifnextchar(\tikz@@to@or@edge@coordinate%)
{\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@@to@collect}%
- {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@to@collect}
- {\PackageError{tikz}{( expected}{}%}
- \tikz@@to@or@edge@coordinate()}}}%
+ {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@@to@collect}%
+ {\pgfutil@ifnextchar +{\tikz@scan@one@point\tikz@@to@or@edge@math}%
+ {\PackageError{tikz}{(, +, coordinate, or node expected}{}%)
+ \tikz@@to@or@edge@coordinate()}}}}%
}
\def\tikz@@to@or@edge@coordinate({%
@@ -2061,8 +2390,10 @@
\tikz@options%
\tikz@transform%
% Typeset node:
+ \let\tikz@after@path\pgfutil@empty%
\tikz@atbegin@to%
- \path[style=every edge]\tikz@@to@local@options(\tikztostart)\tikz@to@path;%
+ \path[style=every edge]\tikz@@to@local@options(\tikztostart)\tikz@to@path
+ \pgfextra{\global\let\tikz@after@path@smuggle=\tikz@after@path};%
\tikz@atend@to%
\endpgfscope%
\endpgfinterruptpath%
@@ -2072,7 +2403,7 @@
\global\setbox\tikz@tempbox=\copy\tikz@figbox%
\endgroup%
\setbox\tikz@figbox=\box\tikz@tempbox%
- \tikz@scan@next@command%
+ \expandafter\tikz@scan@next@command\tikz@after@path%
}
\def\tikz@do@to{%
@@ -2080,9 +2411,14 @@
\def\tikztonodes{{\pgfextra{\tikz@node@is@a@labeltrue}\tikz@tonodes}}%
\let\tikz@collected@onpath=\pgfutil@empty%
\tikz@scan@next@command%
- \pgfextra{\tikz@atbegin@to}%
- [style=every to]\tikz@@to@local@options\tikz@to@path%
- \pgfextra{\tikz@atend@to}%
+ {%
+ \pgfextra{\let\tikz@after@path\pgfutil@empty}%
+ \pgfextra{\tikz@atbegin@to}%
+ [style=every to]\tikz@@to@local@options\tikz@to@path%
+ \pgfextra{\tikz@atend@to}%
+ \pgf@stop%
+ \expandafter\tikz@scan@next@command\expandafter%
+ }\tikz@after@path%
}
@@ -2099,6 +2435,26 @@
+% Syntax for graph path command:
+% graph {...}
+% See the graph library for details
+
+\def\tikz@graph aph{\tikz@lib@graph@parser}
+
+\def\tikz@lib@graph@parser{\pgfutil@ifnextchar[\tikz@graph@error{\tikz@graph@error[]}}%]
+\def\tikz@graph@error[#1]#2{%
+ \PackageError{tikz}{You need to say \string\usetikzlibrary{graph} in
+ order to use the graph syntax}{}%
+ \tikz@lib@graph@parser@done%
+}
+
+\def\tikz@lib@graph@parser@done{%
+ \tikz@scan@next@command%
+}
+
+
+
+
% Syntax for edge from parent:
% edge from parent [options]
\def\tikz@edgetoparent from parent{\pgfutil@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%}
@@ -2236,7 +2592,7 @@
% Syntax for grids:
% grid <corner point>
-\def\tikz@grid rid{%
+\def\tikz@grid id{%
\tikz@flush@moveto%
\pgf@xa=\tikz@lastx\relax%
\pgf@ya=\tikz@lasty\relax%
@@ -2247,6 +2603,7 @@
\def\tikz@gridB#1{%
\tikz@make@last@position{#1}%
{%
+ \let\tikz@after@path\pgfutil@empty%
\expandafter\tikzset\expandafter{\tikz@grid@options}
\tikz@checkunit{\tikz@grid@x}%
\iftikz@isdimension%
@@ -2266,8 +2623,8 @@
\advance\pgf@yb by\pgf@y%
\pgfpathgrid[stepx=\pgf@xb,stepy=\pgf@yb]%
{\pgfqpoint{\pgf@xa}{\pgf@ya}}{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
- }
- \tikz@scan@next@command%
+ \expandafter}%
+ \expandafter\tikz@scan@next@command\tikz@after@path%
}
@@ -2280,6 +2637,7 @@
\pgfutil@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%}
\def\tikz@@plot[#1]{%
\begingroup%
+ \let\tikz@after@path\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
\tikzset{every plot/.try}%
\tikzset{#1}%
@@ -2349,7 +2707,7 @@
\pgfscope%
\let\tikz@options=\pgfutil@empty%
\let\tikz@transform=\pgfutil@empty%
- \expandafter\tikzset\expandafter{\tikz@plot@mark@options}%
+ \tikzset{every mark}%
\tikz@options%
\ifx\tikz@mark@list\pgfutil@empty%
\pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}%
@@ -2363,17 +2721,18 @@
}%
\fi%
\global\setbox\tikz@tempbox=\copy\tikz@figbox%
+ \global\let\tikz@after@path@smuggle=\tikz@after@path
\endgroup%
\setbox\tikz@figbox=\box\tikz@tempbox%
\tikz@make@last@position{\tikz@@@temp}%
- \tikz@scan@next@command%
+ \expandafter\tikz@scan@next@command\tikz@after@path@smuggle%
}
\pgfdeclareplotmark{ball}
{%
\def\tikz@shading{ball}%
- \shade (0,0) circle (\pgfplotmarksize);%
+ \shade (0pt,0pt) circle (\pgfplotmarksize);%
}
@@ -2439,6 +2798,7 @@
\pgf@xc=\tikz@lastx%
\pgf@yc=\tikz@lasty%
\begingroup% now calculate bend:
+ \let\tikz@after@path\pgfutil@empty%
\expandafter\tikzset\expandafter{\tikz@parabola@option}%
\tikz@lastxsaved=\tikz@parabola@bend@factor\tikz@lastx%
\tikz@lastysaved=\tikz@parabola@bend@factor\tikz@lasty%
@@ -2454,51 +2814,73 @@
\advance\tikz@lastx by-\pgf@xb%
\advance\tikz@lasty by-\pgf@yb%
\xdef\tikz@parabola@b{{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}}%
- \endgroup%
- \expandafter\pgfpathparabola\tikz@parabola@b%
- \tikz@scan@next@command%
+ \expandafter\endgroup%
+ \expandafter\expandafter\expandafter\pgfpathparabola\expandafter\tikz@parabola@b%
+ \expandafter\tikz@scan@next@command\tikz@after@path%
}
% Syntax for circles:
-% circle (radius)
+% circle [options] % where options should set, at least, radius
+% circle (radius) % deprecated
%
% Syntax for ellipses:
-% ellipse (x-radius and y-radius)
+% ellipse [options] % identical to circle.
+% ellipse (x-radius and y-radius) % deprecated
%
% radii can be dimensionless, then they are in the xy-system
\def\tikz@circle ircle{\tikz@flush@moveto\tikz@@circle}
\def\tikz@ellipse llipse{\tikz@flush@moveto\tikz@@circle}
\def\tikz@@circle{%
- \pgfutil@ifnextchar(\tikz@@@circle{%)
- \advance\tikz@expandcount by -1%
+ \pgfutil@ifnextchar(\tikz@@@circle
+ {\pgfutil@ifnextchar[\tikz@circle@opt{%])
+ \advance\tikz@expandcount by -10\relax% go down quickly
\ifnum\tikz@expandcount<0\relax%
- \let\@next=\tikz@@circle@scangiveup%
+ \let\@next=\tikz@@circle@normal%
\else%
\let\@next=\tikz@@circle@scanexpand%
\fi%
\@next%
- }%
+ }}%
}
\def\tikz@@circle@scanexpand{\expandafter\tikz@@circle}
-\def\tikz@@circle@scangiveup#1{\PackageError{tikz}{Cannot parse this radius}{}#1{\tikz@scan@next@command}}
+\def\tikz@@circle@normal{\tikz@circle@opt[]}
+
+\def\tikz@circle@opt[#1]{%
+ {%
+ \def\tikz@node@at{\tikz@last@position}%
+ \let\tikz@transform=\pgfutil@empty%
+ \tikzset{every circle/.try,#1}%
+ \pgftransformshift{\tikz@node@at}%
+ \tikz@transform%
+ \tikz@do@circle{\pgfkeysvalueof{/tikz/x radius}}{\pgfkeysvalueof{/tikz/y radius}}
+ }%
+ \tikz@scan@next@command%
+}
+
\def\tikz@@@circle(#1){%
- \pgfutil@in@{ and }{#1}%
- \ifpgfutil@in@%
- \tikz@@ellipseB(#1)%
- \else%
- \tikz@@ellipseB({#1} and {#1})%
- \fi%
+ {%
+ \pgftransformshift{\tikz@last@position}%
+ \pgfutil@in@{ and }{#1}%
+ \ifpgfutil@in@%
+ \tikz@@ellipseB(#1)%
+ \else%
+ \tikz@do@circle{#1}{#1}%
+ \fi%
+ }%
\tikz@scan@next@command%
}
\def\tikz@@ellipseB(#1 and #2){%
+ \tikz@do@circle{#1}{#2}
+}
+\def\tikz@do@circle#1#2{
\pgfmathparse{#1}%
\let\tikz@ellipse@x=\pgfmathresult%
\ifpgfmathunitsdeclared%
\pgfmathparse{#2}%
\let\tikz@ellipse@y=\pgfmathresult%
\ifpgfmathunitsdeclared%
- \pgfpathellipse{\tikz@last@position}{%
+ \pgfpathellipse{\pgfpointorigin}{%
\pgfqpoint{\tikz@ellipse@x pt}{0pt}}{\pgfpoint{0pt}{\tikz@ellipse@y pt}}%
\else%
\PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}%
@@ -2509,7 +2891,7 @@
\ifpgfmathunitsdeclared%
\PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}%
\else%
- \pgfpathellipse{\tikz@last@position}{%
+ \pgfpathellipse{\pgfpointorigin}{%
\pgfpointxy{\tikz@ellipse@x}{0}}{\pgfpointxy{0}{\tikz@ellipse@y}}%
\fi%
\fi%
@@ -2522,13 +2904,50 @@
% arc (start angle:end angle:x-radius and y-radius)
%
% radius can be dimensionless, then the arc is in the xy-coordinate system
-\def\tikz@arcA rc{%
- \tikz@flush@moveto%
- \pgfutil@ifnextchar({\tikz@@arcto}{\expandafter\tikz@arcA\expandafter r\expandafter c}}
+\def\tikz@arcA rc{\tikz@flush@moveto\tikz@arc@cont}%
+\def\tikz@arc@cont{%
+ \pgfutil@ifnextchar(%)
+ {\tikz@@arcto}{%
+ \pgfutil@ifnextchar[%]
+ {\tikz@arc@opt}%
+ {%
+ \advance\tikz@expandcount by -10\relax% go down quickly
+ \ifnum\tikz@expandcount<0\relax%
+ \let\@next=\tikz@@arc@normal%
+ \else%
+ \let\@next=\tikz@@arc@scanexpand%
+ \fi%
+ \@next%
+ }%
+ }%
+}
+\def\tikz@@arc@scanexpand{\expandafter\tikz@arc@cont}
+\def\tikz@@arc@normal{\tikz@arc@opt[]}
+
+
+\def\tikz@arc@opt[#1]{%
+ {%
+ \tikzset{every arc/.try,#1}%
+ \pgfkeysgetvalue{/tikz/start angle}\tikz@s
+ \pgfkeysgetvalue{/tikz/end angle}\tikz@e
+ \pgfkeysgetvalue{/tikz/delta angle}\tikz@d
+ \ifx\tikz@s\pgfutil@empty%
+ \pgfmathsetmacro\tikz@s{\tikz@e-\tikz@d}
+ \else
+ \ifx\tikz@e\pgfutil@empty%
+ \pgfmathsetmacro\tikz@e{\tikz@s+\tikz@d}
+ \fi%
+ \fi
+ \tikz@do@arc{\tikz@s}{\tikz@e}
+ {\pgfkeysvalueof{/tikz/x radius}}
+ {\pgfkeysvalueof{/tikz/y radius}}
+ }%
+ \tikz@arcfinal%
+}
\def\tikz@@arcto(#1){%
\edef\tikz@temp{(#1)}%
- \expandafter\tikz@@@arcto@check@slashand\tikz@temp%
+ \expandafter\tikz@@@arcto@check@slashand\tikz@temp%
}
\def\tikz@@@arcto@check@slashand(#1:#2:#3){%
@@ -2538,9 +2957,13 @@
\else%
\tikz@parse@arc@and(#1:#2:{#3} and {#3})%
\fi%
+ \tikz@arcfinal%
}
\def\tikz@parse@arc@and(#1:#2:#3 and #4){%
+ \tikz@do@arc{#1}{#2}{#3}{#4}%
+}
+\def\tikz@do@arc#1#2#3#4{%
\pgfmathparse{#3}%
\let\tikz@arc@x=\pgfmathresult%
\ifpgfmathunitsdeclared%
@@ -2567,10 +2990,17 @@
\def\tikz@@@arcfinal#1#2#3{%
#1%
- \pgf@process{#2}%
+ \pgf@process{#2}
+ \xdef\tikz@arc@save@first{\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgf@process{#3}
+ \xdef\tikz@arc@save@second{\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+}
+
+\def\tikz@arcfinal{%
+ \pgf@process{\tikz@arc@save@first}%
\advance\tikz@lastx by-\pgf@x%
\advance\tikz@lasty by-\pgf@y%
- \pgf@process{#3}%
+ \pgf@process{\tikz@arc@save@second}%
\advance\tikz@lastx by\pgf@x%
\advance\tikz@lasty by\pgf@y%
\tikz@lastxsaved=\tikz@lastx%
@@ -2590,7 +3020,11 @@
\def\tikz@@coordinate[#1](#2){%
\pgfutil@ifnextchar a{\tikz@@coordinate@at[#1](#2)}
{\tikz@fig ode[shape=coordinate,#1](#2){}}}
-\def\tikz@@coordinate@at[#1](#2)at#3({%
+\def\tikz@@coordinate@at[#1](#2)a{%
+ \pgfutil@ifnextchar t{\tikz@@coordinate@@at[#1](#2)a}%
+ {\tikz@fig ode[shape=coordinate,#1](#2){}a}%
+}
+\def\tikz@@coordinate@@at[#1](#2)at#3({%
\def\tikz@coordinate@caller{\tikz@fig ode[shape=coordinate,#1](#2)at}%
\tikz@scan@one@point\tikz@@coordinate@at@math(%
}
@@ -2617,9 +3051,9 @@
\begingroup%
\tikz@is@matrixfalse%
\let\nodepart=\tikz@nodepart%
+ \let\tikz@do@after@node=\tikz@scan@next@command%
\let\tikz@options=\pgfutil@empty%
- \let\tikz@after@node=\pgfutil@empty%
- \let\tikz@afternodepathoptions=\pgfutil@empty%
+ \let\tikz@after@path=\pgfutil@empty%
\let\tikz@transform=\pgfutil@empty%
\let\tikz@mode=\pgfutil@empty%
\tikz@decoratepathfalse%
@@ -2645,8 +3079,11 @@
\tikz@scan@one@point\tikz@@fig@scan@at}
\def\tikz@@fig@scan@at#1{%
\def\tikz@node@at{#1}\tikz@@scan@fig}%
-\def\tikz@fig@scan@name(#1){\edef\tikz@fig@name{#1}\tikz@@scan@fig}%
-\def\tikz@fig@scan@options[#1]{\tikzset{#1}\tikz@@scan@fig}%
+\def\tikz@fig@scan@name(#1){%
+ \pgfkeysvalueof{/tikz/name/.@cmd}#1\pgfeov% CF : this is now ALWAYS consistent with 'name=' option; allows overrides.
+ \tikz@@scan@fig}%
+% make it \long to allow \par in "pin" options etc:
+\long\def\tikz@fig@scan@options[#1]{\tikzset{#1}\tikz@@scan@fig}%
\let\tikz@node@reset@hook=\pgfutil@empty%
\let\tikz@node@begin@hook=\pgfutil@empty%
\def\tikz@fig@main{\afterassignment\tikz@@fig@main\let\next=}
@@ -2679,7 +3116,8 @@
\ifx\tikz@text@width\pgfutil@empty%
\else%
\begingroup%
- \pgfutil@minipage[t]{\tikz@text@width}%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@width}%
+ \pgfutil@minipage[t]{\pgf@x}\leavevmode\hbox{}%
\tikz@text@action%
\fi%
\tikz@atbegin@node%
@@ -2690,9 +3128,10 @@
\pgfutil@colorlet{.}{\tikz@textcolor}%
\fi%
\pgfsetcolor{.}%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\tikz@uninstallcommands%
\aftergroup\tikz@fig@collectresetcolor%
+ \tikz@halign@check%
\ignorespaces%
}
\def\tikz@fig@collectresetcolor{%
@@ -2713,7 +3152,7 @@
{\pgfutil@ifnextchar[{\tikz@fig@mustbenamed\tikz@fig@continue}%
{\pgfutil@ifnextchar t{\tikz@fig@mustbenamed\tikz@fig@continue}
{\pgfutil@ifnextchar e{\tikz@fig@mustbenamed\tikz@fig@continue}
- {\ifx\tikz@after@node\pgfutil@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\expandafter\tikz@fig@continue\fi}}}}}%}
+ {\ifx\tikz@after@path\pgfutil@empty\expandafter\tikz@fig@continue\else\expandafter\tikz@fig@mustbenamed\expandafter\tikz@fig@continue\fi}}}}}%}
\def\tikz@do@matrix{%
\tikzset{every matrix/.try}%
@@ -2726,7 +3165,7 @@
\pgfinterruptpath%
\pgfscope%
\tikz@options%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\let\tikzmatrixname=\tikz@fig@name%
\edef\tikz@m@anchor{\ifx\tikz@matrix@anchor\pgfutil@empty\tikz@anchor\else\tikz@matrix@anchor\fi}%
\expandafter\pgfutil@in@\expandafter{\expandafter.\expandafter}\expandafter{\tikz@m@anchor}%
@@ -2840,7 +3279,7 @@
\pgfinterruptpath%
\pgfscope%
\tikz@options%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{%
\pgfutil@tempdima=\pgflinewidth%
{\begingroup\tikz@finish}%
@@ -2884,8 +3323,7 @@
\def\tikz@node@finish{%
\global\let\tikz@last@fig@name=\tikz@fig@name%
- \global\let\tikz@after@node@smuggle=\tikz@after@node%
- \global\let\tikz@afternodepathoptions@smuggle=\tikz@afternodepathoptions%
+ \global\let\tikz@after@path@smuggle=\tikz@after@path%
% shift box outside group
\global\setbox\tikz@tempbox=\copy\tikz@figbox%
\endgroup\endgroup%
@@ -2894,23 +3332,83 @@
\let\tikz@to@last@fig@name=\tikz@last@fig@name%
\let\tikz@to@use@whom=\tikz@to@use@last@fig@name%
\let\tikzlastnode=\tikz@last@fig@name%
- \ifx\tikz@after@node@smuggle\pgfutil@empty%
+ \ifx\tikz@after@path@smuggle\pgfutil@empty%
\else%
- \tikz@scan@next@command{\pgfextra{\tikz@afternodepathoptions@smuggle}\tikz@after@node@smuggle}\pgf@stop%
+ \tikz@scan@next@command{\tikz@after@path@smuggle}\pgf@stop%
\fi%
- \tikz@scan@next@command%
+ \tikz@do@after@node%
}
\let\tikz@fig@continue@orig=\tikz@fig@continue
+\def\tikz@do@after@node{\tikz@scan@next@command}
+
+\newif\iftikz@do@align
+
+% Alignment handling
+\def\tikz@halign@check{%
+ \tikz@do@alignfalse
+ \ifx\tikz@text@width\pgfutil@empty%
+ \pgfkeysgetvalue{/tikz/node halign header}\tikz@align@header%
+ \ifx\tikz@align@header\pgfutil@empty%
+ \else%
+ \tikz@do@aligntrue%
+ \fi%
+ \fi%
+ \iftikz@do@align%
+ % Bingo
+ \setbox\tikz@align@aligned@box=\box\pgfutil@voidb@x% void
+ \let\\=\tikz@align@newline%
+ \expandafter\tikz@start@align%
+ \fi%
+}
+\def\tikz@align@newline{\unskip\pgfutil@ifnextchar[\tikz@@align@newline{\tikz@@align@newline[0pt]}}%}
+\def\tikz@@align@newline[#1]{\egroup\tikz@align@continue\pgfmathparse{#1}\let\tikz@align@temp=\pgfmathresult\tikz@start@align}%
+% Two safe boxes for alignment:
+\let\tikz@align@aligned@box=\pgfnodeparttextbox
+\let\tikz@align@line@box=\tikz@figbox
+
+\def\tikz@start@align{%
+ % Start collecting text:
+ \setbox\tikz@align@line@box=\hbox\bgroup\bgroup%
+ \aftergroup\tikz@align@collectresetcolor\ignorespaces%
+}
+\def\tikz@align@collectresetcolor{%
+ \pgfutil@ifnextchar\reset@color%
+ {\reset@color\afterassignment\tikz@align@collectresetcolor\let\tikz@temp=}%
+ {\tikz@align@end@check}%
+}
+\def\tikz@align@end@check{%
+ \egroup%
+ \ifvoid\tikz@align@aligned@box%
+ \setbox\tikz@align@aligned@box=\box\tikz@align@line@box%
+ \else%
+ \setbox\tikz@align@aligned@box=\vbox{%
+ \expandafter\expandafter\expandafter\halign\expandafter\expandafter\expandafter{\tikz@align@header%
+ \box\tikz@align@aligned@box\cr%
+ \noalign{\vskip\tikz@align@temp pt}%
+ \unhbox\tikz@align@line@box\unskip\cr}}%
+ \fi%
+ \pgfutil@ifnextchar\tikz@align@continue{}
+ {%
+ % Main continue
+ \box\tikz@align@aligned@box%
+ \egroup%
+ }%
+}
+\def\tikz@align@continue{\tikz@@align@continue}
+\let\tikz@@align@continue=\pgfutil@empty
+
% Syntax for parts of nodes:
-% node ... {... \nodepart{name} ... \nodepart{name} ...}
+% node ... {... \nodepart[options]{name} ... \nodepart{name} ...}
-\def\tikz@nodepart#1{%
+\def\tikz@nodepart{\pgfutil@ifnextchar[\tikz@@nodepart{\tikz@@nodepart[]}}%}
+\def\tikz@@nodepart[#1]#2{%
\tikz@atend@node%
\unskip%
- \gdef\tikz@nodepart@name{#1}%
+ \gdef\tikz@nodepart@options{#1}%
+ \gdef\tikz@nodepart@name{#2}%
\global\let\tikz@fig@continue=\tikz@nodepart@continue%
\pgfutil@ifnextchar x{\egroup\relax}{\egroup\relax}% gobble spaces
}
@@ -2920,12 +3418,14 @@
\expandafter\setbox\csname pgfnodepart\tikz@nodepart@name box\endcsname=\hbox%
\bgroup%
\tikzset{every \tikz@nodepart@name\space node part/.try}%
+ \expandafter\tikzset\expandafter{\tikz@nodepart@options}%
\pgfinterruptpicture%
\tikz@textfont%
\ifx\tikz@text@width\pgfutil@empty%
\else%
\begingroup%
- \pgfutil@minipage[t]{\tikz@text@width}%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@width}%
+ \pgfutil@minipage[t]{\pgf@x}\leavevmode\hbox{}%
\tikz@text@action%
\fi%
\bgroup%
@@ -2935,10 +3435,11 @@
\pgfutil@colorlet{.}{\tikz@textcolor}%
\fi%
\pgfsetcolor{.}%
- \setbox\tikz@figbox=\box\voidb@x%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
\tikz@uninstallcommands%
\tikz@atbegin@node%
\aftergroup\tikz@fig@collectresetcolor%
+ \tikz@halign@check%
\ignorespaces%
}
@@ -2956,7 +3457,7 @@
\fi%
\tikz@is@matrixfalse%
\let\tikz@options=\pgfutil@empty%
- \let\tikz@after@node=\pgfutil@empty%
+ \let\tikz@after@path=\pgfutil@empty%
\let\tikz@afternodepathoptions=\pgfutil@empty%
\let\tikz@alias=\pgfutil@empty%
\let\tikz@transform=\pgfutil@empty%
@@ -2970,15 +3471,14 @@
\tikz@node@begin@hook%
\tikz@alias%
\global\let\tikz@last@fig@name=\tikz@fig@name%
- \global\let\tikz@after@node@smuggle=\tikz@after@node%
- \global\let\tikz@afternodepathoptions@smuggle=\tikz@afternodepathoptions%
+ \global\let\tikz@after@path@smuggle=\tikz@after@path%
\endgroup%
\let\tikz@to@last@fig@name=\tikz@last@fig@name%
\let\tikz@to@use@whom=\tikz@to@use@last@fig@name%
\let\tikzlastnode=\tikz@last@fig@name%
- \ifx\tikz@after@node@smuggle\pgfutil@empty%
+ \ifx\tikz@after@path@smuggle\pgfutil@empty%
\else%
- \tikz@scan@next@command{\pgfextra{\tikz@afternodepathoptions@smuggle}\tikz@after@node@smuggle}\pgf@stop%
+ \tikz@scan@next@command{\tikz@after@path@smuggle}\pgf@stop%
\fi%
}
@@ -3500,8 +4000,6 @@
-
-
%
% Coordinate management
%
@@ -3693,12 +4191,18 @@
% Check to see if the y-coordinate is inside {}. If it is, scan it and
% reinsert it into the stream inside an extra group.
%
+% MW:
+% Check to see if the y-coordinate is inside {}. If it is, scan it and
+% reinsert it into the stream inside an extra group.
+%
\def\tikz@parse@regular#1(#2,{%
\pgfutil@ifnextchar\bgroup{\tikz@@parse@regular#1{#2}}{\tikz@@@parse@regular#1{#2}}%
}
-\def\tikz@@parse@regular#1#2#3{\tikz@@@parse@regular#1{#2}{{#3}}}%
-
-
+\def\tikz@@parse@regular#1#2#3{%
+ \pgfutil@ifnextchar[{% Uh oh! An array index.
+ \tikz@@@parse@regular#1{#2}{#3}}%
+ {\tikz@@@parse@regular#1{#2}{{#3}}}}
+
% Originally \def\tikz@parse@regular#1(#2,#3){%
%
\def\tikz@@@parse@regular#1#2#3){%
@@ -3859,7 +4363,6 @@
}
-
% Loading further libraries
% Include a library file.
@@ -3885,16 +4388,20 @@
\def\use@@tikzlibrary#1{%
\edef\pgf@list{#1}%
\pgfutil@for\pgf@temp:=\pgf@list\do{%
- \expandafter\ifx\csname tikz@library@\pgf@temp @loaded\endcsname\relax%
- \expandafter\global\expandafter\let\csname tikz@library@\pgf@temp @loaded\endcsname=\pgfutil@empty%
- \expandafter\edef\csname tikz@library@#1@atcode\endcsname{\the\catcode`\@}
- \expandafter\edef\csname tikz@library@#1@barcode\endcsname{\the\catcode`\|}
- \catcode`\@=11
- \catcode`\|=12
- \input tikzlibrary\pgf@temp.code.tex
- \catcode`\@=\csname tikz@library@#1@atcode\endcsname
- \catcode`\|=\csname tikz@library@#1@barcode\endcsname
- \fi%
+ \expandafter\pgfkeys@spdef\expandafter\pgf@temp\expandafter{\pgf@temp}%
+ \ifx\pgf@temp\pgfutil@empty
+ \else
+ \expandafter\ifx\csname tikz@library@\pgf@temp @loaded\endcsname\relax%
+ \expandafter\global\expandafter\let\csname tikz@library@\pgf@temp @loaded\endcsname=\pgfutil@empty%
+ \expandafter\edef\csname tikz@library@#1@atcode\endcsname{\the\catcode`\@}
+ \expandafter\edef\csname tikz@library@#1@barcode\endcsname{\the\catcode`\|}
+ \catcode`\@=11
+ \catcode`\|=12
+ \input tikzlibrary\pgf@temp.code.tex
+ \catcode`\@=\csname tikz@library@#1@atcode\endcsname
+ \catcode`\|=\csname tikz@library@#1@barcode\endcsname
+ \fi%
+ \fi
}%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex
new file mode 100644
index 00000000000..7eb1b719329
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex
@@ -0,0 +1,135 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex,v 1.3 2008/11/12 23:39:37 tantau Exp $
+
+\usepgfmodule{datavisualization}
+
+
+%
+% This file defines additional data visualization classes.
+%
+
+
+\pgfooclass{candle stick visualizer}
+{
+ \attribute attribute;
+ \attribute offset;
+ \attribute use path rise=\pgfsetfillcolor{white}\pgfusepath{fill,stroke};
+ \attribute use path fall=\pgfsetfillcolor{black}\pgfusepath{fill,stroke};
+ \attribute use path wick=\pgfusepath{stroke};
+
+ \method candle stick visualizer(#1) {
+ \pgfooeset{attribute}{#1}
+ \pgfoothis.set stick width(4pt)
+ }
+
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,visualize,visualize datapoint signal)
+ }
+
+ \method set stick width(#1) {
+ \pgfmathparse{#1}
+ \pgfmathdivide{\pgfmathresult}{2}
+ \let\pgf@dv@lib@w=\pgfmathresult
+ % Compute the normalized vector:
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute}}{1}
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@lower%
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute}}{10}
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@upper%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgf@dv@lib@upper}{\pgf@dv@lib@lower}}}%
+ % Rotate by 90 degrees
+ \pgf@xa=\pgf@x%
+ \pgf@x=-\pgf@dv@lib@w\pgf@y%
+ \pgf@y=\pgf@dv@lib@w\pgf@xa%
+ \edef\pgf@dv@lib@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfoolet{offset}\pgf@dv@lib@temp
+ }
+
+ \method set use path rise(#1) {
+ \pgfooset{use path rise}{#1}
+ }
+
+ \method set use path fall(#1) {
+ \pgfooset{use path fall}{#1}
+ }
+
+ \method visualize() {
+ {
+ \pgfooget{attribute}\pgf@lib@attribute%
+ \pgfkeysgetvalue{/data point/\pgf@lib@attribute/low}\pgf@lib@low
+ \pgfkeysgetvalue{/data point/\pgf@lib@attribute/high}\pgf@lib@high
+ \pgfkeysgetvalue{/data point/\pgf@lib@attribute/entry}\pgf@lib@entry
+ \pgfkeysgetvalue{/data point/\pgf@lib@attribute/exit}\pgf@lib@exit
+ \ifx\pgf@lib@low\pgfutil@empty\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@low\relax\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@high\pgfutil@empty\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@high\relax\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@entry\pgfutil@empty\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@entry\relax\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@exit\pgfutil@empty\pgf@dv@lib@cs@skiptrue\fi
+ \ifx\pgf@lib@exit\relax\pgf@dv@lib@cs@skiptrue\fi
+ \ifpgf@dv@lib@cs@skip%
+ \else%
+ \begin{pgfscope}
+ % Ok, compute low point
+ \pgfkeyssetvalue{/data point/\pgf@lib@attribute}\pgf@lib@low
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@lowpoint%
+ % Ok, compute hight point
+ \pgfkeyssetvalue{/data point/\pgf@lib@attribute}\pgf@lib@high
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@highpoint%
+ % Compute entry and exit
+ \pgfkeyssetvalue{/data point/\pgf@lib@attribute}\pgf@lib@entry
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@entrypoint%
+ \pgfkeyssetvalue{/data point/\pgf@lib@attribute}\pgf@lib@exit
+ \pgfcanvaspositionofdatapoint%
+ \pgfsettocanvasposition\pgf@dv@lib@exitpoint%
+ \ifdim\pgf@lib@entry pt<\pgf@lib@exit pt\relax%
+ \pgf@dv@lib@risetrue%
+ \fi%
+ \ifpgf@dv@lib@rise
+ \let\pgf@dv@lib@a=\pgf@dv@lib@entrypoint
+ \let\pgf@dv@lib@b=\pgf@dv@lib@exitpoint
+ \else
+ \let\pgf@dv@lib@a=\pgf@dv@lib@exitpoint
+ \let\pgf@dv@lib@b=\pgf@dv@lib@entrypoint
+ \fi
+ % Start drawing...
+ \pgfpathmoveto{\pgf@dv@lib@lowpoint}
+ \pgfpathlineto{\pgf@dv@lib@a}
+ \pgfpathmoveto{\pgf@dv@lib@highpoint}
+ \pgfpathlineto{\pgf@dv@lib@b}
+ \pgfoovalueof{use path wick}
+ \pgfpathmoveto{\pgfpointadd{\pgf@dv@lib@a}{\pgfoovalueof{offset}}}
+ \pgfpathlineto{\pgfpointadd{\pgf@dv@lib@b}{\pgfoovalueof{offset}}}
+ \pgfpathlineto{\pgfpointadd{\pgf@dv@lib@b}{\pgfpointscale{-1}{\pgfoovalueof{offset}}}}
+ \pgfpathlineto{\pgfpointadd{\pgf@dv@lib@a}{\pgfpointscale{-1}{\pgfoovalueof{offset}}}}
+ \pgfpathclose
+ \ifpgf@dv@lib@rise
+ \pgfoovalueof{use path rise}
+ \else
+ \pgfoovalueof{use path fall}
+ \fi
+ \end{pgfscope}
+ \fi
+ }
+ }
+
+ \newif\ifpgf@dv@lib@cs@skip
+ \newif\ifpgf@dv@lib@rise
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex
new file mode 100644
index 00000000000..a5af1c95e17
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex
@@ -0,0 +1,197 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex,v 1.3 2008/12/09 00:12:10 tantau Exp $
+
+\usepgfmodule{datavisualization}
+
+
+
+
+% Function evaluator
+%
+% (This uses TeX evaluation and is slow. *You have been warned*.)
+%
+% Description:
+%
+% The data contains the description of variables and functions.
+%
+% The format for the variables is
+%
+% var <name> : interval "["<start>:<end>"]" [ step <steps> | samples <samples>];
+%
+% (The first two [ and ] are "real", the second pair means "optional",
+% see the examples.)
+%
+%
+% The format for the functions is
+%
+% func <name> = <body>;
+%
+% Additionally, the variables and functions stored in the keys
+% /pgf/data/vars and /pgf/data/funcs will also be used, the format for
+% them is the same as above.
+%
+% The <name> is always the name of a (data point) attribute. Inside
+% the <body> it can be accessed using the \value macro, which is
+% defined locally, here.
+%
+% Newlines are not importants, everything is gathered into a single
+% line, the semicolons are used to detect the beginnings and ends of
+% declarations.
+%
+% With everything setup in this way, for each variable, the variable
+% ranges throught the values between start and end, either with the
+% given step or the given number of samples. If neither is given, the
+% current value of /pgf/data visualization/samples is used. If there
+% are multiple variables, they all range over their respective
+% intervals independently. Thus, "var x = [0,1]; var y = [0:1];",
+% assuming samples=25, gives you 625 data points.
+%
+% As the variables range over their respective values, the functions
+% are evaluated using the function stored in /pgf/data/evaluator. By
+% default this is set to \pgfmathparse, but
+% you can use a different parser, if you like.
+%
+% Example:
+%
+% data [format=function] {
+%
+% % This is a parametric plot with the parameter called t.
+% var t : interval [0:360] samples 60;
+%
+% % Let's draw a circle:
+% func x = sin(\value t);
+% func y = cos(\value t);
+% }
+%
+% data [format=function] {
+%
+% % This a surface plot data...
+% var x : interval [0:1];
+% var y : interval [0:1];
+%
+% % Let's draw a circle:
+% func height = \value x*\value x + \value y*\value y;
+% }
+
+\pgfdeclaredataformat{function}
+{ % no catcode code
+}
+{ % Startup
+ % Init collectors
+ \let\value=\relax% avoid expansion
+ \pgfkeysgetvalue{/pgf/data/vars}\pgf@lib@dv@collector
+}
+{% Line arguments
+ #1%
+}
+{ % Line action
+ \edef\pgf@lib@dv@collector{\pgf@lib@dv@collector\space #1}%
+}
+{% Ignore empty lines
+}
+{%
+ \edef\pgf@lib@dv@collector{\pgf@lib@dv@collector\space \pgfkeysvalueof{/pgf/data/funcs}}%
+ \let\pgf@lib@dv@parsed\pgfutil@empty%
+ % launch parser on the result
+ \expandafter\pgf@lib@dv@func@parse \pgf@lib@dv@collector\pgf@stop%
+ \let\value\pgf@lib@dv@getval
+ \pgf@lib@dv@parsed\pgfdatapoint\pgfutil@gobble\pgf@stop%
+}
+
+\pgfkeys{
+ /pgf/data/vars/.initial=,
+ /pgf/data/funcs/.initial=,
+ /pgf/data/evaluator/.initial=\pgfmathparse,
+ /pgf/data/samples/.initial=25}
+
+\def\pgf@lib@dv@getval#1{\pgfkeysvalueof{/data point/#1}}
+
+\def\pgf@lib@dv@func@parse{%
+ \pgfutil@ifnextchar\pgf@stop{% done
+ \pgfutil@gobble%
+ }
+ {%
+ \pgfutil@ifnextchar v{% variable
+ \pgf@lib@dv@var%
+ }{%
+ \pgf@lib@dv@func%
+ }%
+ }%
+}
+
+\def\pgf@lib@dv@func func #1 =#2;{%
+ \expandafter\def\expandafter\pgf@lib@dv@parsed\expandafter{\pgf@lib@dv@parsed\pgf@lib@dv@eval@func{#1}{#2}}
+ \pgf@lib@dv@func@parse%
+}
+\def\pgf@lib@dv@var var #1 :#2interval#3[#4:#5]{%
+ \pgfutil@ifnextchar s{%
+ \pgf@lib@dv@samplesorsteps{#1}{#4}{#5}%
+ }{%
+ \expandafter\def\expandafter\pgf@lib@dv@parsed\expandafter{%
+ \pgf@lib@dv@parsed\pgf@lib@dv@samples@var{#1}{#4}{#5}{\pgfkeysvalueof{/pgf/data/samples}}}%
+ \expandafter\pgf@lib@dv@func@parse\pgfutil@gobble%
+ }
+}
+\def\pgf@lib@dv@samplesorsteps#1#2#3s{%
+ \pgfutil@ifnextchar t{% step
+ \pgf@lib@dv@step{#1}{#2}{#3}%
+ }{% sample
+ \pgf@lib@dv@samples{#1}{#2}{#3}%
+ }%
+}
+\def\pgf@lib@dv@step#1#2#3tep#4;{%
+ \expandafter\def\expandafter\pgf@lib@dv@parsed\expandafter{\pgf@lib@dv@parsed\pgf@lib@dv@step@var{#1}{#2}{#3}{#4}}%
+ \pgf@lib@dv@func@parse%
+}
+\def\pgf@lib@dv@samples#1#2#3amples#4;{%
+ \expandafter\def\expandafter\pgf@lib@dv@parsed\expandafter{\pgf@lib@dv@parsed\pgf@lib@dv@samples@var{#1}{#2}{#3}{#4}}%
+ \pgf@lib@dv@func@parse%
+}
+
+%
+% Executer...
+%
+\def\pgf@lib@dv@samples@var#1#2#3#4{%
+ \pgfmathparse{#3}%
+ \let\pgf@lib@dv@temp=\pgfmathresult%
+ \pgfmathparse{#2}%
+ \pgfmathparse{\pgf@lib@dv@temp-\pgfmathresult}%
+ \pgfmathparse{\pgfmathresult/(#4-1)}%
+ \let\pgf@lib@dv@temp=\pgfmathresult%
+ \pgf@lib@dv@step@var{#1}{#2}{#3}{\pgf@lib@dv@temp}%
+}
+
+\def\pgf@lib@dv@step@var#1#2#3#4#5\pgf@stop{%
+ {%
+ \def\pgf@loop@body{#5}%
+ \pgfmathparse{#2}%
+ \pgfkeyslet{/data point/#1}{\pgfmathresult}%
+ \pgfmathparse{#3}%
+ \let\pgf@loop@end\pgfmathresult%
+ \pgfmathparse{#4}%
+ \let\pgf@loop@step\pgfmathresult%
+ \pgfmathloop%
+ \pgfmathlessthan{\pgf@loop@end}{\pgfkeysvalueof{/data point/#1}}
+ \ifdim\pgfmathresult pt<1pt\relax%
+ \pgf@loop@body\pgf@stop%
+ \pgfmathparse{\pgfkeysvalueof{/data point/#1}+\pgf@loop@step}%
+ \pgfkeyslet{/data point/#1}{\pgfmathresult}%
+ \repeatpgfmathloop%%
+ }%
+}
+
+\def\pgf@lib@dv@eval@func#1#2{%
+ \pgfkeysvalueof{/pgf/data/evaluator}{#2}%
+ \pgfkeyslet{/data point/#1}{\pgfmathresult}%
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex
new file mode 100644
index 00000000000..f39adbbedaa
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex
@@ -0,0 +1,192 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex,v 1.2 2008/11/24 18:31:22 tantau Exp $
+
+\usepgfmodule{datavisualization}
+
+% This file defines code for doing plots involving polar
+% coordinates. This includes not only standard polar plots, but also
+% pie charts.
+
+
+
+\pgfooclass{polar transformer}
+{
+ % Class plor mapper
+ %
+ % A polar mapper is used to transform attributes given as (2d) polar
+ % coordinates to canvas coordinates. Note that no special ranges
+ % can be specified and that the angle must be given in degrees. You
+ % can, however, use a standard mapper to change these things.
+
+ \attribute angle;
+ % The attribute from which the angle is read.
+
+ \attribute radius;
+ % The attribute from which the radius is read.
+
+ \attribute unit vector 0 degrees;
+ % The unit vector 0 degrees
+
+ \attribute unit vector 90 degrees;
+ % The unit vector 90 degrees
+
+
+
+ % Constructor
+ %
+ % #1 = angle attribute. Example: rotation.
+ % #2 = radius attribute. Example: height.
+ % #3 = unit vector 0 degrees
+ % #4 = unit vector 90 degrees
+ %
+ \method polar transformer(#1,#2,#3,#4) {
+ \pgfooset{angle}{#1}
+ \pgfooset{radius}{#2}
+ \pgfooset{unit vector 0 degrees}{#3}
+ \pgfooset{unit vector 90 degrees}{#4}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,transform,transform datapoint signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,path,path signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,direction,direction signal)
+ }
+
+ % Getters
+ \method get angle attribute(#1) {
+ \pgfooget{angle}{#1}
+ }
+
+ \method get radius attribute(#1) {
+ \pgfooget{radius}{#1}
+ }
+
+
+ % Slot
+ %
+ % This slot should be connected to the transform datapoint
+ % signal. When this signal is emitted, the coordinate system will be
+ % shifted according to the current value of the attribute.
+ \method transform() {
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{angle}/const}\pgf@dv@angle%
+ \ifx\pgf@dv@angle\relax
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{angle}}\pgf@dv@angle%
+ \fi
+ \ifx\pgf@dv@angle\relax\else%
+ \ifx\pgf@dv@angle\pgfutil@empty\else%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{radius}/const}\pgf@dv@radius%
+ \ifx\pgf@dv@radius\relax
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{radius}}\pgf@dv@radius%
+ \fi
+ \ifx\pgf@dv@radius\pgfutil@empty\else%
+ \ifx\pgf@dv@radius\relax\else%
+ \pgfmathsincos{\pgf@dv@angle}%
+ \pgfmathmultiply{\pgfmathresultx}{\pgf@dv@radius}%
+ \let\pgf@dv@polar@temp=\pgfmathresult
+ \pgftransformshift{\pgfpointscale{\pgf@dv@polar@temp}{\pgfoovalueof{unit vector 0 degrees}}}%
+ \pgfmathmultiply{\pgfmathresulty}{\pgf@dv@radius}%
+ \let\pgf@dv@polar@temp=\pgfmathresult
+ \pgftransformshift{\pgfpointscale{\pgf@dv@polar@temp}{\pgfoovalueof{unit vector 90 degrees}}}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }
+
+
+
+ % Reaction to the path signal
+ %
+ % Here is what we do: When a pgfdvpathmoveto is done, the radius and
+ % the angle are recorded. When a pgfdvpathlineto is done, the saved
+ % radius and angle are compared with the new angle and radius. If,
+ % and only if, the radius is the same, but the angle is different,
+ % the lineto is caught and replaced by an arc from the previous
+ % position to the new position.
+
+ \attribute prev angle;
+ \attribute prev radius;
+
+ \method path(#1) {%
+ \ifpgfdvhandled%
+ \else%
+ \ifx#1\pgfdvpathlinetotoken
+ % Ok, let us have a look...
+ \pgfooget{prev radius}\pgf@dv@prev@rad
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{radius}}\pgf@dv@current@rad
+ \ifx\pgf@dv@current@rad\relax
+ \else
+ \ifdim\pgf@dv@current@rad pt=\pgf@dv@prev@rad pt%
+ \pgfooget{prev angle}\pgf@dv@prev@angle
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{angle}}\pgf@dv@current@angle
+ \ifx\pgf@dv@current@angle\relax
+ \else
+ \ifdim\pgf@dv@current@angle pt=\pgf@dv@prev@angle pt%
+ % do nothing
+ \else%
+ % Do arc:
+ \pgfpatharcaxes{\pgf@dv@prev@angle}{\pgf@dv@current@angle}
+ {\pgfpointscale{\pgf@dv@current@rad}{\pgfoovalueof{unit vector 0 degrees}}}
+ {\pgfpointscale{\pgf@dv@current@rad}{\pgfoovalueof{unit vector 90 degrees}}}%
+ \pgfdvhandledtrue%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ % No matter what, record the current position
+ \pgfooeset{prev angle}{\pgfkeysvalueof{/data point/\pgfoovalueof{angle}}}
+ \pgfooeset{prev radius}{\pgfkeysvalueof{/data point/\pgfoovalueof{radius}}}
+ }
+
+ % Method
+ %
+ % React to direction signals. See pgfpointdvdirection for an
+ % explanation
+ %
+ \method direction(#1) {%
+ \ifx#1\pgfdvdirectionfromtoken
+ % Record angle and radius
+ \xdef\pgf@dv@polar@from@angle{\pgfkeysvalueof{/data point/\pgfoovalueof{angle}}}
+ \xdef\pgf@dv@polar@from@radius{\pgfkeysvalueof{/data point/\pgfoovalueof{radius}}}
+ \else%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{radius}}\pgf@dv@polar@to@radius
+ \ifx\pgf@dv@polar@to@radius\relax
+ \else
+ \ifdim\pgf@dv@polar@to@radius pt=\pgf@dv@polar@from@radius pt%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{angle}}\pgf@dv@polar@to@angle
+ \ifx\pgf@dv@polar@to@angle\relax
+ \else
+ \ifdim\pgf@dv@polar@to@angle pt=\pgf@dv@polar@from@angle pt%
+ % do nothing
+ \else%
+ % Output vector that it orthogonal to start angle:
+ \ifdim\pgf@dv@polar@to@angle pt>\pgf@dv@polar@from@angle pt%
+ \pgf@process{\pgfpointpolar{\pgf@dv@polar@from@angle+90}{1pt}}
+ \else
+ \pgf@process{\pgfpointpolar{\pgf@dv@polar@from@angle-90}{1pt}}
+ \fi
+ \pgfdvhandledtrue
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }
+}
+
+
+\endinput
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.footprints.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
index 5cf633d0c59..5cf633d0c59 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.footprints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.fractals.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
index 22c9d8d1b27..22c9d8d1b27 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.fractals.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex
new file mode 100644
index 00000000000..dcb98da9119
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex
@@ -0,0 +1,187 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+\usepgfmodule{decorations}
+
+
+% A marking decoration is used to add markings (which are just pgf
+% scopes, essentially) at certain positions of a path.
+
+\pgfkeys{
+ /pgf/decoration/reset marks/.code=\let\pgf@lib@dec@mark@marks=\pgfutil@empty,
+ /pgf/decoration/mark/.code=\pgf@lib@dec@parsemark#1\pgf@lib@dec@stop,
+}
+
+\let\pgf@lib@dec@mark@marks=\pgfutil@empty
+
+\def\pgf@lib@dec@parsemark{\pgfutil@ifnextchar b{\pgf@lib@dec@parsebetween}{\pgf@lib@dec@parseat}}
+\def\pgf@lib@dec@parseat at position#1with#2\pgf@lib@dec@stop{%
+ \expandafter\def\expandafter\pgf@lib@dec@mark@marks\expandafter{\pgf@lib@dec@mark@marks%
+ \pgf@lib@dec@domark{#1}{#2}%
+ }%
+}
+\def\pgf@lib@dec@parsebetween between positions#1and#2step#3with#4\pgf@lib@dec@stop{%
+ \expandafter\def\expandafter\pgf@lib@dec@mark@marks\expandafter{\pgf@lib@dec@mark@marks%
+ \pgf@lib@dec@dobetweenmark{#1}{#2}{#3}{#4}%
+ }%
+}
+
+\def\pgf@lib@dec@arrowhead#1#2{%
+ \expandafter\ifx\csname tikz@special@arrow@end#2\endcsname\relax% be nice to TikZ
+ \pgfsetarrowsend{#2}
+ \else%
+ \pgfsetarrowsend{\csname tikz@special@arrow@end#2\endcsname}%
+ \fi%
+ \pgf@x=0pt%
+ \pgf@shorten@end%
+ \pgftransformxshift{-\pgf@x}
+ \pgftransformxscale{#1}
+ \pgflowlevelsynccm%
+ \pgflowlevelobj{}{\pgf@endarrow}%
+}
+
+\def\pgf@lib@dec@doarrowhead#1{%
+ \pgf@lib@dec@arrowhead{1}{#1}%
+}
+\def\pgf@lib@dec@doarrowheadrev#1{%
+ \pgf@lib@dec@arrowhead{-1}{#1}%
+}
+
+
+\pgfdeclaredecoration{markings}{init}
+{
+ \state{init}
+ [
+ width=0pt,
+ persistent precomputation={%
+ \pgfkeys{/pgf/decoration/mark info/sequence number/.initial=0}%
+ \pgfkeys{/pgf/decoration/mark info/distance from start/.initial=}%
+ },
+ next state=pre
+ ]
+ {}
+
+ \state{pre}
+ [
+ width=0pt,
+ persistent precomputation={%
+ \def\pgf@lib@dec@computed@width{0pt}%
+ \pgf@lib@dec@mark@marks\pgf@lib@dec@mark@last%
+ \let\arrow=\pgf@lib@dec@doarrowhead%
+ \let\arrowreversed=\pgf@lib@dec@doarrowheadrev%
+ },
+ next state=skipper
+ ]
+ {}
+
+ \state{skipper}[width=\pgf@lib@dec@computed@width-\pgfdecoratedcompleteddistance-1sp,
+ next state=\pgf@lib@dec@next@state]{}
+
+ \state{main}
+ [
+ width=1sp,
+ next state=pre,
+ persistent precomputation={%
+ \pgfutil@tempcnta=\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}\relax%
+ \advance\pgfutil@tempcnta by1\relax%
+ \pgfkeys{/pgf/decoration/mark info/sequence number/.expanded=\the\pgfutil@tempcnta}%
+ \pgfkeys{/pgf/decoration/mark info/distance from start/.expanded=\pgf@lib@dec@computed@width}%
+ }%
+ ]
+ {%
+ \pgfinterruptpath%
+ \pgfscope%
+ \let\pgf@lib@dec@mark@marks=\pgfutil@empty%
+ \pgf@lib@dec@computed@action%
+ \endpgfscope%
+ \endpgfinterruptpath%
+ \ifx\pgf@lib@mark@node\pgfutil@empty%
+ \else%
+ \pgf@lib@mark@connect@node%
+ \fi%
+ }%
+
+ \state{final}[width=\pgfdecoratedremainingdistance]{
+ \ifx\pgf@lib@mark@node\pgfutil@empty%
+ \pgfpathmoveto{\pgfpointdecoratedpathlast}
+ \else%
+ \pgfpathlineto{\pgfpointdecoratedpathlast}
+ \fi%
+ }
+}
+
+\def\pgf@lib@dec@domark#1#2#3\pgf@lib@dec@mark@last{%
+ \def\pgf@lib@dec@mark@marks{#3}%
+ \pgf@lib@dec@parsenum{#1}%
+ \def\pgf@lib@dec@computed@action{#2}%
+ \def\pgf@lib@dec@next@state{main}%
+}
+
+
+\def\pgf@lib@dec@dobetweenmark#1#2#3#4#5\pgf@lib@dec@mark@last{%
+ \pgf@lib@dec@parsenum{#1}%
+ \let\pgf@lib@dec@mark@start=\pgf@lib@dec@computed@width%
+ \pgf@lib@dec@parsenum{#2}%
+ \let\pgf@lib@dec@mark@end=\pgf@lib@dec@computed@width%
+ \ifdim\pgf@lib@dec@mark@end<\pgf@lib@dec@mark@start\relax%
+ % Skip!
+ #5\pgf@lib@dec@mark@last%
+ \else%
+ %
+ \pgf@lib@dec@parsenum{#3}%
+ \pgfmathparse{\pgf@lib@dec@mark@start+\pgf@lib@dec@computed@width}%
+ % Update entry in mark list
+ \edef\pgf@temp{\noexpand\pgf@lib@dec@dobetweenmark{\pgfmathresult pt}{\pgf@lib@dec@mark@end}{\pgf@lib@dec@computed@width}}%
+ \expandafter\def\expandafter\pgf@lib@dec@mark@marks\expandafter{\pgf@temp{#4}#5}%
+ \let\pgf@lib@dec@computed@width\pgf@lib@dec@mark@start%
+ \def\pgf@lib@dec@computed@action{#4}%
+ \def\pgf@lib@dec@next@state{main}%
+ \fi%
+}
+
+
+\def\pgf@lib@dec@parsenum#1{%
+ \pgfmathparse{#1}%
+ \ifpgfmathunitsdeclared%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathparse{\pgfdecoratedpathlength\pgfmathresult pt}%
+ \else%
+ \pgfmathparse{\pgfmathresult pt}%
+ \fi%
+ \else%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathparse{\pgfdecoratedpathlength\pgfmathresult*\pgfdecoratedpathlength}%
+ \else%
+ \pgfmathparse{\pgfmathresult*\pgfdecoratedpathlength}%
+ \fi%
+ \fi%
+ \edef\pgf@lib@dec@computed@width{\pgfmathresult pt}%
+}
+
+\def\pgf@lib@dec@mark@last{%
+ \def\pgf@lib@dec@next@state{final}%
+}
+
+
+%
+% If you set the mark connection node inside a mark picture, the
+% output path will contain a line to this node
+%
+
+\pgfkeys{/pgf/decoration/mark connection node/.store in=\pgf@lib@mark@node,
+ /pgf/decoration/mark connection node=}
+\def\pgf@lib@mark@connect@node{%
+ % Line to "left" end of the node
+ \pgfpathlineto{\pgfpointshapeborder{\pgf@lib@mark@node}{\pgfqpoint{-1pt}{0pt}}}
+ % Move to "right" end of the node
+ \pgfpathmoveto{\pgfpointshapeborder{\pgf@lib@mark@node}{\pgfqpoint{1pt}{0pt}}}
+}%
+
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathmorphing.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
index a6052489796..a6052489796 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathmorphing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
index d07ae8ab6e5..e618ac996cf 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
@@ -1,4 +1,4 @@
-% Copyright 2008 by Mark Wibrow
+% Copyright 2008 by Mark Wibrow and Till Tantau
%
% This file may be distributed and/or modified
%
@@ -174,4 +174,54 @@
+% show path construction decoration
+%
+\pgfdeclaredecoration{show path construction}{check for moveto}{
+ \state{check for moveto}[width=0pt, next state=segment,
+ persistent precomputation={%
+ \begingroup%
+ \pgf@lib@decoraions@installinputsegmentpoints%
+ \ifx\pgfdecorationpreviousinputsegment\pgfdecorationinputsegmentmoveto%
+ \pgfdecoratedinputsegmentmovetocode%
+ \fi%
+ \endgroup%
+ }]{}
+ \state{segment}[width=\pgfdecoratedinputsegmentremainingdistance, next state=check for moveto,
+ persistent precomputation={%
+ \begingroup%
+ \pgf@lib@decoraions@installinputsegmentpoints%
+ \csname pgfdecoratedinputsegment\pgfdecorationcurrentinputsegment code\endcsname%
+ \endgroup%
+ }]{}
+ \state{final}{%
+ \egroup%
+ \begingroup%
+ \pgf@lib@decoraions@installinputsegmentpoints%
+ \csname pgfdecoratedinputsegment\pgfdecorationcurrentinputsegment code\endcsname%
+ \endgroup%
+ \bgroup%
+ }
+}
+
+\pgfkeys{
+ /pgf/decoration/.cd,
+ moveto code/.code=\def\pgfdecoratedinputsegmentmovetocode{#1},
+ lineto code/.code=\def\pgfdecoratedinputsegmentlinetocode{#1},
+ curveto code/.code=\def\pgfdecoratedinputsegmentcurvetocode{#1},
+ closepath code/.code=\def\pgfdecoratedinputsegmentclosepathcode{#1}
+}
+
+\let\pgfdecoratedinputsegmentmovetocode\pgfutil@empty%
+\let\pgfdecoratedinputsegmentlinetocode\pgfutil@empty%
+\let\pgfdecoratedinputsegmentcurvetocode\pgfutil@empty%
+\let\pgfdecoratedinputsegmentclosepathcode\pgfutil@empty%
+
+\def\pgf@lib@decoraions@installinputsegmentpoints{%
+ \let\pgfpointdecoratedinputsegmentfirst\pgf@decorate@inputsegment@first%
+ \let\pgfpointdecoratedinputsegmentlast\pgf@decorate@inputsegment@last%
+ \let\pgfpointdecoratedinputsegmentsupporta\pgf@decorate@inputsegment@supporta%
+ \let\pgfpointdecoratedinputsegmentsupportb\pgf@decorate@inputsegment@supportb%
+}
+
+
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.shapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
index 6e1b25101bd..6e1b25101bd 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.shapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex
new file mode 100644
index 00000000000..b13f3ce0199
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex
@@ -0,0 +1,347 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+\usepgfmodule{decorations}
+
+
+% Options for text decorations
+
+\pgfkeys{
+ /pgf/decoration/.cd,
+ text/.store in=\pgfdecorationtext,%
+ text color/.store in=\pgf@lib@decorationtextcolor,%
+ text format delimiters/.code={\expandafter\pgfsetdecoratetextformatdelimiters#1},
+ text align/.code={\pgfkeys{/pgf/decoration/text align/.cd,#1}},
+ text align/.cd,
+ align/.initial=left,
+ left/.style={/pgf/decoration/text align/align=left},
+ right/.style={/pgf/decoration/text align/align=right},
+ center/.style={/pgf/decoration/text align/align=center},
+ left indent/.initial=0pt,
+ right indent/.initial=0pt,
+ fit to path/.is if=pgf@lib@dec@text@fit,
+ fit to path stretching spaces/.default=true,
+ fit to path stretching spaces/.code={%
+ \csname pgf@lib@dec@text@fit#1\endcsname%
+ \csname pgf@lib@dec@text@stretch@spaces#1\endcsname%
+ }%
+}
+
+\newif\ifpgf@lib@dec@text@scan@space
+\newif\ifpgf@lib@dec@text@stretch@spaces
+\newif\ifpgf@lib@dec@text@fit
+
+\def\pgf@lib@decorationtextcolor{black}
+
+\def\pgf@lib@dec@text@left@text{left}
+\def\pgf@lib@dec@text@right@text{right}
+\def\pgf@lib@dec@text@right@center{center}
+
+% Decorates a path with a text. The path is removed during this
+% process
+
+\pgfdeclaredecoration{text along path}{initial}{
+\state{initial}[width=+0pt, next state=left indent,
+ persistent precomputation={%
+ \edef\pgf@lib@dec@text@indent@left{\pgfkeysvalueof{/pgf/decoration/text align/left indent}}%
+ \edef\pgf@lib@dec@text@indent@right{\pgfkeysvalueof{/pgf/decoration/text align/right indent}}%
+ \edef\pgf@lib@dec@text@align{\pgfkeysvalueof{/pgf/decoration/text align/align}}%
+ \pgfdecoratedremainingdistance=\pgfdecoratedpathlength%
+ \advance\pgfdecoratedremainingdistance by-\pgf@lib@dec@text@indent@right\relax%
+ \edef\pgfdecoratedpathlength{\the\pgfdecoratedremainingdistance}%
+ \pgf@lib@dec@text@getwidth%
+ \pgf@x=\pgf@lib@dec@text@width\relax%
+ \pgf@y=\pgfdecoratedremainingdistance%
+ \ifpgf@lib@dec@text@fit%
+ \advance\pgf@y by-\pgf@lib@dec@text@indent@left\relax%
+ \advance\pgf@y by-\pgf@x%
+ \ifpgf@lib@dec@text@stretch@spaces%
+ \def\pgf@lib@dec@text@character@shift{0pt}%
+ \divide\pgf@y by\pgf@lib@dec@space@count\relax%
+ \edef\pgf@lib@dec@text@space@shift{\the\pgf@y}%
+ \else%
+ \c@pgf@counta=\pgf@lib@dec@character@count\relax%
+ \advance\c@pgf@counta by-1\relax%
+ \divide\pgf@y by\c@pgf@counta\relax%
+ \edef\pgf@lib@dec@text@character@shift{\the\pgf@y}%
+ \def\pgf@lib@dec@text@space@shift{0pt}%
+ \fi%
+ \ifdim\pgf@y<0pt\relax%
+ \pgf@lib@dec@text@fitfalse%
+ \pgf@lib@dec@text@stretch@spacesfalse%
+ \def\pgf@lib@dec@text@character@shift{0pt}%
+ \def\pgf@lib@dec@text@space@shift{0pt}%
+ \fi%
+ \else%
+ \def\pgf@lib@dec@text@character@shift{0pt}%
+ \def\pgf@lib@dec@text@space@shift{0pt}%
+ \ifx\pgf@lib@dec@text@align\pgf@lib@dec@text@left@text%
+ \else%
+ \ifx\pgf@lib@dec@text@align\pgf@lib@dec@text@right@text%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgf@lib@dec@text@indent@left{\the\pgf@y}%
+ \else%
+ \advance\pgf@y by-\pgf@x%
+ \advance\pgf@y by-\pgf@lib@dec@text@indent@left\relax%
+ \pgf@y=0.5\pgf@y%
+ \advance\pgf@y by\pgf@lib@dec@text@indent@left\relax%
+ \edef\pgf@lib@dec@text@indent@left{\the\pgf@y}%
+ \fi%
+ \fi%
+ \fi%
+ \let\pgfdecorationrestoftext=\pgfdecorationtext%
+ }]{}
+\state{left indent}[width=+\pgf@lib@dec@text@indent@left, next state=scan]{}
+%
+\state{scan}[width=+0pt, next state=before typeset,
+ persistent precomputation={
+ \pgf@lib@dec@text@scanchar%
+ \ifvoid\pgf@lib@dec@text@box%
+ \setbox\pgf@lib@dec@text@box\hbox{}%
+ \wd\pgf@lib@dec@text@box16383pt\relax%
+ \fi%
+ }]{}
+%
+\state{before typeset}[width=+.5\wd\pgf@lib@dec@text@box, next state=typeset]{}
+%
+\state{typeset}[width=+0pt, next state=after typeset]
+{%
+ \pgftransformxshift{+-.5\wd\pgf@lib@dec@text@box}%
+ \setbox\pgf@hbox\hbox{\copy\pgf@lib@dec@text@box}%
+ \pgfqboxsynced\pgf@hbox%
+}
+\state{after typeset}[width=+.5\wd\pgf@lib@dec@text@box, next state=shift,
+ persistent precomputation={%
+ \ifpgf@lib@dec@text@fit%
+ \ifpgf@lib@dec@text@stretch@spaces%
+ \ifpgf@lib@dec@text@scan@space%
+ \let\pgf@lib@dec@text@shift=\pgf@lib@dec@text@space@shift%
+ \else%
+ \def\pgf@lib@dec@text@shift{0pt}%
+ \fi%
+ \else%
+ \let\pgf@lib@dec@text@shift=\pgf@lib@dec@text@character@shift%
+ \fi%
+ \else%
+ \def\pgf@lib@dec@text@shift{0pt}%
+ \fi%
+ }]{}
+\state{shift}[width=+\pgf@lib@dec@text@shift, next state=scan]{}
+\state{final}{}
+}
+
+
+% \pgfsetdecoratetextformatdelimiters
+%
+% Set the delimiters for formatting in the text decoration.
+% NB: Catcodes for delimiters should be 11 or 12.
+%
+% Examples:
+%
+% \pgfsetdecoratetextformatdelimiters{|}{}% 2nd argument can be empty.
+%
+% \def\pgfdecoratetext{A big |\color{red}|red|| apple.}
+%
+% \pgfsetdecoratetextformatdelimiters{[}{]}
+%
+% \def\pgfdecoratetext{The [\it]very[+\color{green}]green[] sprouts.}
+%
+\def\pgfsetdecoratetextformatdelimiters#1#2{%
+ \def\pgf@lib@dec@text@formatchar{#1}%
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \def\pgf@lib@dec@text@collectformat##1#1{%
+ \pgf@lib@dec@text@@collectformat##1\pgf@stop}%
+ \else%
+ \def\pgf@lib@dec@text@collectformat##1#2{%
+ \pgf@lib@dec@text@@collectformat##1\pgf@stop}%
+ \fi%
+}
+
+\pgfsetdecoratetextformatdelimiters{|}{}
+
+\newbox\pgf@lib@dec@text@box
+\newif\ifpgf@lib@decorate@textmathmode
+
+\let\pgfdecorationtext=\pgfutil@empty
+\let\pgfdecorationrestoftext=\pgfutil@empty%
+\let\pgf@lib@dec@text@format=\pgfutil@empty
+
+\def\pgf@lib@dec@text@scanchar{%
+ \pgf@lib@dec@text@scan@spacefalse%
+ \ifx\pgfdecorationrestoftext\pgfutil@empty%
+ \let\pgf@lib@dec@text@char\pgfutil@empty%
+ \setbox\pgf@lib@dec@text@box\box\pgfutil@voidb@x%
+ \let\pgf@next\relax%
+ \else%
+ \let\pgf@next\pgf@lib@dec@text@@scanchar%
+ \fi%
+ \pgf@next}
+
+\def\pgf@lib@dec@text@@scanchar{%
+ \expandafter\pgf@lib@dec@text@@@scanchar\pgfdecorationrestoftext\pgf@stop}
+
+\def\pgf@lib@dec@text@@@scanchar{%
+ \futurelet\pgf@lib@dec@lettoken%
+ \pgf@lib@dec@text@@@@scanchar}
+
+\def\pgf@lib@dec@text@@@@scanchar{%
+ \ifx\pgf@lib@dec@lettoken\pgfutil@sptoken%
+ \let\pgf@next\pgf@lib@dec@text@insertspace%
+ \else%
+ \let\pgf@next\pgf@lib@dec@text@@@@@scanchar%
+ \fi%
+ \pgf@next}
+
+\def\pgf@lib@dec@text@@@@@scanchar{%
+ \pgfutil@ifnextchar\bgroup{\pgf@lib@dec@text@collectgroup}%
+ {\pgf@lib@dec@text@@@@@@scanchar}}
+
+\def\pgf@lib@dec@text@collectgroup#1{%
+ \def\pgf@lib@dec@text@char{#1}%
+ \pgf@lib@dec@text@collectrestoftext}
+
+\def\pgf@lib@dec@text@@@@@@scanchar#1{%
+ \ifx#1\pgf@stop%
+ \pgf@lib@dec@text@box\box\pgfutil@voidb@x%
+ \let\pgf@next\pgf@lib@dec@text@endoftext%
+ \else%
+ \def\pgf@lib@dec@text@char{#1}%
+ \ifx#1\space%
+ \let\pgf@next\pgf@lib@dec@text@collectrestoftext%
+ \else%
+ \ifx#1\ %
+ \let\pgf@next\pgf@lib@dec@text@collectrestoftext%
+ \else%
+ \ifx\pgf@lib@dec@text@char\pgf@lib@dec@text@formatchar%
+ \let\pgf@next\pgf@lib@dec@text@collectformat%
+ \else%
+ \expandafter\ifcat\noexpand#1\relax%
+ \let\pgf@next\pgf@lib@dec@text@expandcs%
+ \else%
+ \ifnum\catcode`#1=3\relax%
+ \ifpgf@lib@decorate@textmathmode%
+ \pgf@lib@decorate@textmathmodefalse%
+ \else%
+ \pgf@lib@decorate@textmathmodetrue%
+ \fi%
+ \let\pgf@next\pgf@lib@dec@text@@@scanchar%
+ \else%
+ \let\pgf@next\pgf@lib@dec@text@collectrestoftext%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgf@next%
+}
+
+\def\pgf@lib@dec@text@@collectformat{%
+ \pgfutil@ifnextchar+{\pgf@lib@dec@text@addtoformat}{\pgf@lib@dec@text@setformat}}
+
+\def\pgf@lib@dec@text@setformat#1\pgf@stop{%
+ \def\pgf@lib@dec@text@format{#1}%
+ \pgf@lib@dec@text@@@scanchar%
+}
+
+\def\pgf@lib@dec@text@addtoformat+#1\pgf@stop{%
+ \expandafter\def\expandafter\pgf@lib@dec@text@format\expandafter{\pgf@lib@dec@text@format#1}%
+ \pgf@lib@dec@text@@@scanchar%
+}
+
+\def\pgf@lib@dec@text@insertspace{%
+ \pgf@lib@dec@text@scan@spacetrue%
+ \pgfutil@ifnextchar\bgroup{\pgf@lib@dec@text@@insertspacegrp}%
+ {\pgf@lib@dec@text@@insertspace}}
+
+\def\pgf@lib@dec@text@@insertspacegrp#1{%
+ \pgf@lib@dec@text@@@@@@scanchar\space{#1}}
+
+\def\pgf@lib@dec@text@@insertspace#1{%
+ \pgf@lib@dec@text@@@@@@scanchar\space#1}
+
+\def\pgf@lib@dec@text@expandcs{%
+ \expandafter\expandafter\expandafter\pgf@lib@dec@text@@@@@scanchar%
+ \pgf@lib@dec@text@char}
+
+\def\pgf@lib@dec@text@endoftext{%
+ \let\pgfdecoraterestoftext\pgfutil@empty%
+ \let\pgf@lib@dec@text@char\pgfutil@empty%
+}
+\def\pgf@lib@dec@text@collectrestoftext{%
+ \pgf@lib@dec@text@dobox%
+ \futurelet\pgf@lib@dec@text@lettoken%
+ \pgf@lib@dec@text@@collectrestoftext}
+
+\def\pgf@lib@dec@text@@collectrestoftext{%
+ \ifx\bgroup\pgf@lib@dec@text@lettoken%
+ \let\pgf@next\pgf@lib@dec@text@@@collectrestoftextgrp%
+ \else%
+ \let\pgf@next\pgf@lib@dec@text@@@collectrestoftext%
+ \fi%
+ \pgf@next}
+
+\def\pgf@lib@dec@text@@@collectrestoftextgrp#1#2\pgf@stop{\def\pgfdecorationrestoftext{{#1}#2}%
+}
+
+\def\pgf@lib@dec@text@@@collectrestoftext#1\pgf@stop{\def\pgfdecorationrestoftext{#1}}
+
+{%
+ \catcode`\$3 %
+ \gdef\pgf@lib@dec@mathshift{$}%
+ \catcode`\$9 $% For editors with annoying syntax highlighting.
+}%
+
+\def\pgf@lib@dec@text@dobox{%
+ \setbox\pgf@lib@dec@text@box\hbox{%
+ \pgfinterruptpicture%
+ \begingroup%
+ \pgfsetcolor{\pgf@lib@decorationtextcolor}%
+ \ifpgf@lib@decorate@textmathmode\pgf@lib@dec@mathshift\fi%
+ \pgf@lib@dec@text@format\relax%
+ \pgf@lib@dec@text@char%
+ \ifpgf@lib@decorate@textmathmode\pgf@lib@dec@mathshift\fi%
+ \endgroup%
+ \endpgfinterruptpicture%
+ }%
+}
+
+\def\pgf@lib@dec@text@getwidth{%
+ \begingroup%
+ \let\c@pgf@lib@dec@characters=\c@pgf@counta%
+ \let\c@pgf@lib@dec@spaces=\c@pgf@countb%
+ \let\pgfdecorationrestoftext=\pgfdecorationtext%
+ \c@pgf@lib@dec@spaces=0\relax%
+ \c@pgf@lib@dec@characters=0\relax%
+ \pgfmathloop%
+ \pgf@lib@dec@text@scanchar%
+ \ifvoid\pgf@lib@dec@text@box%
+ \else%
+ \setbox\pgf@hbox=\hbox{{%
+ \unhbox\pgf@hbox%
+ \unhbox\pgf@lib@dec@text@box%
+ }}%
+ \advance\c@pgf@lib@dec@characters by1\relax%
+ \ifpgf@lib@dec@text@scan@space%
+ \advance\c@pgf@lib@dec@spaces by1\relax%
+ \fi%
+ \repeatpgfmathloop%
+ \global\pgf@x=\the\wd\pgf@hbox%
+ \xdef\pgf@lib@dec@temp{\the\c@pgf@lib@dec@characters}%
+ \xdef\pgf@lib@dec@@temp{\the\c@pgf@lib@dec@spaces}%
+ \endgroup%
+ \edef\pgf@lib@dec@text@width{\the\pgf@x}%
+ \let\pgf@lib@dec@character@count=\pgf@lib@dec@temp%
+ \let\pgf@lib@dec@space@count=\pgf@lib@dec@@temp%
+}
+
+
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
index 9de07884dd5..d91a83b111f 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.code.tex,v 1.7 2007/06/07 07:41:11 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.code.tex,v 1.9 2008/10/27 21:00:46 tantau Exp $
% A square bracket shaped arrow
@@ -228,6 +228,53 @@
}
+% A square shaped arrow
+\newdimen\arrowsize
+\pgfarrowsdeclare{square}{square}
+{
+ \arrowsize=0.4pt
+ \advance\arrowsize by.275\pgflinewidth%
+ \pgfarrowsleftextend{+-\arrowsize}
+ \advance\arrowsize by.5\pgflinewidth
+ \pgfarrowsrightextend{+\arrowsize}
+}
+{
+ \arrowsize=0.4pt
+ \advance\arrowsize by.275\pgflinewidth%
+ \pgfsetdash{}{+0pt}
+ \pgfsetroundjoin
+ \pgfpathmoveto{\pgfqpoint{1\arrowsize}{4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{-7\arrowsize}{4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{-7\arrowsize}{-4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{1\arrowsize}{-4\arrowsize}}
+ \pgfpathclose
+ \pgfusepathqfillstroke
+}
+% A open square shaped arrow
+
+\pgfarrowsdeclare{open square}{open square}%{{-.5bp}{8.5bp}}
+{
+ \arrowsize=0.4pt
+ \advance\arrowsize by.275\pgflinewidth%
+ \pgfarrowsleftextend{+-.5\pgflinewidth}
+ \advance\arrowsize by7\arrowsize
+ \advance\arrowsize by.5\pgflinewidth
+ \pgfarrowsrightextend{+\arrowsize}
+}
+{
+ \arrowsize=0.4pt
+ \advance\arrowsize by.275\pgflinewidth%
+ \pgfsetdash{}{+0pt}
+ \pgfsetroundjoin
+ \pgfpathmoveto{\pgfqpoint{8\arrowsize}{4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{0\arrowsize}{4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{0\arrowsize}{-4\arrowsize}}
+ \pgfpathlineto{\pgfqpoint{8\arrowsize}{-4\arrowsize}}
+ \pgfpathclose
+ \pgfusepathqstroke
+}
+
+
% A triangle shaped arrow
@@ -839,4 +886,46 @@
}
+
+
+
+% Mathematical arrows
+
+
+% The arrow tip of an \implies arrow, to be used with an inner line.
+%
+% Example:
+%
+% \pgfsetarrow{-implies}
+% \pgfsetlinewidth{1.8pt}
+% \pgfsetinnerlinewidth{1pt}
+
+\pgfarrowsdeclare{implies}{implies}
+{
+ \pgfmathsetlength{\pgfutil@tempdima}{.25\pgflinewidth+.25*\pgfinnerlinewidth}%
+ \pgfmathsetlength{\pgfutil@tempdimb}{.5\pgflinewidth-.5*\pgfinnerlinewidth}%
+ \pgfarrowsrightextend{2\pgfutil@tempdima+.5\pgfutil@tempdimb}
+ \pgfarrowsleftextend{1.3\pgfutil@tempdima+.5\pgfutil@tempdimb}
+}
+{
+ \pgfmathsetlength{\pgfutil@tempdima}{.25\pgflinewidth+.25*\pgfinnerlinewidth}%
+ \pgfmathsetlength{\pgfutil@tempdimb}{.5\pgflinewidth-.5*\pgfinnerlinewidth}%
+ \pgfsetlinewidth{\pgfutil@tempdimb}
+ \pgfsetdash{}{+0pt}
+ \pgfsetroundcap
+ \pgfsetroundjoin
+ \pgfpathmoveto{\pgfpoint{-1.4\pgfutil@tempdima}{2.65\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfpoint{-0.75\pgfutil@tempdima}{1.25\pgfutil@tempdima}}
+ {\pgfpoint{1\pgfutil@tempdima}{0.05\pgfutil@tempdima}}
+ {\pgfpoint{2\pgfutil@tempdima}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{1\pgfutil@tempdima}{-0.05\pgfutil@tempdima}}
+ {\pgfpoint{-.75\pgfutil@tempdima}{-1.25\pgfutil@tempdima}}
+ {\pgfpoint{-1.4\pgfutil@tempdima}{-2.65\pgfutil@tempdima}}
+ \pgfusepathqstroke
+}
+
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex
deleted file mode 100644
index b09975a9aef..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.markings.code.tex
+++ /dev/null
@@ -1,114 +0,0 @@
-% Copyright 2008 by Mark Wibrow
-%
-% 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.
-
-\usepgfmodule{decorations}
-
-
-% A marking decoration is used to add markings (which are just pgf
-% scopes, essentially) at certain positions of a path.
-
-\pgfkeys{
- /pgf/decoration/reset marks/.code=\let\pgf@lib@dec@mark@marks=\pgfutil@empty,
- /pgf/decoration/mark/.code=\pgf@lib@dec@parsemark#1\pgf@lib@dec@stop,
-}
-
-\let\pgf@lib@dec@mark@marks=\pgfutil@empty
-
-\def\pgf@lib@dec@parsemark at position#1with#2\pgf@lib@dec@stop{%
- \expandafter\def\expandafter\pgf@lib@dec@mark@marks\expandafter{\pgf@lib@dec@mark@marks%
- \pgf@lib@dec@domark{#1}{#2}%
- }%
-}
-
-\def\pgf@lib@dec@arrowhead#1#2{%
- \expandafter\ifx\csname tikz@special@arrow@end#2\endcsname\relax% be nice to TikZ
- \pgfsetarrowsend{#2}
- \else%
- \pgfsetarrowsend{\csname tikz@special@arrow@end#2\endcsname}%
- \fi%
- \pgf@x=0pt%
- \pgf@shorten@end%
- \pgftransformxshift{-\pgf@x}
- \pgftransformxscale{#1}
- \pgflowlevelsynccm%
- \pgflowlevelobj{}{\pgf@endarrow}%
-}
-
-\def\pgf@lib@dec@doarrowhead#1{%
- \pgf@lib@dec@arrowhead{1}{#1}%
-}
-\def\pgf@lib@dec@doarrowheadrev#1{%
- \pgf@lib@dec@arrowhead{-1}{#1}%
-}
-
-
-\pgfdeclaredecoration{markings}{pre}
-{
- \state{pre}
- [
- width=0pt,
- persistent precomputation={%
- \pgf@lib@dec@mark@marks\pgf@lib@dec@mark@last%
- \let\arrow=\pgf@lib@dec@doarrowhead%
- \let\arrowreversed=\pgf@lib@dec@doarrowheadrev%
- },
- next state=skipper
- ]
- {}
-
- \state{skipper}[width=\pgf@lib@dec@computed@width-\pgfdecoratedcompleteddistance-1sp,
- next state=\pgf@lib@dec@next@state]{}
-
- \state{main}
- [
- width=1sp,
- next state=pre
- ]
- {%
- \pgfinterruptpath%
- \pgfscope%
- \let\pgf@lib@dec@mark@marks=\pgfutil@empty%
- \pgf@lib@dec@computed@action%
- \endpgfscope%
- \endpgfinterruptpath%
- }%
-
- \state{final}[width=\pgfdecoratedremainingdistance]{}
-}
-
-\def\pgf@lib@dec@domark#1#2#3\pgf@lib@dec@mark@last{%
- \def\pgf@lib@dec@mark@marks{#3}%
- \pgf@lib@dec@parsenum{#1}%
- \def\pgf@lib@dec@computed@action{#2}%
- \def\pgf@lib@dec@next@state{main}%
-}
-
-\def\pgf@lib@dec@parsenum#1{%
- \pgfmathparse{#1}%
- \ifpgfmathunitsdeclared%
- \ifdim\pgfmathresult pt<0pt\relax%
- \edef\pgf@lib@dec@computed@width{\pgfdecoratedpathlength\pgfmathresult pt}%
- \else%
- \edef\pgf@lib@dec@computed@width{\pgfmathresult pt}%
- \fi%
- \else%
- \ifdim\pgfmathresult pt<0pt\relax%
- \edef\pgf@lib@dec@computed@width{\pgfdecoratedpathlength\pgfmathresult*\pgfdecoratedpathlength}%
- \else%
- \edef\pgf@lib@dec@computed@width{\pgfmathresult*\pgfdecoratedpathlength}%
- \fi%
- \fi%
-}
-
-\def\pgf@lib@dec@mark@last{%
- \def\pgf@lib@dec@next@state{final}%
-}
-
-
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.text.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.text.code.tex
deleted file mode 100644
index b773e36563c..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.text.code.tex
+++ /dev/null
@@ -1,233 +0,0 @@
-% Copyright 2008 by Mark Wibrow
-%
-% 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.
-
-\usepgfmodule{decorations}
-
-
-% Options for text decorations
-
-\pgfkeys{
- /pgf/decoration/.cd,
- text/.store in=\pgfdecorationtext,%
- text color/.store in=\pgf@lib@decorationtextcolor,%
- text format delimiters/.code={\expandafter\pgfsetdecoratetextformatdelimiters#1}
-}
-\def\pgf@lib@decorationtextcolor{black}
-
-% Decorates a path with a text. The path is removed during this
-% process
-
-\pgfdeclaredecoration{text along path}{initial}{
- \state{initial}[width=+0pt,
- next state=scan,
- persistent precomputation=\let\pgfdecorationrestoftext\pgfdecorationtext]
- {}
- \state{scan}[width=+0pt,
- next state=before typeset,
- persistent precomputation=
- {
- \pgf@lib@decorations@text@scanchar%
- \ifvoid\pgf@lib@decorations@text@box%
- \setbox\pgf@lib@decorations@text@box\hbox{}%
- \wd\pgf@lib@decorations@text@box16383pt\relax%
- \fi%
- }]
- {}
- \state{before typeset}[width=+.5\wd\pgf@lib@decorations@text@box, next state=typeset]{}
- \state{typeset}[width=+0pt, next state=after typeset]
- {
- \pgftransformxshift{+-.5\wd\pgf@lib@decorations@text@box}%
- \setbox\pgf@hbox\hbox{\copy\pgf@lib@decorations@text@box}%
- \pgfqboxsynced\pgf@hbox%
- }
- \state{after typeset}[width=+.5\wd\pgf@lib@decorations@text@box, next state=scan]{}
- \state{final}{}
-}
-
-
-% \pgfsetdecoratetextformatdelimiters
-%
-% Set the delimiters for formatting in the text decoration.
-% NB: Catcodes for delimiters should be 11 or 12.
-%
-% Examples:
-%
-% \pgfsetdecoratetextformatdelimiters{|}{}% 2nd argument can be empty.
-%
-% \def\pgfdecoratetext{A big |\color{red}|red|| apple.}
-%
-% \pgfsetdecoratetextformatdelimiters{[}{]}
-%
-% \def\pgfdecoratetext{The [\it]very[+\color{green}]green[] sprouts.}
-%
-\def\pgfsetdecoratetextformatdelimiters#1#2{%
- \def\pgf@lib@decorations@text@formatchar{#1}%
- \def\pgf@test{#2}%
- \ifx\pgf@test\pgfutil@empty%
- \def\pgf@lib@decorations@text@collectformat##1#1{%
- \pgf@lib@decorations@text@@collectformat##1\pgf@stop}%
- \else%
- \def\pgf@lib@decorations@text@collectformat##1#2{%
- \pgf@lib@decorations@text@@collectformat##1\pgf@stop}%
- \fi%
-}
-
-\pgfsetdecoratetextformatdelimiters{|}{}
-
-\newbox\pgf@lib@decorations@text@box
-\newif\ifpgf@lib@decorate@textmathmode
-
-\let\pgfdecorationtext\pgfutil@empty
-\let\pgfdecorationrestoftext\pgfutil@empty%
-\let\pgf@lib@decorations@text@format\pgfutil@empty
-
-\def\pgf@lib@decorations@text@scanchar{%
- \ifx\pgfdecorationrestoftext\pgfutil@empty%
- \let\pgf@lib@decorations@text@char\pgfutil@empty%
- \setbox\pgf@lib@decorations@text@box\box\voidb@x%
- \let\pgf@next\relax%
- \else%
- \let\pgf@next\pgf@lib@decorations@text@@scanchar%
- \fi%
- \pgf@next}
-
-\def\pgf@lib@decorations@text@@scanchar{%
- \expandafter\pgf@lib@decorations@text@@@scanchar\pgfdecorationrestoftext\pgf@stop}
-
-\def\pgf@lib@decorations@text@@@scanchar{%
- \futurelet\pgf@lib@decorations@lettoken%
- \pgf@lib@decorations@text@@@@scanchar}
-
-\def\pgf@lib@decorations@text@@@@scanchar{%
- \ifx\pgf@lib@decorations@lettoken\pgfutil@sptoken%
- \let\pgf@next\pgf@lib@decorations@text@insertspace%
- \else%
- \let\pgf@next\pgf@lib@decorations@text@@@@@scanchar%
- \fi%
- \pgf@next}
-
-\def\pgf@lib@decorations@text@@@@@scanchar{%
- \pgfutil@ifnextchar\bgroup{\pgf@lib@decorations@text@collectgroup}%
- {\pgf@lib@decorations@text@@@@@@scanchar}}
-
-\def\pgf@lib@decorations@text@collectgroup#1{%
- \def\pgf@lib@decorations@text@char{#1}%
- \pgf@lib@decorations@text@collectrestoftext}
-
-\def\pgf@lib@decorations@text@@@@@@scanchar#1{%
- \ifx#1\pgf@stop%
- \pgf@lib@decorations@text@box\box\voidb@x%
- \let\pgf@next\pgf@lib@decorations@text@endoftext%
- \else%
- \def\pgf@lib@decorations@text@char{#1}%
- \ifx#1\space%
- \let\pgf@next\pgf@lib@decorations@text@collectrestoftext%
- \else%
- \ifx#1\ %
- \let\pgf@next\pgf@lib@decorations@text@collectrestoftext%
- \else%
- \ifx\pgf@lib@decorations@text@char\pgf@lib@decorations@text@formatchar%
- \let\pgf@next\pgf@lib@decorations@text@collectformat%
- \else%
- \expandafter\ifcat\noexpand#1\relax%
- \let\pgf@next\pgf@lib@decorations@text@expandcs%
- \else%
- \ifnum\catcode`#1=3\relax%
- \ifpgf@lib@decorate@textmathmode%
- \pgf@lib@decorate@textmathmodefalse%
- \else%
- \pgf@lib@decorate@textmathmodetrue%
- \fi%
- \let\pgf@next\pgf@lib@decorations@text@@@scanchar%
- \else%
- \let\pgf@next\pgf@lib@decorations@text@collectrestoftext%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgf@next%
-}
-
-\def\pgf@lib@decorations@text@@collectformat{%
- \pgfutil@ifnextchar+{\pgf@lib@decorations@text@addtoformat}{\pgf@lib@decorations@text@setformat}}
-
-\def\pgf@lib@decorations@text@setformat#1\pgf@stop{%
- \def\pgf@lib@decorations@text@format{#1}%
- \pgf@lib@decorations@text@@@scanchar%
-}
-
-\def\pgf@lib@decorations@text@addtoformat+#1\pgf@stop{%
- \expandafter\def\expandafter\pgf@lib@decorations@text@format\expandafter{\pgf@lib@decorations@text@format#1}%
- \pgf@lib@decorations@text@@@scanchar%
-}
-
-\def\pgf@lib@decorations@text@insertspace{%
- \pgfutil@ifnextchar\bgroup{\pgf@lib@decorations@text@@insertspacegrp}%
- {\pgf@lib@decorations@text@@insertspace}}
-
-\def\pgf@lib@decorations@text@@insertspacegrp#1{%
- \pgf@lib@decorations@text@@@@@@scanchar\space{#1}}
-
-\def\pgf@lib@decorations@text@@insertspace#1{%
- \pgf@lib@decorations@text@@@@@@scanchar\space#1}
-
-\def\pgf@lib@decorations@text@expandcs{%
- \expandafter\expandafter\expandafter\pgf@lib@decorations@text@@@@@scanchar%
- \pgf@lib@decorations@text@char}
-
-\def\pgf@lib@decorations@text@endoftext{%
- \let\pgfdecoraterestoftext\pgfutil@empty%
- \let\pgf@lib@decorations@text@char\pgfutil@empty%
-}
-\def\pgf@lib@decorations@text@collectrestoftext{%
- \pgf@lib@decorations@text@dobox%
- \futurelet\pgf@lib@decorations@text@lettoken%
- \pgf@lib@decorations@text@@collectrestoftext}
-
-\def\pgf@lib@decorations@text@@collectrestoftext{%
- \ifx\bgroup\pgf@lib@decorations@text@lettoken%
- \let\pgf@next\pgf@lib@decorations@text@@@collectrestoftextgrp%
- \else%
- \let\pgf@next\pgf@lib@decorations@text@@@collectrestoftext%
- \fi%
- \pgf@next}
-
-\def\pgf@lib@decorations@text@@@collectrestoftextgrp#1#2\pgf@stop{\def\pgfdecorationrestoftext{{#1}#2}%
-}
-
-\def\pgf@lib@decorations@text@@@collectrestoftext#1\pgf@stop{\def\pgfdecorationrestoftext{#1}}
-
-{%
- \catcode`\$3 %
- \gdef\pgf@lib@decorations@mathshift{$}%
- \catcode`\$9 $% For editors with annoying syntax highlighting.
-}%
-
-\def\pgf@lib@decorations@text@dobox{%
- \setbox\pgf@lib@decorations@text@box\hbox{%
- \pgfinterruptpicture%
- \begingroup%
- \pgfsetcolor{\pgf@lib@decorationtextcolor}%
- \ifpgf@lib@decorate@textmathmode\pgf@lib@decorations@mathshift\fi%
- \pgf@lib@decorations@text@format\relax%
- \pgf@lib@decorations@text@char%
- \ifpgf@lib@decorate@textmathmode\pgf@lib@decorations@mathshift\fi%
- \endgroup%
- \endpgfinterruptpicture%
- }%
-}
-
-
-
-
-
-
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
new file mode 100644
index 00000000000..240eddf4435
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
@@ -0,0 +1,637 @@
+% Copyright 2006 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\pgfkeys{/pgf/.cd,
+ fixed point arithmetic/.code={%
+ \pgfmathfp@plots@install%
+ \pgfmathfp@parser@install%
+ \let\pgfmathparse=\pgfmathfpparse%
+ \pgfkeys{/pgf/fixed point/.cd, #1}%
+ },%
+ fixed point/.cd,
+ scale results/.code={%
+ \pgfmathfpparse{#1}%
+ \let\pgfmathfpscale=\pgfmathresult%
+ }%
+}
+
+\def\pgfmathfpscale{1}
+
+\def\pgfmathfpparse{%
+ \begingroup%
+ \let\pgfmathpostparse=\relax%
+ \pgfmath@catcodes%
+ \pgfmath@quickparsefalse%
+ \pgfmathfpparse@}
+
+\def\pgfmathfpparse@#1{%
+ \edef\pgfmathfp@expression{#1}%
+ \expandafter\pgfmathfpparse@@\pgfmathfp@expression\pgfmathfp@}
+
+\def\pgfmathfp@char@asterisk{*}
+\def\pgfmathfpparse@@#1#2\pgfmathfp@{%
+ \def\pgfmathfp@test{#1}%
+ \ifx\pgfmathfp@test\pgfmathfp@char@asterisk%
+ \edef\pgfmathfp@expression{\pgfmathfpscale#1#2}%
+ \else%
+ \edef\pgfmathfp@expression{#1#2}%
+ \fi%
+ \expandafter\pgfmathparse@\expandafter{\pgfmathfp@expression}%
+ % \endgroup provided by \pgfpathmarse@end
+}
+
+% Crude handling of file plots
+%
+\pgfkeys{/pgf/fixed point/.cd,
+ scale file plot x/.code=\pgfmathfpparse{#1}\edef\pgfmathfpplotscalex{\pgfmathresult*},
+ scale file plot y/.code=\pgfmathfpparse{#1}\edef\pgfmathfpplotscaley{\pgfmathresult*},
+ scale file plot z/.code=\pgfmathfpparse{#1}\edef\pgfmathfpplotscalez{\pgfmathresult*}
+}
+
+\def\pgfmathfp@plots@install{%
+ \let\pgfmathfpplotscalex=\pgfutil@empty
+ \let\pgfmathfpplotscaley=\pgfutil@empty
+ \let\pgfmathfpplotscalez=\pgfutil@empty
+ \let\pgf@parsexyline=\pgfmathfp@parsexyline%
+ \let\pgf@parsexyzline=\pgfmathfp@parsexyzline%
+}
+
+\def\pgfmathfp@parsexyline#1 #2 #3\pgf@stop{%
+ \edef\pgfmathfp@marshal{%
+ \noexpand\pgfplotstreampoint{\noexpand\pgfpointxy{\pgfmathfpplotscalex#1}{\pgfmathfpplotscaley#2}}%
+ }%
+ \pgfmathfp@marshal%
+}
+
+\def\pgfmathfp@parsexyzline#1 #2 #3 #4\pgf@stop{%
+ \edef\pgfmathfp@marshal{%
+ \noexpand\pgfplotstreampoint{%
+ \noexpand\pgfpointxyz{\pgfmathfpplotscalex#1}{\pgfmathfpplotscaley#2}{\pgfmathfpplotscalez#3}%
+ }%
+ }%
+ \pgfmathfp@marshal%
+}
+
+%
+\def\pgfmathfp@parser@install{%
+ %
+ \expandafter\ifx\csname FP@version\endcsname\relax%
+ \PackageError{pgf}{You need to say `\string\usepackage{fp}' to use %
+ fixed point arithmetic}{}%
+ \else%
+ %
+ % Don't want messages.
+ %
+ \FPmessagesfalse%
+ \FPdebugfalse%
+ %
+ % Install float commands...
+ %
+ \let\pgfmathadd@=\pgfmathfpadd@%
+ \let\pgfmathsubtract@=\pgfmathfpsubtract@%
+ \let\pgfmathmultiply@=\pgfmathfpmultiply@%
+ \let\pgfmathdivide@=\pgfmathfpdivide@%
+ \let\pgfmathabs@=\pgfmathfpabs@%
+ \let\pgfmathround@=\pgfmathfpround@%
+ \let\pgfmathfloor@=\pgfmathfpfloor@%
+ \let\pgfmathceil@=\pgfmathfpceil@%
+ \let\pgfmathmod@=\pgfmathfpmod@%
+ \let\pgfmathmax@=\pgfmathfpmax@%
+ \let\pgfmathmin@=\pgfmathfpmin@%
+ \let\pgfmathsin@=\pgfmathfpsin@%
+ \let\pgfmathcos@=\pgfmathfpcos@%
+ \let\pgfmathtan@=\pgfmathfptan@%
+ \let\pgfmathdeg@=\pgfmathfpdeg@%
+ \let\pgfmathrad@=\pgfmathfprad@%
+ \let\pgfmathatan@=\pgfmathfpatan@%
+ \let\pgfmathasin@=\pgfmathfpasin@%
+ \let\pgfmathacos@=\pgfmathfpacos@%
+ \let\pgfmathcot@=\pgfmathfpcot@%
+ \let\pgfmathsec@=\pgfmathfpsec@%
+ \let\pgfmathcosec@=\pgfmathfpcosec@%
+ \let\pgfmathpow@=\pgfmathfppow@%
+ \let\pgfmathexp@=\pgfmathfpexp@%
+ \let\pgfmathln@=\pgfmathfpln@%
+ \let\pgfmathsqrt@=\pgfmathfpsqrt@%
+ \let\pgfmath@pi=\pgfmathfppi@%
+ \let\pgfmathveclen@=\pgfmathfpveclen@%
+ \let\pgfmathe@=\pgfmathfpe@%
+ %
+ \let\pgfmathlessthan@=\pgfmathfplessthan@%
+ \let\pgfmathgreaterthan@=\pgfmathfpgreaterthan@%
+ \let\pgfmathequalto@=\pgfmathfpequalto@%
+ %
+ \let\pgfmathrnd=\pgfmathfprnd%
+ \let\pgfmathrand=\pgfmathfprand%
+ \let\pgfmathsetseed=\pgfmathfpsetseed%
+ %
+ \let\pgfmathscientific=\pgfmathfpscientific%
+ \fi%
+}%
+
+\def\pgfmathfpe@{let\pgfmathresult=\FPe}%
+\def\pgfmathfppi@{let\pgfmathresult=\FPpi}%
+
+
+% Scientific notation.
+
+\def\pgfmathfpscientific#1#2{%
+ \begingroup%
+ \FPpow\pgfmathresult{10}{#2}\unskip% Needed.
+ \FPmul\pgfmathresult{#1}{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% Comparison stuff...
+
+% lessthan
+%
+\def\pgfmathfplessthan#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfplessthan@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfplessthan@#1#2{%
+ \begingroup%
+ \FPiflt{#1}{#2}%
+ \def\pgfmathresult{1.0}%
+ \else%
+ \def\pgfmathresult{0.0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% greaterthan
+%
+\def\pgfmathfpgreaterthan#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpgreaterthan@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpgreaterthan@#1#2{%
+ \begingroup%
+ \FPifgt{#1}{#2}%
+ \def\pgfmathresult{1.0}%
+ \else%
+ \def\pgfmathresult{0.0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% equalto
+%
+\def\pgfmathfpequalto#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpequalto@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpequalto@#1#2{%
+ \begingroup%
+ \FPifeq{#1}{#2}%
+ \def\pgfmathresult{1.0}%
+ \else%
+ \def\pgfmathresult{0.0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+
+% Basic arithmetic stuff...
+
+% add
+%
+\def\pgfmathfpadd#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpadd@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpadd@#1#2{%
+ \begingroup%
+ \FPadd\pgfmathresult{#1}{#2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% subtract
+%
+\def\pgfmathfpsubtract#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsubtract@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpsubtract@#1#2{%
+ \begingroup%
+ \FPsub\pgfmathresult{#1}{#2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% multiply
+%
+\def\pgfmathfpmultiply#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmultiply@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpmultiply@#1#2{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{#2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% divide
+%
+\def\pgfmathfpdivide#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpdivide@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpdivide@#1#2{%
+ \begingroup%
+ \FPdiv\pgfmathresult{#1}{#2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% abs
+%
+\def\pgfmathfpabs#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpabs@{\pgfmathresult}%
+}
+\def\pgfmathfpabs@#1{%
+ \begingroup%
+ \FPabs\pgfmathresult{#1}
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% round
+%
+\def\pgfmathfpround#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpround@{\pgfmathresult}%
+}
+\def\pgfmathfpround@#1{%
+ \begingroup%
+ \FPround\pgfmathresult{#1}{0}%
+ \edef\pgfmathresult{\pgfmathresult.0}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% floor
+%
+\def\pgfmathfpfloor#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpfloor@{\pgfmathresult}%
+}
+\def\pgfmathfpfloor@#1{%
+ \begingroup%
+ \FPtrunc\pgfmathresult{#1}{0}%
+ \FPifneg{#1}%
+ \FPsub\pgfmathresult{\pgfmathresult}{1}%
+ \fi%
+ \edef\pgfmathresult{\pgfmathresult.0}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% ceil
+%
+\def\pgfmathfpceil#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpceil@{\pgfmathresult}%
+}
+\def\pgfmathfpceil@#1{%
+ \begingroup%
+ \FPtrunc\pgfmathresult{#1}{0}%
+ \FPifpos{#1}%
+ \FPadd\pgfmathresult{\pgfmathresult}{1}%
+ \fi%
+ \edef\pgfmathresult{\pgfmathresult.0}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% mod
+%
+\def\pgfmathfpmod#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmod@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpmod@#1#2{%
+ \begingroup%
+ \FPdiv\pgfmathresult{#1}{#2}%
+ \FPtrunc\pgfmathresult{\pgfmathresult}{0}%
+ \FPmul\pgfmathresult{\pgfmathresult}{#2}%
+ \FPsub\pgfmathresult{#1}{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% max
+%
+\def\pgfmathfpmax#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmax@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpmax@#1#2{%
+ \begingroup%
+ \FPifgt{#1}{#2}%
+ \def\pgfmathresult{#1}%
+ \else%
+ \def\pgfmathresult{#2}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% min
+%
+\def\pgfmathfpmin#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmin@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpmin@#1#2{%
+ \begingroup%
+ \FPiflt{#1}{#2}%
+ \def\pgfmathresult{#1}%
+ \else%
+ \def\pgfmathresult{#2}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% Functions...
+
+% pow
+%
+\def\pgfmathfppow#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfppow@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfppow@#1#2{%
+ \begingroup%
+ \FPpow\pgfmathresult{#1}{#2}\unskip%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% exp
+%
+\def\pgfmathfpexp#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpexp@{\pgfmathresult}%
+}
+\def\pgfmathfpexp@#1{%
+ \begingroup%
+ \FPexp\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% ln
+%
+\def\pgfmathfpln#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpln@{\pgfmathresult}%
+}
+\def\pgfmathfpln@#1{%
+ \begingroup%
+ \FPln\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% sqrt
+%
+\def\pgfmathfpsqrt#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsqrt@{\pgfmathresult}%
+}
+\def\pgfmathfpsqrt@#1{%
+ \begingroup%
+ \FProot\pgfmathresult{#1}{2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% veclen
+%
+\def\pgfmathfpveclen#1#2{%
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpveclen@{\pgfmathresult}{\pgfmath@result}%
+}
+\def\pgfmathfpveclen@#1#2{%
+ \begingroup%
+ \FPmul\pgfmath@result{#1}{#1}%
+ \FPmul\pgfmath@@result{#2}{#2}%
+ \FPadd\pgfmathresult{\pgfmath@result}{\pgfmath@@result}%
+ \FProot\pgfmathresult{\pgfmathresult}{2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% Trigonometric stuff...
+
+% sin
+%
+\def\pgfmathfpsin#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsin@{\pgfmathresult}%
+}
+\def\pgfmathfpsin@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPsin\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% cos
+%
+\def\pgfmathfpcos#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcos@{\pgfmathresult}%
+}
+\def\pgfmathfpcos@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPcos\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% tan
+%
+\def\pgfmathfptan#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfptan@{\pgfmathresult}%
+}
+\def\pgfmathfptan@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPtan\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% acos
+%
+\def\pgfmathfpacos#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpacos@{\pgfmathresult}%
+}
+\def\pgfmathfpacos@#1{%
+ \begingroup%
+ \FParccos\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% asin
+%
+\def\pgfmathfpasin#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpasin@{\pgfmathresult}%
+}
+\def\pgfmathfpasin@#1{%
+ \begingroup%
+ \FParcsin\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% atan
+%
+\def\pgfmathfpatan#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpatan@{\pgfmathresult}%
+}
+\def\pgfmathfpatan@#1{%
+ \begingroup%
+ \FParctan\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% cot
+%
+\def\pgfmathfpcot#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcot@{\pgfmathresult}%
+}
+\def\pgfmathfpcot@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPcot\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% sec
+%
+\def\pgfmathfpsec#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsec@{\pgfmathresult}%
+}
+\def\pgfmathfpsec@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPcos\pgfmathresult{\pgfmathresult}%
+ \FPdiv\pgfmathresult{1}{\pgfmathresult}
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% cosec
+%
+\def\pgfmathfpcosec#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcosec@{\pgfmathresult}%
+}
+\def\pgfmathfpcosec@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPsin\pgfmathresult{\pgfmathresult}%
+ \FPdiv\pgfmathresult{1}{\pgfmathresult}
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% deg
+%
+\def\pgfmathfpdeg#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpdeg@{\pgfmathresult}%
+}
+\def\pgfmathfpdeg@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% rad
+%
+\def\pgfmathfprad#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfprad@{\pgfmathresult}%
+}
+\def\pgfmathfprad@#1{%
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.01745329251994325}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% Random stuff...
+
+\def\pgfmathfpsetseed#1{%
+ \pgfmathfpparse{#1}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \FPseed\pgfmathresult\relax\pgfmath@%
+}
+
+% rnd
+%
+\def\pgfmathfprnd{%
+ \begingroup%
+ \FPrandom\pgfmathresult%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% rand
+%
+\def\pgfmathfprand{%
+ \begingroup%
+ \FPrandom\pgfmathresult%
+ \FPmul\pgfmathresult{2}{\pgfmathresult}%
+ \FPsub\pgfmathresult{\pgfmathresult}{1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
new file mode 100644
index 00000000000..cecc76d593e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
@@ -0,0 +1,1965 @@
+% Copyright 2008/2009 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU General Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\newif\ifpgfmathfloatparseactive
+\newif\ifpgfmathfloat@scaleactive
+
+% public macro which invokes '#1' if the fpu is installed and ready and '#2'
+% otherwise.
+\def\pgflibraryfpuifactive#1#2{%
+ \ifpgfmathfloatparseactive
+ #1%
+ \else
+ #2%
+ \fi
+}%
+
+\pgfqkeys{/pgf}{
+ % enable the FPU parser if it is not yet active
+ %
+ % It will be deactivated after the current TeX group
+ fpu/.is choice,
+ fpu/true/.code={%
+ \ifpgfmathfloatparseactive
+ \else
+ \pgfutil@ifundefined{pgfmathdeclarefunction}{%
+ % Ohoh - we are running on a TeX distribution with
+ % PGF 2.00 which doesn't have the new math engine.
+ % I can provide special treatment here, provided that
+ % all float commands are still able to run (that means
+ % more information needs to be copied from the pgf cvs
+ % to pgf 2.00 - for example pgfmathfloat.code.tex).
+ %
+ % I employ this to work with pgfplots and pgf 2.00
+ % using all new features.
+ \pgfmathfloat@parser@install@pgf@two@null@null%
+ }{%
+ \pgfmathfloat@parser@install%
+ }%
+ \pgfmathfloatparseactivetrue
+ % improve compatibility with Marks FP library:
+ \pgfkeysalso{/pgf/fixed point arithmetic/.prefix style={/pgf/fpu=false}}%
+ \fi
+ },%
+ fpu/false/.code={%
+ \ifpgfmathfloatparseactive
+ \pgfmathfloat@uninstall%
+ \pgfmathfloatparseactivefalse
+ \fi
+ },%
+ fpu/.default=true,
+ % Use this to introduce a result scaling.
+ % Every expression in which the prefix '*' occurs
+ % will be multiplied with the result and converted to fixed point
+ % representation.
+ fpu/scale results/.code={%
+ \ifpgfmathfloatparseactive
+ \pgfmathparse{#1}%
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \fi
+ \let\pgfmathfloatscale=\pgfmathresult%
+ },%
+ % determines the output format of each complete expression parsing
+ % process. If 'scale results' is active, 'fixed' is assumed
+ % automatically.
+ fpu/output format/.is choice,
+ fpu/output format/float/.code= {\let\pgfmathfloatparse@output=\relax},
+ fpu/output format/sci/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}},
+ fpu/output format/fixed/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattofixed@{\pgfmathresult}}},
+ fpu/output format/float,
+ fpu/rel thresh/.code={%
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfmathfloat@relthresh=\pgfmathresult
+ },
+ fpu/rel thresh=1e-4,
+}
+
+\pgfmathfloatcreate{1}{1.0}{0}\let\pgfmathfloatscale=\pgfmathresult
+
+% This is the replacement parser invocation.
+% It does two things which are different to \pgfmathparse:
+% 1. it disables any dimension dependand scalings,
+% 2. it implements the 'scale results' feature.
+\def\pgfmathfloatparse{%
+ \begingroup%
+ % disable any dimension-dependant scalings:
+ \let\pgfmathpostparse=\relax%
+ \pgfmath@catcodes%
+ \pgfmath@quickparsefalse%
+ \pgfmathfloatparse@}
+
+% for pgf 2.00 :
+\def\pgfmathfloatparse@pgf@two@null@null{%
+ \pgfmath@quickparsefalse%
+ \pgfmathfloatparse@}
+
+\def\pgfmathfloatparse@#1{%
+ \edef\pgfmathfloat@expression{#1}%
+ \expandafter\pgfmathfloatparse@@\pgfmathfloat@expression\pgfmathfloat@
+ \ifpgfmathfloat@scaleactive
+ \expandafter\pgfmathfloatmultiply@\expandafter{\pgfmathresult}{\pgfmathfloatscale}
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \else
+ \pgfmathfloatparse@output
+ \fi
+}
+
+\def\pgfmathfloat@char@asterisk{*}
+\def\pgfmathfloatparse@@#1#2\pgfmathfloat@{%
+ \def\pgfmathfloat@test{#1}%
+ \ifx\pgfmathfloat@test\pgfmathfloat@char@asterisk%
+ \def\pgfmathfloat@expression{#2}%
+ \pgfmathfloat@scaleactivetrue
+ \fi%
+ \expandafter\pgfmathparse@\expandafter{\pgfmathfloat@expression}%
+ % \endgroup provided by \pgfpathmarse@end
+}
+
+% Crude handling of file plots
+%
+\pgfkeys{/pgf/fpu/.cd,
+ scale file plot x/.code=\pgfmathfloatparse{#1}\edef\pgfmathfloatplotscalex{\pgfmathresult*},
+ scale file plot y/.code=\pgfmathfloatparse{#1}\edef\pgfmathfloatplotscaley{\pgfmathresult*},
+ scale file plot z/.code=\pgfmathfloatparse{#1}\edef\pgfmathfloatplotscalez{\pgfmathresult*}
+}
+
+\def\pgfmathfloat@uninstall@appendcmd#1{%
+ \expandafter\gdef\expandafter\pgfmathfloat@uninstall\expandafter{\pgfmathfloat@uninstall #1}%
+}%
+
+% If the uninstall command is already assembled, it will skip the
+% uninstall assemblation.
+\def\pgfmathfloat@plots@checkuninstallcmd{%
+ \pgfutil@ifundefined{pgfmathfloat@uninstall}{%
+ \global\let\pgfmathfloat@uninstall=\pgfutil@empty
+ }{%
+ % We already HAVE an uninstall command (prepared globally).
+ % So: don't waste time assembling one!
+ \def\pgfmathfloat@uninstall@appendcmd##1{}%
+ \def\pgfmathfloat@prepareuninstallcmd##1{}%
+ }%
+}%
+
+% This assembles an uninstall command globally ON FIRST USAGE.
+% See \pgfmathfloat@plots@checkuninstallcmd
+\def\pgfmathfloat@prepareuninstallcmd#1{%
+ % and store backup information (globally - I don't want to do that
+ % all the time when the FPU is used!):
+ \expandafter\global\expandafter\let\csname pgfmathfloat@backup@\string#1\endcsname=#1%
+ \expandafter\gdef\expandafter\pgfmathfloat@uninstall\expandafter{\pgfmathfloat@uninstall
+ \expandafter\let\expandafter#1\csname pgfmathfloat@backup@\string#1\endcsname%
+ }%
+}
+
+\def\pgfmathfloat@install#1=#2{%
+ \pgfmathfloat@prepareuninstallcmd{#1}%
+ \let#1=#2%
+}
+\def\pgfmathfloat@install@unimplemented#1{%
+ \expandafter\pgfmathfloat@prepareuninstallcmd\csname pgfmath@#1@\endcsname%
+ \expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat@notimplemented{#1}}%
+}
+\def\pgfmathfloat@plots@install{%
+ \let\pgfmathfloatplotscalex=\pgfutil@empty
+ \let\pgfmathfloatplotscaley=\pgfutil@empty
+ \let\pgfmathfloatplotscalez=\pgfutil@empty
+ \pgfmathfloat@install\pgf@parsexyline=\pgfmathfloat@parsexyline%
+ \pgfmathfloat@install\pgf@parsexyzline=\pgfmathfloat@parsexyzline%
+}
+\def\pgfmathfloat@parsexyline#1 #2 #3\pgf@stop{%
+ \edef\pgfmathfloat@marshal{%
+ \noexpand\pgfplotstreampoint{\noexpand\pgfpointxy{\pgfmathfloatplotscalex#1}{\pgfmathfloatplotscaley#2}}%
+ }%
+ \pgfmathfloat@marshal%
+}
+\def\pgfmathfloat@parsexyzline#1 #2 #3 #4\pgf@stop{%
+ \edef\pgfmathfloat@marshal{%
+ \noexpand\pgfplotstreampoint{%
+ \noexpand\pgfpointxyz{\pgfmathfloatplotscalex#1}{\pgfmathfloatplotscaley#2}{\pgfmathfloatplotscalez#3}%
+ }%
+ }%
+ \pgfmathfloat@marshal%
+}
+
+%
+\def\pgfmathfloat@parser@install@functions{%
+ % Install float commands...
+ %
+ \pgfmathfloat@install\pgfmathadd@=\pgfmathfloatadd@%
+ \pgfmathfloat@install\pgfmathsubtract@=\pgfmathfloatsubtract@%
+ \pgfmathfloat@install\pgfmathneg@=\pgfmathfloatneg@%
+ \pgfmathfloat@install\pgfmathmultiply@=\pgfmathfloatmultiply@%
+ \pgfmathfloat@install\pgfmathdivide@=\pgfmathfloatdivide@%
+ \pgfmathfloat@install\pgfmathabs@=\pgfmathfloatabs@%
+ \pgfmathfloat@install\pgfmathround@=\pgfmathfloatround@%
+ \pgfmathfloat@install\pgfmathfloor@=\pgfmathfloatfloor@%
+ \pgfmathfloat@install\pgfmathmod@=\pgfmathfloatmod@%
+ \pgfmathfloat@install\pgfmathmax@=\pgfmathfloatmax@%
+ \pgfmathfloat@install\pgfmathmin@=\pgfmathfloatmin@%
+ \pgfmathfloat@install\pgfmathsin@=\pgfmathfloatsin@%
+ \pgfmathfloat@install\pgfmathcos@=\pgfmathfloatcos@%
+ \pgfmathfloat@install\pgfmathtan@=\pgfmathfloattan@%
+ \pgfmathfloat@install\pgfmathdeg@=\pgfmathfloatdeg@%
+ \pgfmathfloat@install\pgfmathrad@=\pgfmathfloatrad@%
+ \pgfmathfloat@install\pgfmathatan@=\pgfmathfloatatan@%
+ \pgfmathfloat@install\pgfmathasin@=\pgfmathfloatasin@%
+ \pgfmathfloat@install\pgfmathacos@=\pgfmathfloatacos@%
+ \pgfmathfloat@install\pgfmathcot@=\pgfmathfloatcot@%
+ \pgfmathfloat@install\pgfmathsec@=\pgfmathfloatsec@%
+ \pgfmathfloat@install\pgfmathcosec@=\pgfmathfloatcosec@%
+ \pgfmathfloat@install\pgfmathexp@=\pgfmathfloatexp@%
+ \pgfmathfloat@install\pgfmathln@=\pgfmathfloatln@%
+ \pgfmathfloat@install\pgfmathsqrt@=\pgfmathfloatsqrt@%
+ \pgfmathfloat@install\pgfmath@pi=\pgfmathfloatpi@%
+ \pgfmathfloat@install\pgfmathpi=\pgfmathfloatpi@%
+ \pgfmathfloat@install\pgfmathe@=\pgfmathfloate@%
+ \pgfmathfloat@install\pgfmathe=\pgfmathfloate@%
+ \pgfmathfloat@install\pgfmathlessthan@=\pgfmathfloatlessthan@%
+ \pgfmathfloat@install\pgfmathless@=\pgfmathfloatlessthan@%
+ \pgfmathfloat@install\pgfmathgreaterthan@=\pgfmathfloatgreaterthan@%
+ \pgfmathfloat@install\pgfmathgreater@=\pgfmathfloatgreaterthan@%
+ \pgfmathfloat@install\pgfmathpow@=\pgfmathfloatpow@
+ \pgfmathfloat@install\pgfmathrand@=\pgfmathfloatrand@
+ \pgfmathfloat@install\pgfmathrand=\pgfmathfloatrand@
+ \pgfmathfloat@install\pgfmathrnd@=\pgfmathfloatrnd@
+ \pgfmathfloat@install\pgfmathrnd=\pgfmathfloatrnd@
+ \pgfmathfloat@install\pgfmathtrue@=\pgfmathfloattrue@
+ \pgfmathfloat@install\pgfmathfalse@=\pgfmathfloatfalse@
+ \pgfmathfloat@install\pgfmathnot@=\pgfmathfloatnot@
+ \pgfmathfloat@install\pgfmathhex@=\pgfmathfloathex@
+ \pgfmathfloat@install\pgfmathHex@=\pgfmathfloatHex@
+ \pgfmathfloat@install\pgfmathoct@=\pgfmathfloatoct@
+ \pgfmathfloat@install\pgfmathbin@=\pgfmathfloatbin@
+ \pgfmathfloat@install\pgfmathand@=\pgfmathfloatand@
+ \pgfmathfloat@install\pgfmathor@=\pgfmathfloator@
+ \pgfmathfloat@install\pgfmathfactorial@=\pgfmathfloatfactorial@
+ \pgfmathfloat@install\pgfmathveclen@=\pgfmathfloatveclen@
+ \pgfmathfloat@install\pgfmathcosh@=\pgfmathfloatcosh@
+ \pgfmathfloat@install\pgfmathsinh@=\pgfmathfloatsinh@
+ \pgfmathfloat@install\pgfmathtanh@=\pgfmathfloattanh@
+ \pgfmathfloat@install@unimplemented{ceil}%
+ \pgfmathfloat@install@unimplemented{frac}%
+ \pgfmathfloat@install@unimplemented{log2}%
+ \pgfmathfloat@install@unimplemented{log10}%
+ \pgfmathfloat@install@unimplemented{equalto}%
+ \pgfmathfloat@install@unimplemented{random}%
+ \pgfmathfloat@install@unimplemented{setseed}%
+ \pgfmathfloat@install@unimplemented{Mod}%
+ \pgfmathfloat@install@unimplemented{real}%
+ \pgfmathfloat@install@unimplemented{notequal}%
+% \pgfmathfloat@install@unimplemented{atan2}%
+% \pgfmathfloat@install@unimplemented{height}%
+ %
+ %
+ \pgfmathfloat@install\pgfmathscientific=\pgfmathfloatscientific%
+}
+
+\def\pgfmathfloat@parser@install{%
+ \pgfmathfloat@plots@checkuninstallcmd
+ \pgfmathfloat@plots@install%
+ \pgfmathfloat@parser@install@functions
+ %
+ %
+ %
+ % The following methods actually enable the parser to work with
+ % the internal floating point number representation.
+ %
+ % The idea is as follows:
+ % 1. Every operand must be given in internal float representation.
+ % 2. The internal float repr can be distinguished by a normal
+ % number. This is accomplished by introducing a new "exponent"
+ % token.
+ % 3. The stack-push-operation checks whether the argument is a
+ % float. If not, it is parsed properly before pushing it.
+ \pgfmath@tokens@make{exponent}{\pgfmathfloat@POSTFLAGSCHAR}%
+ \pgfmathfloat@uninstall@appendcmd{%
+ \expandafter\let\csname pgfmath@token@exponent@\pgfmathfloat@POSTFLAGSCHAR\endcsname=\relax
+ }%
+ \let\pgfmath@basic@parse@exponent=\pgfmath@parse@exponent%
+ \let\pgfmath@basic@stack@push@operand=\pgfmath@stack@push@operand
+ \pgfmathfloat@install\pgfmath@stack@push@operand=\pgfmathfloat@stack@push@operand
+ \pgfmathfloat@install\pgfmath@parse@exponent=\pgfmathfloat@parse@float@or@exponent
+ %
+ \pgfmathfloat@install\pgfmathparse=\pgfmathfloatparse%
+}%
+
+\def\pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG#1{%
+ \edef\pgfmathfloat@loc@TMPa{%
+ \noexpand\def\expandafter\noexpand\csname pgfmath@parsefunction@#1\endcsname{%
+ \noexpand\let\noexpand\pgfmath@parsepostgroup\expandafter\noexpand\csname pgfmath@parsefunction@#1@\endcsname%
+ \noexpand\expandafter\noexpand\pgfmath@parse@}%
+ \noexpand\def\expandafter\noexpand\csname pgfmath@parsefunction@#1@\endcsname{%
+ \noexpand\expandafter\expandafter\noexpand\csname pgfmath#1@\endcsname\noexpand\expandafter{\noexpand\pgfmathresult}%
+ \noexpand\pgfmath@postfunction%
+ }%
+ }%
+ \pgfmathfloat@loc@TMPa
+}%
+\def\pgfmathfloat@parser@install@pgf@two@null@null{%
+ \pgfmathfloat@plots@checkuninstallcmd
+ \pgfmathfloat@plots@install%
+ \pgfmathfloat@parser@install@functions
+ \let\pgfmathrand@=\pgfmath@basic@rand@
+ \let\pgfmathrnd@=\pgfmath@basic@rnd@
+ \pgfmathfloat@install\pgfmathmax@=\pgfmathfloatmaxtwo%
+ \pgfmathfloat@install\pgfmathmin@=\pgfmathfloatmintwo%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{factorial}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{hex}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{bin}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{oct}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{tanh}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{sinh}%
+ \pgfmathfloat@defineadapter@for@pgf@two@null@null@ONEARG{cosh}%
+ %
+ % The following methods actually enable the parser to work with
+ % the internal floating point number representation.
+ %
+ % The idea is as follows:
+ % 1. Every operand must be given in internal float representation.
+ % 2. The internal float repr can be distinguished by a normal
+ % number. This is accomplished by introducing a new "exponent"
+ % token.
+ % 3. The stack-push-operation checks whether the argument is a
+ % float. If not, it is parsed properly before pushing it.
+ \let\pgfmath@basic@parsedecimalpoint=\pgfmath@parsedecimalpoint%
+ \let\pgfmath@basic@stack@push@operand=\pgfmath@stackpushoperand
+ \pgfmathfloat@install\pgfmath@stackpushoperand=\pgfmathfloat@stack@push@operand
+ \pgfmathfloat@install\pgfmath@parsedecimalpoint=\pgfmathfloat@parsedecimalpoint@pgf@two@null@null
+ \pgfmathfloat@install\pgfmath@endparse=\pgfmathfloat@endparse@pgf@two@null@null
+ \pgfmathfloat@install\pgfmath@endparsegroup=\pgfmathfloat@endparsegroup@pgf@two@null@null
+ \pgfmathfloat@install\pgfmath@postfunction=\pgfmathfloat@postfunction@pgf@two@null@null
+ \pgfmathfloat@install\pgfmath@@parseoperandgroup=\pgfmathfloat@@parseoperandgroup
+ %
+ \pgfmathfloat@install\pgfmathparse=\pgfmathfloatparse@pgf@two@null@null%
+}%
+
+\pgfutil@ifundefined{pgfmathdeclarefunction}{%
+ % BACKWARDS COMPATIBILITY: We have PGF 2.00 :
+ \def\pgfmathdeclarepseudoconstant#1#2{%
+ \begingroup
+ \toks0=\expandafter{\csname pgfmath#1@\endcsname}%
+ \toks1={\pgfmath@postfunction}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
+ \xdef\pgfmathfloat@glob@TMPb{\the\toks0 }%
+ \endgroup
+ \expandafter\let\csname pgfmath@parsefunction@#1\endcsname=\pgfmathfloat@glob@TMP
+ \expandafter\let\csname pgfmath#1\endcsname=\pgfmathfloat@glob@TMPb
+ \expandafter\def\csname pgfmath#1@\endcsname{#2}%
+ }%
+ \let\pgfmathredeclarepseudoconstant=\pgfmathdeclarepseudoconstant
+}{%
+ \pgfutil@ifundefined{pgfmathdeclarepseudoconstant}{%
+ \def\pgfmathdeclarepseudoconstant#1#2{\pgfmathdeclarefunction*{#1}{0}{#2}}
+ }{}%
+}%
+
+\pgfmathdeclarepseudoconstant{inf}{\def\pgfmathresult{inf}}
+\pgfmathdeclarepseudoconstant{infty}{\def\pgfmathresult{inf}}
+\pgfmathdeclarepseudoconstant{nan}{\def\pgfmathresult{nan}}
+\pgfmathdeclarepseudoconstant{NaN}{\def\pgfmathresult{nan}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Hacks to the basic level pgf math engine:
+%
+% WARNING: These methods rely heavily on the internal float representation!
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% for pgf2.00 :
+\def\pgfmathfloat@parsedecimalpoint@pgf@two@null@null#1{%
+ \expandafter\ifx\pgfmathfloat@POSTFLAGSCHAR#1% check whether it is a float
+ \let\pgfmath@next=\pgfmathfloat@return@float@pgf@two@null@null%
+ \else
+ \def\pgfmath@next{\pgfmath@basic@parsedecimalpoint#1}%
+ \fi
+ \pgfmath@next
+}
+% for pgf2.00:
+\def\pgfmathfloat@return@float@pgf@two@null@null#1]{%
+ \edef\pgfmathresult{\the\c@pgfmath@parsecounta\pgfmathfloat@POSTFLAGSCHAR#1]}%
+ \let\pgfmath@resulttemp=\pgfmathresult
+ \pgfmath@parseoperator%
+}%
+% for pgf2.00:
+\def\pgfmathfloat@endparse@pgf@two@null@null#1\pgfmath@empty{%
+ \pgfmath@processalloperations%
+ \pgfmath@stackpop{\pgfmathresult}%
+ % delete the final unit scalings
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup%
+ \ignorespaces%
+}
+% for pgf2.00:
+\def\pgfmathfloat@endparsegroup@pgf@two@null@null{%
+ \pgfmath@processalloperations%
+ \pgfmath@stackpop{\pgfmathresult}%
+ % eliminated register usage here...
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup%
+ \pgfmath@parsepostgroup%
+}
+% for pgf2.00:
+\def\pgfmathfloat@postfunction@pgf@two@null@null{%
+ \let\pgfmath@parsepostgroup\pgfmath@parseoperator%
+ \ifnum\pgfmath@sign1<0
+ \pgfmathfloatneg@{\pgfmathresult}%
+ \let\pgfmath@sign\pgfutil@empty
+ \fi
+ \pgfmath@parseoperator}
+% for pgf2.00:
+\def\pgfmathfloat@@parseoperandgroup{%
+ \let\pgfmath@postparsegroup\pgfmath@parseoperator%
+ \ifnum\pgfmath@sign1<0
+ \pgfmathfloatneg@{\pgfmathresult}%
+ \let\pgfmath@sign\pgfutil@empty
+ \fi
+ \pgfmath@parseoperator%
+}
+
+
+
+
+
+
+% PRECONDITION:
+% either
+% <number>e
+% ^
+% -> read the exponent.
+% or
+% <sign>\pgfmathfloat@POSTFLAGSCHAR
+% ^
+% -> we have a parsed floating point number -> read it.
+\def\pgfmathfloat@parse@float@or@exponent{%
+ \if\pgfmath@token \pgfmathfloat@POSTFLAGSCHAR%
+ % Ok, we actually HAVE a pre-parsed floating point number!
+ % Return it.
+ \expandafter\pgfmathfloat@return@float\expandafter\pgfmath@token@next
+ \else
+ % We have a standard number in scientific format. Parse it.
+ \expandafter\pgfmath@basic@parse@exponent
+ \fi
+}%
+\def\pgfmathfloat@return@float#1]{%
+ \edef\pgfmathresult{\pgfmath@number \pgfmathfloat@POSTFLAGSCHAR#1]}%
+ \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathresult}%
+ \pgfmath@parse@@operator%
+}%
+
+% This extends the functionality of the basic level operand stack: it
+% assures every element on the stack is a float.
+\def\pgfmathfloat@stack@push@operand#1{%
+ \pgfutil@ifnextchar\bgroup{%
+ \let\pgfmathfloat@stack@push@operand@list@=\pgfutil@empty
+ \pgfmathfloat@stack@push@operand@list
+ }{%
+ \pgfmathfloat@stack@push@operand@single
+ }%
+ #1\relax
+}%
+\def\pgfmathfloat@stack@push@operand@single#1\relax{%
+ \expandafter\pgfutil@in@\pgfmathfloat@POSTFLAGSCHAR{#1}%
+ \ifpgfutil@in@
+ \pgfmath@basic@stack@push@operand{#1}%
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathresult}%
+ \fi
+}%
+\def\pgfmathfloat@stack@push@operand@GOBBLE#1\relax{}%
+\def\pgfmathfloat@stack@push@operand@list#1{%
+ \expandafter\pgfutil@in@ \pgfmathfloat@POSTFLAGSCHAR{#1}%
+ \ifpgfutil@in@
+ \expandafter\def\expandafter\pgfmathfloat@stack@push@operand@list@\expandafter{%
+ \pgfmathfloat@stack@push@operand@list@{#1}%
+ }%
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \begingroup
+ \toks0=\expandafter{\pgfmathfloat@stack@push@operand@list@}%
+ \toks1=\expandafter{\pgfmathresult}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 {\the\toks1}}%
+ \endgroup
+ \let\pgfmathfloat@stack@push@operand@list@=\pgfmathfloat@glob@TMP
+ \fi
+ \pgfutil@ifnextchar\relax{%
+ \expandafter\pgfmath@basic@stack@push@operand\expandafter{\pgfmathfloat@stack@push@operand@list@}%
+ \pgfmathfloat@stack@push@operand@GOBBLE
+ }{%
+ \pgfmathfloat@stack@push@operand@list
+ }%
+}%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% --- END --- Hacks to the basic level pgf math engine
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Here starts the implementation of the floating point
+% routines.
+%
+% They can be used even if the FPU parser is not active.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Remember the basic math commands. They will be invoked as subroutines in floating point routines.
+\let\pgfmath@basic@add@=\pgfmathadd@
+\let\pgfmath@basic@subtract@=\pgfmathsubtract@
+\let\pgfmath@basic@multiply@=\pgfmathmultiply@
+\let\pgfmath@basic@divide@=\pgfmathdivide@
+\let\pgfmath@basic@reciprocal@=\pgfmathreciprocal@
+\let\pgfmath@basic@abs@=\pgfmathabs@
+\let\pgfmath@basic@round@=\pgfmathround@
+\let\pgfmath@basic@rand@=\pgfmathrand@
+\let\pgfmath@basic@rnd@=\pgfmathrnd@
+\let\pgfmath@basic@setseed@=\pgfmathsetseed@
+\let\pgfmath@basic@random@=\pgfmathrandom@
+\let\pgfmath@basic@floor@=\pgfmathfloor@
+\let\pgfmath@basic@ceil@=\pgfmathceil@
+\let\pgfmath@basic@mod@=\pgfmathmod@
+\let\pgfmath@basic@max@=\pgfmathmax@
+\let\pgfmath@basic@min@=\pgfmathmin@
+\let\pgfmath@basic@sin@=\pgfmathsin@
+\let\pgfmath@basic@cos@=\pgfmathcos@
+\let\pgfmath@basic@tan@=\pgfmathtan@
+\let\pgfmath@basic@deg@=\pgfmathdeg@
+\let\pgfmath@basic@rad@=\pgfmathrad@
+\let\pgfmath@basic@atan@=\pgfmathatan@
+\let\pgfmath@basic@asin@=\pgfmathasin@
+\let\pgfmath@basic@acos@=\pgfmathacos@
+\let\pgfmath@basic@cot@=\pgfmathcot@
+\let\pgfmath@basic@sec@=\pgfmathsec@
+\let\pgfmath@basic@cosec@=\pgfmathcosec@
+\let\pgfmath@basic@pow@=\pgfmathpow@
+\let\pgfmath@basic@exp@=\pgfmathexp@
+\let\pgfmath@basic@ln@=\pgfmathln@
+\let\pgfmath@basic@sqrt@=\pgfmathsqrt@
+\let\pgfmath@basic@@pi=\pgfmath@pi
+\let\pgfmath@basic@veclen@=\pgfmathveclen@
+\let\pgfmath@basic@e@=\pgfmathe@
+\let\pgfmath@basic@lessthan@=\pgfmathlessthan@
+\let\pgfmath@basic@greaterthan@=\pgfmathgreaterthan@
+\let\pgfmath@basic@equalto@=\pgfmathequalto@
+\let\pgfmath@basic@true@=\pgfmathtrue@
+\let\pgfmath@basic@false@=\pgfmathfalse@
+
+\def\pgfmathfloatscientific#1#2{%
+ \edef\pgfmathresult{#1e#2}%
+ \expandafter\pgfmathfloatparsenumber\expandafter{\pgfmathresult}%
+}
+% Compares #1 with #2 and sets \pgfmathresult either to 1.0 or 0.0.
+%
+% It also sets the boolean \ifpgfmathfloatcomparison (globally).
+\def\pgfmathfloatlessthan@#1#2{%
+%\def\pgfmathfloatlessthan#1#2#3\and#4#5#6{%
+ \global\pgfmathfloatcomparisonfalse
+ \begingroup
+ \edef\pgfmathfloat@loc@TMPa{#1}%
+ \edef\pgfmathfloat@loc@TMPb{#2}%
+ \expandafter\pgfmathfloat@decompose\pgfmathfloat@loc@TMPa\relax\pgfmathfloat@a@S\pgfmathfloat@a@M\pgfmathfloat@a@E
+ \expandafter\pgfmathfloat@decompose\pgfmathfloat@loc@TMPb\relax\pgfmathfloat@b@S\pgfmathfloat@b@M\pgfmathfloat@b@E
+ \ifcase\pgfmathfloat@a@S
+ % x = 0 -> (x<y <=> y >0)
+ \ifcase\pgfmathfloat@b@S
+ % y = 0
+ \or% y > 0
+ \global\pgfmathfloatcomparisontrue
+ \or% y < 0
+ \or% y = nan
+ \or% y = + infty
+ \global\pgfmathfloatcomparisontrue
+ \or% y = -infty
+ \fi
+ \or
+ % x > 0 -> (x<y <=> ( y > 0 && |x| < |y|) )
+ \ifcase\pgfmathfloat@b@S
+ % y = 0
+ \or% y>0:
+ \pgfmathfloatlessthan@positive
+ \or% y < 0
+ \or% y = nan
+ \or% y = + infty
+ \global\pgfmathfloatcomparisontrue
+ \or% y = -infty
+ \fi
+ \or
+ % x < 0 -> (x<y <=> (y >= 0 || |x| > |y|) )
+ \ifcase\pgfmathfloat@b@S
+ % y = 0
+ \global\pgfmathfloatcomparisontrue
+ \or%y > 0
+ \global\pgfmathfloatcomparisontrue
+ \or% 'y<0':
+ \pgfmathfloatgreaterthan@positive
+ \or% y = nan
+ \or% y = + infty
+ \global\pgfmathfloatcomparisontrue
+ \or% y = -infty
+ \fi
+ \or
+ % x = nan.
+ \or
+ % x = +infty
+ \or
+ % x = -infty
+ \ifnum\pgfmathfloat@b@S=3
+ \else
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \fi
+ \endgroup
+ \ifpgfmathfloatcomparison
+ \def\pgfmathresult{1.0}%
+ \else
+ \def\pgfmathresult{0.0}%
+ \fi
+}
+\let\pgfmathfloatlessthan=\pgfmathfloatlessthan@
+\let\pgfmathfloatless@=\pgfmathfloatlessthan@
+
+% compares \pgfmathfloat@a@[SME] < \pgfmathfloat@b@[SME]
+\def\pgfmathfloatlessthan@positive{%
+ \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E
+ \global\pgfmathfloatcomparisontrue
+ \else
+ \ifnum\pgfmathfloat@a@E=\pgfmathfloat@b@E
+ \ifdim\pgfmathfloat@a@M<\pgfmathfloat@b@M
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \fi
+ \fi
+}
+
+% compares \pgfmathfloat@a@[SME] > \pgfmathfloat@b@[SME]
+\def\pgfmathfloatgreaterthan@positive{%
+ \ifnum\pgfmathfloat@a@E>\pgfmathfloat@b@E
+ \global\pgfmathfloatcomparisontrue
+ \else
+ \ifnum\pgfmathfloat@a@E=\pgfmathfloat@b@E
+ \ifdim\pgfmathfloat@a@M>\pgfmathfloat@b@M
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \fi
+ \fi
+}
+
+
+\def\pgfmathfloatgreaterthan@#1#2{\pgfmathfloatlessthan@{#2}{#1}}
+\let\pgfmathfloatgreaterthan=\pgfmathfloatgreaterthan@
+\let\pgfmathfloatgreater@=\pgfmathfloatgreaterthan@
+
+\def\pgfmathfloatmax@#1{%
+ \begingroup
+ \pgfmathfloatcreate{2}{1.0}{2147483644}%
+ \let\pgfmathmaxsofar=\pgfmathresult
+ \pgfmathfloatmax@@#1{}%
+}%
+\def\pgfmathfloatmax@@#1{%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \expandafter\pgfmathfloatmax@@@%
+ \else%
+ \pgfmathfloatlessthan{\pgfmathmaxsofar}{#1}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathmaxsofar{#1}%
+ \fi
+ \expandafter\pgfmathfloatmax@@%
+ \fi%
+}%
+\def\pgfmathfloatmax@@@{%
+ \let\pgfmathresult=\pgfmathmaxsofar
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup
+}%
+\def\pgfmathfloatmin@#1{%
+ \begingroup
+ \pgfmathfloatcreate{1}{1.0}{2147483644}%
+ \let\pgfmathminsofar=\pgfmathresult
+ \pgfmathfloatmin@@#1{}%
+}%
+\def\pgfmathfloatmin@@#1{%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \expandafter\pgfmathfloatmin@@@%
+ \else%
+ \pgfmathfloatlessthan{#1}{\pgfmathminsofar}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathminsofar{#1}%
+ \fi
+ \expandafter\pgfmathfloatmin@@%
+ \fi%
+}%
+\def\pgfmathfloatmin@@@{%
+ \let\pgfmathresult=\pgfmathminsofar
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup
+}%
+
+\def\pgfmathfloatmaxtwo#1#2{%
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathresult{#2}%
+ \else
+ \edef\pgfmathresult{#1}%
+ \fi
+}
+\let\pgfmathfloatmax=\pgfmathfloatmaxtwo
+
+\def\pgfmathfloatmintwo#1#2{%
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathresult{#1}%
+ \else
+ \edef\pgfmathresult{#2}%
+ \fi
+}
+\let\pgfmathfloatmin=\pgfmathfloatmintwo
+
+% Renormalizes #1 to extended precision mantisse, meaning
+% 100 <= m < 1000
+% instead of 1 <= m < 10.
+%
+% The 'extended precision' means we have higher accuracy when we apply pgfmath operations to mantisses.
+%
+% The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision).
+%
+% The operation is supposed to be very fast.
+%
+% @see \pgfmathfloatsetextprecision
+%
+% There is a routine for internal usage,
+% \pgfmathfloattoextentedprecision@a. It also provides exponent and
+% sign of #1 in output arguments and may be used to increase speed.
+\def\pgfmathfloattoextentedprecision#1{%
+ \begingroup
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \pgfmathfloatcreate{\pgfmathfloat@a@S}{\pgfmathresult}{\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\def\pgfmathfloattoextentedprecision@@zero#1\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{#1}%
+}%
+\def\pgfmathfloattoextentedprecision@@one#1.#2#3\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{#1#2.#3}%
+}%
+\def\pgfmathfloattoextentedprecision@@two#1.#2#3#4\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{#1#2#3.#4}%
+}%
+\def\pgfmathfloattoextentedprecision@@three#1.#2#3#4#5\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{#1#2#3#4.#5}%
+}%
+
+% Sets extended precision to 10^#1.
+%
+% The different choices are
+%
+% - 0: normalization 0 <= m < 1 (disable extended precision)
+% - 1: normalization 10 <= m < 100
+% - 2: normalization 100 <= m < 1000 (default)
+% - 3: normalization 1000 <= m < 10000
+%
+% #1 is the exponent, #1 = 0,1,2 or 3.
+%
+% This setting applies to \pgfmathfloattoextentedprecision and friends.
+\def\pgfmathfloatsetextprecision#1{%
+ \ifcase#1\relax
+ \let\pgfmathfloattoextentedprecision@@=\pgfmathfloattoextentedprecision@@zero
+ \def\pgfmathfloatextprec@shift{0}%
+ \or
+ \let\pgfmathfloattoextentedprecision@@=\pgfmathfloattoextentedprecision@@one
+ \def\pgfmathfloatextprec@shift{1}%
+ \or
+ \let\pgfmathfloattoextentedprecision@@=\pgfmathfloattoextentedprecision@@two
+ \def\pgfmathfloatextprec@shift{2}%
+ \else
+ \let\pgfmathfloattoextentedprecision@@=\pgfmathfloattoextentedprecision@@three
+ \def\pgfmathfloatextprec@shift{3}%
+ \fi
+}%
+\pgfmathfloatsetextprecision{2}%
+
+% Does the "hard" work for \pgfmathfloattoextentedprecision. It
+% provides additional outputs.
+%
+% INPUT:
+% #1 normalized floating point number. Maybe a macro (it will be expanded ONCE)
+%
+% OUTPUT:
+% - \pgfmathresult : the mantisse in extended precision
+% - \pgfmathfloat@a@S : the sign of #1
+% - \pgfmathfloat@a@E : the exponent of #1, adjusted for extended precision
+% - \pgfmathfloat@a@Mtok : undefined (its contents will be destroyed.
+%
+\def\pgfmathfloattoextentedprecision@a#1{%
+ \edef\pgfmathresult{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifnum\pgfmathfloat@a@S<3
+ \advance\pgfmathfloat@a@E by-\pgfmathfloatextprec@shift\relax% compensate for shift
+ \expandafter\pgfmathfloattoextentedprecision@@\the\pgfmathfloat@a@Mtok 000\pgfmathfloat@EOI
+ \fi
+}%
+
+
+% Similar to \pgfmathfloattoextentedprecision@a, this one here fills the '@b' registers.
+\def\pgfmathfloattoextentedprecision@b#1{%
+ \edef\pgfmathresult{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@b@E
+ \ifnum\pgfmathfloat@b@S<3
+ \advance\pgfmathfloat@b@E by-\pgfmathfloatextprec@shift\relax
+ \expandafter\pgfmathfloattoextentedprecision@@\the\pgfmathfloat@a@Mtok 00\pgfmathfloat@EOI
+ \fi
+}%
+
+% Addition of two floating point numbers using 8 significant digits.
+\def\pgfmathfloatadd@#1#2{%
+ \begingroup
+ %
+ % renormalize argument to 100 <= m < 1000 for extended accuracy:
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \pgfmathfloattoextentedprecision@b{#2}%
+ \let\pgfmathfloat@argb=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ \edef\pgfmathresult{#2}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@arga{-\pgfmathfloat@arga}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{0.0}{0}%
+ \fi
+ \ifcase\pgfmathfloat@b@S
+ \edef\pgfmathresult{#1}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@argb{-\pgfmathfloat@argb}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@b@S}{0.0}{0}%
+ \fi
+ \ifpgfmathfloatcomparison
+ % Shift lesser mantisse to fit the larger one:
+ \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E
+ \pgfmathfloatadd@shift{\pgfmathfloat@arga}{\pgfmathfloat@a@E}{\pgfmathfloat@b@E}%
+ \else
+ \pgfmathfloatadd@shift{\pgfmathfloat@argb}{\pgfmathfloat@b@E}{\pgfmathfloat@a@E}%
+ \fi
+ % add them!
+ \pgfmath@basic@add@{\pgfmathfloat@arga}{\pgfmathfloat@argb}%
+ % renormalize sum. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% #1= floating point number
+% #2= TeX code to execute if #1 == 0
+% #3= TeX code to execute if #1 != 0
+\def\pgfmathfloatifzero#1#2#3{%
+ \pgfmathfloatgetflagstomacro{#1}\pgfmathfloat@loc@TMPa
+ \if\pgfmathfloat@loc@TMPa0 #2\else#3\fi
+}%
+
+\def\pgfmathfloatiffinite#1#2#3{%
+ \pgfmathfloatgetflagstomacro{#1}\pgfmathfloatiffinite@
+ \ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi
+}%
+
+
+% Computes the relative error between #1 and #2 (assuming #2 != 0) and
+% invokes #3 if the relative error is below `/pgf/fpu/rel thresh' and
+% #4 if that is not the case.
+\long\def\pgfmathfloatifapproxequalrel#1#2#3#4{%
+ \begingroup
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfmathfloatarga=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\pgfmathfloatargb=\pgfmathresult
+ \pgfmathfloatrelerror@\pgfmathfloatarga\pgfmathfloatargb
+ \let\pgfmathfloatarga=\pgfmathresult
+ \pgfmathfloatlessthan@\pgfmathfloatarga\pgfmathfloat@relthresh
+ \ifpgfmathfloatcomparison
+ \def\pgfmathfloat@loc@TMPa{#3}%
+ \else
+ \def\pgfmathfloat@loc@TMPa{#4}%
+ \fi
+ \expandafter\endgroup
+ \pgfmathfloat@loc@TMPa
+}%
+
+% Invokes code '#3' if the flags of the floating point number '#1'
+% match the flag provided in '#2'.
+%
+% \pgfmathfloatcreate{1}{1.0}{2}
+% \pgfmathfloatifflags{\pgfmathresult}{0}{It's zero!}{It's not zero!}%
+% \pgfmathfloatifflags{\pgfmathresult}{1}{It's positive!}{It's not positive!}%
+% \pgfmathfloatifflags{\pgfmathresult}{2}{It's negative!}{It's not negative!}%
+% or, equivalently
+% \pgfmathfloatifflags{\pgfmathresult}{+}{It's positive!}{It's not positive!}%
+% \pgfmathfloatifflags{\pgfmathresult}{-}{It's negative!}{It's not negative!}%
+% it also supports #2=u which means 'unbounded'
+\def\pgfmathfloatifflags#1#2#3#4{%
+ \if#2-%
+ \pgfmathfloatifflags{#1}{2}{#3}{#4}%
+ \else
+ \if#2+%
+ \pgfmathfloatifflags{#1}{1}{#3}{#4}%
+ \else
+ \pgfmathfloatgetflagstomacro#1\pgfmathfloat@loc@TMPa
+ \if#2u%
+ \ifnum\pgfmathfloat@loc@TMPa>2
+ #3\relax
+ \else
+ #4\relax
+ \fi
+ \else
+ \if\pgfmathfloat@loc@TMPa#2
+ #3\relax
+ \else
+ #4\relax
+ \fi
+ \fi
+ \fi
+ \fi
+}%
+
+% #1=mantisse which needs to be shifted (with smaller exponent)
+% #2=smaller exponent
+% #3=larger exponent
+%
+% ATTENTION: this helper method DESTROYS contents of \pgfmathfloat@a@S.
+\def\pgfmathfloatadd@shift#1#2#3{%
+ \pgf@xa=#1 pt%
+ \pgfmathfloat@a@S=#3\relax
+ \advance\pgfmathfloat@a@S by-#2\relax
+ \ifcase\pgfmathfloat@a@S
+ \or
+ \divide\pgf@xa by10\relax
+ \or
+ \divide\pgf@xa by100\relax
+ \or
+ \divide\pgf@xa by1000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by10\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by100\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by1000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by10000\relax
+ \else
+ \pgf@xa=0pt%
+ \fi
+ #2=#3\relax
+ \edef#1{\pgf@sys@tonumber\pgf@xa}%
+}
+
+\let\pgfmathfloatadd=\pgfmathfloatadd@
+
+
+% Subtracts two floating point numbers.
+\def\pgfmathfloatsubtract@#1#2{%
+ \begingroup
+ \edef\pgfmathresult{#2}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@b@E
+ \ifcase\pgfmathfloat@b@S
+ \edef\pgfmathresult{#1}%
+ \or
+ \pgfmathfloatcreate{2}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@b@E}%
+ \let\pgfmathfloatsub@arg=\pgfmathresult
+ \pgfmathfloatadd@{#1}{\pgfmathfloatsub@arg}%
+ \or
+ \pgfmathfloatcreate{1}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@b@E}%
+ \let\pgfmathfloatsub@arg=\pgfmathresult
+ \pgfmathfloatadd@{#1}{\pgfmathfloatsub@arg}%
+ \else
+ \pgfmathfloatcreate{\the\pgfmathfloat@b@S}{0.0}{0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\let\pgfmathfloatsubtract=\pgfmathfloatsubtract@
+
+% Scales a floating point number #1 with a fixed point number #2 using pgfmathmultiply.
+%
+% Use this method if #2 is small number.
+\def\pgfmathfloatmultiplyfixed@#1#2{%
+ \begingroup
+ %
+ % renormalize argument to 100 <= m < 1000 for extended accuracy:
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ \edef\pgfmathresult{#1}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@arga{-\pgfmathfloat@arga}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{0.0}{0}%
+ \fi
+ \ifpgfmathfloatcomparison
+ \pgfmath@basic@multiply@{\pgfmathfloat@arga}{#2}%
+ % renormalize product. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\let\pgfmathfloatmultiplyfixed=\pgfmathfloatmultiplyfixed@
+
+
+\def\pgfmathfloatmultiply@#1#2{%
+ \begingroup
+ \pgfmathfloatsetextprecision{1}%
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \pgfmathfloattoextentedprecision@b{#2}%
+ \let\pgfmathfloat@argb=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ % 0
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or% +
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \def\pgfmathresult@S{1}%
+ \or
+ \def\pgfmathresult@S{2}%
+ \else
+ \expandafter\pgfmathfloatcreate\the\pgfmathfloat@b@S{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% -
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \def\pgfmathresult@S{2}%
+ \or
+ \def\pgfmathresult@S{1}%
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% nan
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or% +infty
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% -infty
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \fi
+ \ifpgfmathfloatcomparison
+ \pgfmath@basic@multiply@{\pgfmathfloat@arga}{\pgfmathfloat@argb}%
+ \advance\pgfmathfloat@a@E by\pgfmathfloat@b@E
+ % renormalize sum. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatcreate{\pgfmathresult@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatmultiply=\pgfmathfloatmultiply@
+
+% Defines \pgfmathresult to be #1 / #2 for two floating point numbers.
+%
+% It employs the basic math engine internally to divide mantissas.
+\def\pgfmathfloatdivide@#1#2{%
+ \begingroup
+ \pgfmathfloatsetextprecision{1}% is not too important, I think. After all, 0.1 <= #1/#2 < 10 or so due to normalization (no matter, which)
+ \edef\pgfmathfloat@arga{#1}%
+ \pgfmathfloattoextentedprecision@a{\pgfmathfloat@arga}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \edef\pgfmathfloat@argb{#2}%
+ \pgfmathfloattoextentedprecision@b{\pgfmathfloat@argb}%
+ \let\pgfmathfloat@argb=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ % 0
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or% +
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \def\pgfmathresult@S{1}%
+ \or
+ \def\pgfmathresult@S{2}%
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \else
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% -
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \def\pgfmathresult@S{2}%
+ \or
+ \def\pgfmathresult@S{1}%
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \else
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% nan
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or% +infty
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}% what is inf/inf ?
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}% or inf/-inf ?
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \or% -infty
+ \ifcase\pgfmathfloat@b@S
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{5}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \pgfmathfloatcomparisonfalse
+ \fi
+ \fi
+ \ifpgfmathfloatcomparison
+ \pgfmath@basic@divide@{\pgfmathfloat@arga}{\pgfmathfloat@argb}%
+ \advance\pgfmathfloat@a@E by-\pgfmathfloat@b@E
+ % renormalize. This is the only part were an expensive float routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ % And re-insert the proper sign:
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatcreate{\pgfmathresult@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatdivide=\pgfmathfloatdivide@
+
+\def\pgfmathfloatreciprocal@#1{%
+ \begingroup
+ % FIXME optimize
+ \edef\pgfmathfloat@loc@TMPa{#1}%
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \pgfmathfloatdivide@{\pgfmathresult}{\pgfmathfloat@loc@TMPa}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% Computes sqrt(#1) in floating point arithmetics.
+%
+% It employs sqrt( m * 10^e ) = sqrt(m) * sqrt(10^e).
+\def\pgfmathfloatsqrt@#1{%
+ \begingroup
+ \pgfmathfloatsetextprecision{3}%
+ \edef\pgfmathfloat@arga{#1}%
+ \pgfmathfloattoextentedprecision@a{\pgfmathfloat@arga}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \ifcase\pgfmathfloat@a@S
+ % 0
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \or% +
+ \pgfmath@basic@sqrt@{\pgfmathfloat@arga}%
+ \ifodd\pgfmathfloat@a@E
+ \ifnum\pgfmathfloat@a@E>0
+ \expandafter\pgfmath@basic@multiply@\expandafter{\pgfmathresult}{3.16227766}% * sqrt(10)
+ \else
+ \expandafter\pgfmath@basic@multiply@\expandafter{\pgfmathresult}{0.316227766}% * sqrt(0.1)
+ \fi
+ \fi
+ \divide\pgfmathfloat@a@E by2 % sqrt(10^e) = 10^{e/2} (see above for odd e)
+ % renormalize sum. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathfloat@arga{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \pgfmathfloatqparsenumber{\pgfmathfloat@arga}%
+ \or% -
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \or% nan
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \or% +infty
+ \pgfmathfloatcreate{4}{0.0}{0}%
+ \or% -infty
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatsqrt=\pgfmathfloatsqrt@
+
+% Returns the integer part of the floating point number #1.
+%
+% The result is returned as floating point as well.
+%
+% This operation is not limited to TeX's range of count registers (it
+% works symbolly)
+%
+% @see \pgfmathfloattoint
+\def\pgfmathfloatint@#1{%
+ \begingroup
+ \edef\pgfmathresult{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ % 0: nothing to do.
+ \or% +
+ \expandafter\pgfmathfloatint@@\the\pgfmathfloat@a@Mtok\pgfmathfloat@EOI
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \or% -
+ \expandafter\pgfmathfloatint@@\the\pgfmathfloat@a@Mtok\pgfmathfloat@EOI
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \else
+ % nothing to do
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfmathfloatint@@#1.{%
+ \ifnum\pgfmathfloat@a@E<0
+ \pgfmathfloat@a@S=0
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0
+ \expandafter\pgfmathfloatint@@loop@gobble
+ \else
+ \pgfmathfloat@a@Mtok={#1.}%
+ \pgfmathfloat@b@E=\pgfmathfloat@a@E
+ \expandafter\pgfmathfloatint@@loop
+ \fi
+}%
+\def\pgfmathfloatint@@loop#1{%
+ \def\pgfmathfloatint@@loop@{#1}%
+ \ifx\pgfmathfloatint@@loop@\pgfmathfloat@EOI
+ \let\pgfmathfloatint@@loop@next=\relax
+ \else
+ \ifnum\pgfmathfloat@b@E=0
+ \let\pgfmathfloatint@@loop@next=\pgfmathfloatint@@loop@gobble
+ \else
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \advance\pgfmathfloat@b@E by-1
+ \let\pgfmathfloatint@@loop@next=\pgfmathfloatint@@loop
+ \fi
+ \fi
+ \pgfmathfloatint@@loop@next
+}%
+\def\pgfmathfloatint@@loop@gobble#1\pgfmathfloat@EOI{}%
+\let\pgfmathfloatint=\pgfmathfloatint@
+\let\pgfmathfloatfloor=\pgfmathfloatint
+\let\pgfmathfloatfloor@=\pgfmathfloatint@
+
+\def\pgfmathfloat@notimplemented#1{%
+ \pgfmath@error{Sorry, the operation '#1' has not yet been implemented in the floating point unit :-(}{}%
+ \pgfmathfloatcreate{0}{0.0}{0}%
+}%
+
+% Divides or multiplies the input number by 10^#4 using an arithmetic
+% left/right shift.
+%
+% Input:
+% #1 a normalised floating point number.
+% #2 a positive or negative integer number denoting the shift.
+%
+% Example:
+% \pgfmathfloatshift{11e3}{4}%
+% -> pgfmathresult = 11e7
+\def\pgfmathfloatshift@#1#2{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \advance\pgfmathfloat@a@E by#2\relax
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloatshift=\pgfmathfloatshift@
+
+% Defines \pgfmathresult to be |#1|, the absolute value of the
+% normalized floating point number #1.
+\def\pgfmathfloatabs@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ % 0: do nothing.
+ \or
+ % +: ok, is positive.
+ \or
+ % -: multiply with -1:
+ \pgfmathfloat@a@S=1
+ \or
+ % nan: do nothing.
+ \or
+ % +infty: ok.
+ \or
+ % -infty: multiply with -1:
+ \pgfmathfloat@a@S=4
+ \fi
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatabs=\pgfmathfloatabs@
+
+% Computes the absolute error |#1 - #2| into \pgfmathresult.
+\def\pgfmathfloatabserror@#1#2{%
+ \pgfmathfloatsubtract@{#1}{#2}%
+ \pgfmathfloatabs@{\pgfmathresult}%
+}%
+\let\pgfmathfloatabserror=\pgfmathfloatabserror@
+
+% Computes the relative error |#1 - #2|/|#2| into \pgfmathresult,
+% assuming #2 != 0.
+\def\pgfmathfloatrelerror@#1#2{%
+ \pgfmathfloatsubtract@{#1}{#2}%
+ \pgfmathfloatdivide@{\pgfmathresult}{#2}%
+ \pgfmathfloatabs@{\pgfmathresult}%
+}%
+\let\pgfmathfloatrelerror=\pgfmathfloatrelerror@
+
+% Computes \pgfmathresult = #1 mod #2 using truncated division.
+%
+\def\pgfmathfloatmod@#1#2{%
+ \begingroup
+ \pgfmathfloatdivide@{#1}{#2}%
+ \pgfmathfloatint@{\pgfmathresult}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatmultiply@{\pgfmathfloat@loc@TMPa}{#2}%
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \pgfmathfloatsubtract@{#1}{\pgfmathfloat@loc@TMPb}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloatmod=\pgfmathfloatmod@
+
+
+% A modification of \pgfmathfloatmod@ where #3 = 1/#2 is already
+% known. This may be faster.
+\def\pgfmathfloatmodknowsinverse@#1#2#3{%
+ \begingroup
+ \pgfmathfloatmultiply@{#1}{#3}%
+ \pgfmathfloatint@{\pgfmathresult}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatmultiply@{\pgfmathfloat@loc@TMPa}{#2}%
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \pgfmathfloatsubtract@{#1}{\pgfmathfloat@loc@TMPb}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloatmodknowsinverse=\pgfmathfloatmodknowsinverse@
+
+\def\pgfmathfloatpi@{%
+ \pgfmathfloatcreate{1}{3.14159265358979}{0}%
+}%
+\let\pgfmathfloatpi=\pgfmathfloatpi@
+
+\def\pgfmathfloate@{%
+ \pgfmathfloatcreate{1}{2.71828182845905}{0}%
+}
+\let\pgfmathfloate=\pgfmathfloate@
+
+% Converts #1 from radians to degrees.
+\def\pgfmathfloatdeg@#1{%
+ \expandafter\ifx\csname pgfmfltdeg@factor\endcsname\relax
+ % Lazy evaluation:
+ \pgfmathfloatcreate{1}{5.72957795130823}{1}%
+ \global\let\pgfmfltdeg@factor=\pgfmathresult
+ \fi
+ \pgfmathfloatmultiply@{#1}\pgfmfltdeg@factor%
+}
+\let\pgfmathfloatdeg=\pgfmathfloatdeg@
+
+% Converts #1 from degree to radians.
+\def\pgfmathfloatrad@#1{%
+ \expandafter\ifx\csname pgfmfltrad@factor\endcsname\relax
+ % Lazy evaluation:
+ \pgfmathfloatcreate{1}{1.74532925199433}{-2}%
+ \global\let\pgfmfltrad@factor=\pgfmathresult
+ \fi
+ \pgfmathfloatmultiply@{#1}\pgfmfltrad@factor%
+}
+\let\pgfmathfloatrad=\pgfmathfloatrad@
+
+% Computes #1(#2) where #1 is a trigonometric function, i.e.
+% #1(#2) = #1( #2 + r*360 )
+%
+% #1 is a one-argument macro which assigns \pgfmathresult.
+\def\pgfmathfloatTRIG@#1#2{%
+ \expandafter\ifx\csname pgfmathfloatTRIG@NUM\endcsname\relax%
+ % Lazy evaluation:
+ \pgfmathfloatcreate{1}{3.6}{2}%
+ \global\let\pgfmathfloatTRIG@NUM=\pgfmathresult
+ \pgfmathfloatcreate{1}{2.77777777777778}{-3}%
+ \global\let\pgfmathfloatTRIG@NUM@INV=\pgfmathresult
+ \fi
+ \pgfmathfloatmodknowsinverse@{#2}{\pgfmathfloatTRIG@NUM}{\pgfmathfloatTRIG@NUM@INV}%
+ \pgfmathfloattofixed@{\pgfmathresult}%
+ \expandafter#1\expandafter{\pgfmathresult}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+}%
+
+\def\pgfmathfloatsin@#1{\pgfmathfloatTRIG@\pgfmath@basic@sin@{#1}}
+\let\pgfmathfloatsin=\pgfmathfloatsin@
+\def\pgfmathfloatcos@#1{\pgfmathfloatTRIG@\pgfmath@basic@cos@{#1}}
+\let\pgfmathfloatcos=\pgfmathfloatcos@
+\def\pgfmathfloattan@#1{%
+ % compute sin(#1) / cos(#1)
+ \begingroup
+ \pgfmathfloatcos@{#1}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatsin@{#1}%
+ \expandafter\pgfmathfloatdivide@\expandafter{\pgfmathresult}{\pgfmathfloat@loc@TMPa}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloattan=\pgfmathfloattan@
+
+\def\pgfmathfloatcot@#1{%
+ % compute cos(#1) / sin(#1)
+ \begingroup
+ \pgfmathfloatsin@{#1}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatcos@{#1}%
+ \expandafter\pgfmathfloatdivide@\expandafter{\pgfmathresult}{\pgfmathfloat@loc@TMPa}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatcot=\pgfmathfloatcot@
+
+\def\pgfmathfloatatan@#1{%
+ \begingroup
+ \expandafter\ifx\csname pgfmathfloatatan@TMP\endcsname\relax%
+ \pgfmathfloatcreate{1}{1.6}{4}%
+ \global\let\pgfmathfloatatan@TMP=\pgfmathresult
+ \pgfmathfloatcreate{2}{1.6}{4}%
+ \global\let\pgfmathfloatatan@TMPB=\pgfmathresult
+ \fi
+ \pgfmathfloatgreaterthan@{#1}{\pgfmathfloatatan@TMP}%
+ \ifpgfmathfloatcomparison
+ \pgfmathfloatcreate{1}{9.0}{1}%
+ \else
+ \pgfmathfloatlessthan{#1}{\pgfmathfloatatan@TMPB}%
+ \ifpgfmathfloatcomparison
+ \pgfmathfloatcreate{2}{9.0}{1}%
+ \else
+ \pgfmathfloattofixed@{#1}%
+ \expandafter\pgfmath@basic@atan@\expandafter{\pgfmathresult}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \fi
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloatatan=\pgfmathfloatatan@
+
+\def\pgfmathfloatsec@#1{\pgfmathfloatTRIG@\pgfmath@basic@cos@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}
+\let\pgfmathfloatsec=\pgfmathfloatsec@
+\def\pgfmathfloatcosec@#1{\pgfmathfloatTRIG@\pgfmath@basic@sin@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}
+\let\pgfmathfloatcosec=\pgfmathfloatcosec@
+
+% Expands #2 using \edef and invokes #1 with the resulting string.
+%
+% DEPRECATED
+% Example:
+% \pgfmath@y=7.9pt
+% \pgfmathlog@invoke@expanded\pgfmathexp@{{\pgf@sys@tonumber{\pgfmath@y}}}%
+% will invoke
+% \pgfmathexp@{7.9}
+\def\pgfmathlog@invoke@expanded#1#2{%
+ \edef\pgfmath@resulttemp{#2}%
+ \expandafter#1\pgfmath@resulttemp
+}
+
+\def\pgfmathfloatln@#1{%
+ \pgfmathlog@float{#1}%
+ \ifx\pgfmathresult\pgfutil@empty
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \fi
+}
+\let\pgfmathfloatln=\pgfmathfloatln@
+
+% Computes log(x) into \pgfmathresult.
+%
+% This allows numbers such at 10000000 or 5.23e-10 to be represented
+% properly, although TeX-registers would produce overflow/underflow
+% errors in these cases.
+%
+% The natural logarithm is computed using log(X*10^Y) = log(X) + log(10)*Y
+%
+% FIXME This routine is only kept for backwards compatibility!
+% It does not work as expected because
+% 1. it calls \pgfmathfloatparsenumber
+% 2. it returns the result as fixed point number
+% Use \pgfmathln@ instead!
+\def\pgfmathlog@#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathlog@float{\pgfmathresult}%
+}
+\let\pgfmathlog=\pgfmathlog@
+\def\pgfmathlog@float#1{%
+ \begingroup%
+ % compute #1 = M*10^E with normalised mantisse M = [+-]*[1-9].XXXXX
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifnum\pgfmathfloat@a@S=1
+ % Now, compute log(#1) = log(M) + E*log(10)
+ \expandafter\pgfmath@basic@ln@\expandafter{\the\pgfmathfloat@a@Mtok}%
+ \pgfmathfloat@b@M=\pgfmathresult pt%
+ \pgfmathfloat@a@M=2.302585pt% = log(10)
+ \multiply\pgfmathfloat@a@M by\pgfmathfloat@a@E\relax
+ \advance\pgfmathfloat@b@M by\pgfmathfloat@a@M
+ \edef\pgfmathresult{\pgf@sys@tonumber{\pgfmathfloat@b@M}}%
+ \else
+ \let\pgfmathresult=\pgfutil@empty%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup%
+}
+
+
+% Computes exp(#1) in floating point.
+%
+% The algorithm employs the identity
+% exp(x) = exp(x - log(10^k) + log(10^k)
+% = 10^k exp( x - k*log 10 )
+% with k choosen such that exp( x - k*log10) can be computed with the
+% basic level math engine.
+%
+% The precision (relative error) is between 10^{-4} and 10^{-6}. For
+% #1 = 700, it is even 10^{-3}. I will need to improve that someday.
+\def\pgfmathfloatexp@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ % #1 = 0:
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \or% #1 > 0
+ \pgfmathfloatexp@@{#1}%
+ \or% #1 < 0
+ \pgfmathfloatexp@@{#1}%
+ \else
+ \edef\pgfmathresult{#1}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfmathfloatexp@@#1{%
+ % Employ the identity
+ % exp(x) = exp(x - log(10^k) + log(10^k)) = 10^k exp( x - k *log(10))
+ %
+ % I'd like to have x - k*log(10) <= 1
+ % => compute k := int( (x - 1) * 1/log(10) )
+ % that should suffice since \pgfmathexp@ should be
+ % accurate enough for those numbers.
+ %
+ % please note that we can do all this in TeX registers.
+ % exp(700) is almost the maximum of double precision
+ % anyway, and exp(16000) is certainly the largest we will
+ % ever need.
+ \pgfmathfloattofixed@{#1}%
+ \pgf@xa=\pgfmathresult pt
+ \pgf@xa=0.434294481\pgf@xa\relax
+ \edef\pgfmathfloat@loc@TMPa{\pgf@sys@tonumber{\pgf@xa}}%
+ \expandafter\pgfmathfloatexp@@toint\pgfmathfloat@loc@TMPa\relax
+ \pgf@xa=2.302585092pt
+ \multiply\pgf@xa by-\pgfmathfloat@k\relax
+ \advance\pgf@xa by\pgfmathresult pt
+ \edef\pgfmathfloat@loc@TMPa{\pgf@sys@tonumber{\pgf@xa}}%
+%\message{computing exp(\pgfmathresult) = 10^\pgfmathfloat@k * exp(\pgfmathfloat@loc@TMPa)...}%
+ \pgfmath@basic@exp@{\pgfmathfloat@loc@TMPa}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatparsenumber{\pgfmathfloat@loc@TMPa}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatshift@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@k}%
+}
+% determine 'k'. This is a heuristics. The exponential series
+% converges best for |x| <= 1. However, the fixed point arithmetics
+% for tex results in best results for large |x|. Well, I'll need to
+% tune this here.
+\def\pgfmathfloatexp@@toint#1.#2\relax{%
+ \c@pgf@counta=#1\relax
+ \ifnum\c@pgf@counta<0
+\advance\c@pgf@counta by-1 % FIXME . this is a test for optimizations.
+ \c@pgf@countb=#2\relax
+ \ifnum\c@pgf@countb>0
+ \advance\c@pgf@counta by-1
+ \fi
+ \fi
+ \edef\pgfmathfloat@k{\the\c@pgf@counta}%
+}%
+\let\pgfmathfloatexp=\pgfmathfloatexp@
+
+\def\pgfmathfloatround@#1{%
+ \begingroup
+ \pgfkeysvalueof{/pgf/number format/precision/.@cmd}0\pgfeov
+ \pgfmathfloattofixed{#1}%
+ \pgfmathroundto{\pgfmathresult}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+
+\def\pgfmathfloatneg@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S\relax
+ % 0:
+ \edef\pgfmathresult{#1}%
+ \or
+ % +:
+ \pgfmathfloatcreate{2}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \or
+ % -:
+ \pgfmathfloatcreate{1}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \or
+ % nan:
+ \edef\pgfmathresult{#1}%
+ \or
+ % +infty:
+ \pgfmathfloatcreate{5}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \or
+ % -infty:
+ \pgfmathfloatcreate{4}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+
+\def\pgfmathfloatpow@#1#2{%
+ \begingroup%
+ \expandafter\pgfmathfloat@decompose@tok#2\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S\relax
+ % #1 ^ 0 = 1
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \or
+ % #2 > 0
+ \pgfmathfloatpow@@{#1}{#2}%
+ \or
+ % #2 < 0
+ \pgfmathfloatpow@@{#1}{#2}%
+ \or
+ % #2 = nan
+ \edef\pgfmathresult{#2}%
+ \or
+ % #2 = inf
+ \edef\pgfmathresult{#2}%
+ \or
+ % #2 = -inf
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% computes #1^#2
+% PRECONDITIONS
+% - #2 is positive.
+\def\pgfmathfloatpow@@#1#2{%
+ \pgfmathfloattofixed@{#2}%
+ \afterassignment\pgfmath@x%
+ \expandafter\c@pgfmath@counta\pgfmathresult pt\relax%
+ \ifdim\pgfmath@x=0pt %
+ % loop "manually"; we have an integer exponent!
+ \ifnum\c@pgfmath@counta<0
+ \pgfmathfloatreciprocal@{#1}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \c@pgfmath@counta=-\c@pgfmath@counta
+ \else
+ \edef\pgfmathfloat@loc@TMPa{#1}%
+ \fi
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \pgfmathloop
+ \ifnum\c@pgfmath@counta>0\relax%
+ \ifodd\c@pgfmath@counta%
+ \pgfmathfloatmultiply@{\pgfmathfloat@loc@TMPb}{\pgfmathfloat@loc@TMPa}%
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \fi
+ \ifnum\c@pgfmath@counta>1\relax%
+ \pgfmathfloatmultiply@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPa}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \fi%
+ \divide\c@pgfmath@counta by2\relax%
+ \repeatpgfmathloop%
+ \else
+ % employ #1^#2 = exp( #2 * ln(#1) )
+ \pgfmathfloatln@{#1}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \edef\pgfmathfloat@loc@TMPb{#2}%
+ \pgfmathfloatmultiply@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPb}%
+ \pgfmathfloatexp@{\pgfmathresult}%
+ \fi
+}
+
+\def\pgfmathfloat@definemethodfrombasic@NOARG#1{%
+ \pgfutil@ifundefined{pgfmath@basic@#1@}{%
+ \pgfutil@namelet{pgfmath@basic@#1@}{pgfmath#1@}%
+ }{}%
+ \edef\pgfmathfloat@glob@TMP{%
+ \expandafter\noexpand\csname pgfmath@basic@#1@\endcsname
+ \noexpand\pgfmathfloatparsenumber{\noexpand\pgfmathresult}%
+ }%
+ \expandafter\let\csname pgfmathfloat#1@\endcsname=\pgfmathfloat@glob@TMP%
+ \expandafter\let\csname pgfmathfloat#1\endcsname=\pgfmathfloat@glob@TMP%
+}%
+\def\pgfmathfloat@definemethodfrombasic@ONEARG#1{%
+ \pgfutil@ifundefined{pgfmath@basic@#1@}{%
+ \pgfutil@namelet{pgfmath@basic@#1@}{pgfmath#1@}%
+ }{}%
+ \edef\pgfmathfloat@glob@TMP##1{%
+ \noexpand\pgfmathfloattofixed{##1}%
+ \noexpand\expandafter
+ \expandafter\noexpand\csname pgfmath@basic@#1@\endcsname\noexpand\expandafter%
+ {\noexpand\pgfmathresult}%
+ \noexpand\pgfmathfloatparsenumber{\noexpand\pgfmathresult}%
+ }%
+ \expandafter\let\csname pgfmathfloat#1@\endcsname=\pgfmathfloat@glob@TMP%
+ \expandafter\let\csname pgfmathfloat#1\endcsname=\pgfmathfloat@glob@TMP%
+}%
+\def\pgfmathfloat@definemethodfrombasic@TWOARGS#1{%
+ \pgfutil@ifundefined{pgfmath@basic@#1@}{%
+ \pgfutil@namelet{pgfmath@basic@#1@}{pgfmath#1@}%
+ }{}%
+ \edef\pgfmathfloat@glob@TMP##1##2{%
+ \noexpand\pgfmathfloattofixed{##2}%
+ \noexpand\let\noexpand\pgfmathfloat@loc@TMPa=\noexpand\pgfmathresult
+ \noexpand\pgfmathfloattofixed{##1}%
+ \noexpand\expandafter
+ \expandafter\noexpand\csname pgfmath@basic@#1@\endcsname\noexpand\expandafter%
+ {\noexpand\pgfmathresult}{\noexpand\pgfmathfloat@loc@TMPa}%
+ \noexpand\pgfmathfloatparsenumber{\noexpand\pgfmathresult}%
+ }%
+ \expandafter\let\csname pgfmathfloat#1@\endcsname=\pgfmathfloat@glob@TMP%
+ \expandafter\let\csname pgfmathfloat#1\endcsname=\pgfmathfloat@glob@TMP%
+}%
+\pgfmathfloat@definemethodfrombasic@NOARG{rand}
+\pgfmathfloat@definemethodfrombasic@NOARG{rnd}
+\pgfmathfloat@definemethodfrombasic@NOARG{false}
+\pgfmathfloat@definemethodfrombasic@NOARG{true}
+% arcsin, arccos
+\pgfmathfloat@definemethodfrombasic@ONEARG{asin}
+\pgfmathfloat@definemethodfrombasic@ONEARG{acos}
+\pgfmathfloat@definemethodfrombasic@ONEARG{not}
+\pgfmathfloat@definemethodfrombasic@ONEARG{hex}
+\pgfmathfloat@definemethodfrombasic@ONEARG{Hex}
+\pgfmathfloat@definemethodfrombasic@ONEARG{oct}
+\pgfmathfloat@definemethodfrombasic@ONEARG{bin}
+\pgfmathfloat@definemethodfrombasic@TWOARGS{and}
+\pgfmathfloat@definemethodfrombasic@TWOARGS{or}
+
+\pgfutil@ifundefined{pgfmathdeclarefunction}{%
+ % special treatment: \pgfmathrand@ was not properly defined for pgf 2.00:
+ \let\pgfmath@basic@rand=\pgfmathrand
+ \let\pgfmath@basic@rand@=\pgfmathrand@
+ \def\pgfmathfloatrand@{%
+ \pgfmath@basic@rand
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ }%
+ \let\pgfmathfloatrand=\pgfmathfloatrand@%
+ %
+ % special treatment: \pgfmathrnd@ was not properly defined for pgf 2.00:
+ \let\pgfmath@basic@rnd=\pgfmathrnd
+ \let\pgfmath@basic@rnd@=\pgfmathrnd@
+ \def\pgfmathfloatrnd@{%
+ \pgfmath@basic@rnd
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ }%
+ \let\pgfmathfloatrnd=\pgfmathfloatrnd@%
+}{}
+
+% Implements the factorial of '#1'.
+% This does only work if '#1 < 2^32'.
+\def\pgfmathfloatfactorial@#1{%
+ \begingroup
+ \pgfmathfloattofixed{#1}%
+ % collect integer part into a 32 bit register:
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgfmath@counta\pgfmathresult\relax\pgfmath@%
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathloop
+ \ifnum\c@pgfmath@counta<2 %
+ \else
+ \expandafter\pgfmathfloatparsenumber\expandafter{\the\c@pgfmath@counta}%
+ \expandafter\pgfmathfloatmultiply@\expandafter{\pgfmathresult}{\pgfmathfloat@loc@TMPa}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \advance\c@pgfmath@counta by-1\relax%
+ \repeatpgfmathloop
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% Implements the vector length of a 2D vector.
+%
+% ATTENTION: this does NOT use the improved code of the basic layer!
+% It simply computed sqrt( #1^2 + #2^2 )!
+\def\pgfmathfloatveclen@#1#2{%
+ \begingroup
+ \edef\pgfmathfloat@@a{#1}%
+ \pgfmathfloatmultiply@{\pgfmathfloat@@a}{\pgfmathfloat@@a}%
+ \let\pgfmathfloat@@a=\pgfmathresult
+ %
+ \edef\pgfmathfloat@@b{#2}%
+ \pgfmathfloatmultiply@{\pgfmathfloat@@b}{\pgfmathfloat@@b}%
+ \let\pgfmathfloat@@b=\pgfmathresult
+ %
+ \pgfmathfloatadd@{\pgfmathfloat@@a}{\pgfmathfloat@@b}%
+ \pgfmathfloatsqrt@{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\def\pgfmathfloatcosh@#1{%
+ \begingroup
+ \pgfmathfloatexp@{#1}%
+ \let\pgfmathfloat@@a=\pgfmathresult
+ %
+ \pgfmathfloatneg@{#1}%
+ \pgfmathfloatexp@{\pgfmathresult}%
+ %
+ \pgfmathfloatadd@{\pgfmathresult}{\pgfmathfloat@@a}%
+ \expandafter\pgfmathfloatmultiplyfixed@\expandafter{\pgfmathresult}{0.5}%
+ %
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfmathfloatsinh@#1{%
+ \begingroup
+ \pgfmathfloatexp@{#1}%
+ \let\pgfmathfloat@@a=\pgfmathresult
+ %
+ \pgfmathfloatneg@{#1}%
+ \pgfmathfloatexp@{\pgfmathresult}%
+ %
+ \pgfmathfloatsubtract@{\pgfmathfloat@@a}{\pgfmathresult}%
+ \expandafter\pgfmathfloatmultiplyfixed@\expandafter{\pgfmathresult}{0.5}%
+ %
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfmathfloattanh@#1{%
+ \begingroup
+ \pgfmathfloatsinh@{#1}%
+ \let\pgfmathfloat@@a=\pgfmathresult
+ %
+ \pgfmathfloatcosh@{#1}%
+ \let\pgfmathfloat@@b=\pgfmathresult
+ %
+ \pgfmathfloatdivide@{\pgfmathfloat@@a}{\pgfmathfloat@@b}%
+ %
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
new file mode 100644
index 00000000000..698ec524ba8
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
@@ -0,0 +1,767 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+\newcount\pgf@intersect@solutions
+
+\newif\ifpgf@intersect@sort
+\newif\ifpgf@intersect@sort@by@second@path
+
+\def\pgfintersectionsortbyfirstpath{%
+ \pgf@intersect@sorttrue%
+ \pgf@intersect@sort@by@second@pathfalse%
+}
+
+\def\pgfintersectionsortbysecondpath{%
+ \pgf@intersect@sorttrue%
+ \pgf@intersect@sort@by@second@pathtrue%
+}
+
+\def\pgfpointintersectionsolution#1{%
+ \ifnum#1<1\relax%
+ \pgfpoint@intersect@solution@orgin%
+ \else%
+ \ifnum#1>\pgfintersectionsolutions\relax%
+ \pgfpoint@intersect@solution@orgin%
+ \else%
+ \csname pgfpoint@intersect@solution@#1\endcsname%
+ \fi%
+ \fi%
+}
+
+\def\pgfpoint@intersect@solution@orgin{%
+ \begingroup%
+ \pgftransforminvert%
+ \pgfpointorigin%
+ \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \global\pgf@x=\pgf@x%
+ \global\pgf@y=\pgf@y%
+ \endgroup%
+}
+
+\long\def\pgfintersectionofpaths#1#2{%
+ \begingroup%
+ \pgfinterruptpath%
+ #1%
+ \pgfgetpath\pgf@intersect@path@a%
+ \global\let\pgf@intersect@path@temp=\pgf@intersect@path@a%
+ \endpgfinterruptpath%
+ \endgroup%
+ \let\pgf@intersect@path@a=\pgf@intersect@path@temp%
+ %
+ \begingroup%
+ \pgfinterruptpath%
+ #2%
+ \pgfgetpath\pgf@intersect@path@b%
+ \global\let\pgf@intersect@path@temp=\pgf@intersect@path@b%
+ \endpgfinterruptpath%
+ \endgroup%
+ \let\pgf@intersect@path@b=\pgf@intersect@path@temp%
+ %
+ \pgf@intersect@solutions=0\relax%
+ \def\pgf@intersect@time@offset{0}%
+ %
+ \ifpgf@intersect@sort@by@second@path%
+ \let\pgf@intersect@temp=\pgf@intersect@path@a%
+ \let\pgf@intersect@path@a=\pgf@intersect@path@b%
+ \let\pgf@intersect@path@b=\pgf@intersect@temp%
+ \fi%
+ \let\pgf@intersect@token@after=\pgf@intersect@path@process@a%
+ \expandafter\pgf@intersectionofpaths\pgf@intersect@path@a\pgf@stop%
+ \edef\pgfintersectionsolutions{\the\pgf@intersect@solutions}%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgfintersectionsolutions\relax%
+ \else%
+ \pgfutil@namelet{pgfpoint@intersect@solution@\pgfmathcounter}%
+ {pgfpoint@g@intersect@solution@\pgfmathcounter}%
+ \ifpgf@intersect@sort%
+ \pgfutil@namelet{pgf@intersect@solution@\pgfmathcounter @time@a}%
+ {pgf@g@intersect@solution@\pgfmathcounter @time@a}%
+ \fi%
+ \repeatpgfmathloop%
+ \ifpgf@intersect@sort%
+ \pgfintersectionsolutionsortbytime%
+ \fi%
+}
+
+\def\pgf@intersectionofpaths#1{%
+ \ifx#1\pgf@stop%
+ \let\pgf@intersect@next=\relax%
+ \else%
+ \ifx#1\pgfsyssoftpath@movetotoken%
+ \let\pgf@intersect@next=\pgf@intersect@token@moveto%
+ \else%
+ \ifx#1\pgfsyssoftpath@linetotoken%
+ \let\pgf@intersect@next=\pgf@intersect@token@lineto%
+ \else%
+ \ifx#1\pgfsyssoftpath@closepathtoken%
+ \let\pgf@intersect@next=\pgf@intersect@token@lineto%
+ \else%
+ \ifx#1\pgfsyssoftpath@curvetosupportatoken%
+ \let\pgf@intersect@next=\pgf@intersect@token@curveto%
+ \else%
+ \ifx#1\pgfsyssoftpath@rectcornertoken%
+ \let\pgf@intersect@next=\pgf@intersect@token@rect%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgf@intersect@next}
+
+\def\pgf@intersect@token@moveto#1#2{%
+ \def\pgfpoint@intersect@start{\pgfqpoint{#1}{#2}}%
+ \pgf@intersectionofpaths%
+}
+
+\def\pgf@intersect@token@lineto#1#2{%
+ \def\pgfpoint@intersect@end{\pgfqpoint{#1}{#2}}%
+ \def\pgf@intersect@type{line}%
+ \pgf@intersect@token@after%
+}
+\def\pgf@intersect@token@curveto#1#2\pgfsyssoftpath@curvetosupportbtoken#3#4\pgfsyssoftpath@curvetotoken#5#6{%
+ \def\pgfpoint@intersect@firstsupport{\pgfqpoint{#1}{#2}}%
+ \def\pgfpoint@intersect@secondsupport{\pgfqpoint{#3}{#4}}%
+ \def\pgfpoint@intersect@end{\pgfqpoint{#5}{#6}}%
+ \def\pgf@intersect@type{curve}%
+ \pgf@intersect@token@after%
+}
+
+\def\pgf@intersect@token@rect#1#2\pgfsyssoftpath@rectsizetoken#3#4{%
+ \pgf@xa=#1\relax%
+ \advance\pgf@xa by#3\relax%
+ \pgf@ya=#2\relax%
+ \advance\pgf@ya by#4\relax%
+ \edef\pgf@marshal{%
+ \noexpand\pgfsyssoftpath@movetotoken{#1}{#2}%
+ \noexpand\pgfsyssoftpath@linetotoken{#1}{\the\pgf@ya}%
+ \noexpand\pgfsyssoftpath@linetotoken{\the\pgf@xa}{\the\pgf@ya}%
+ \noexpand\pgfsyssoftpath@linetotoken{\the\pgf@xa}{#2}%
+ \noexpand\pgfsyssoftpath@closepathtoken{#1}{#2}%
+ }%
+ \expandafter\pgf@intersectionofpaths\pgf@marshal%
+}
+
+\def\pgf@intersect@path@process@a{%
+ \pgf@intersect@path@getpoints@a%
+ \let\pgf@intersect@token@after=\pgf@intersect@path@process@b%
+ \expandafter\pgf@intersectionofpaths\pgf@intersect@path@b\pgf@stop%
+ \let\pgfpoint@intersect@start=\pgfpoint@intersect@end@a%
+ \let\pgf@intersect@token@after=\pgf@intersect@path@process@a%
+ \c@pgf@counta=\pgf@intersect@time@offset\relax%
+ \advance\c@pgf@counta by1\relax%
+ \edef\pgf@intersect@time@offset{\the\c@pgf@counta}%
+ \pgf@intersectionofpaths%
+}
+
+\def\pgf@intersect@path@getpoints@a{%
+ \let\pgfpoint@intersect@start@a=\pgfpoint@intersect@start%
+ \let\pgfpoint@intersect@end@a=\pgfpoint@intersect@end%
+ \let\pgfpoint@intersect@firstsupport@a=\pgfpoint@intersect@firstsupport%
+ \let\pgfpoint@intersect@secondsupport@a=\pgfpoint@intersect@secondsupport%
+ \let\pgf@intersect@type@a=\pgf@intersect@type%
+}
+
+\def\pgf@intersect@path@process@b{%
+ \pgf@intersect@path@getpoints@b%
+ \csname pgf@intersect@\pgf@intersect@type@a @and@\pgf@intersect@type@b\endcsname%
+ \let\pgfpoint@intersect@start=\pgfpoint@intersect@end@b%
+ \pgf@intersectionofpaths}
+
+\def\pgf@intersect@path@getpoints@b{%
+ \let\pgfpoint@intersect@start@b=\pgfpoint@intersect@start%
+ \let\pgfpoint@intersect@end@b=\pgfpoint@intersect@end%
+ \let\pgfpoint@intersect@firstsupport@b=\pgfpoint@intersect@firstsupport%
+ \let\pgfpoint@intersect@secondsupport@b=\pgfpoint@intersect@secondsupport%
+ \let\pgf@intersect@type@b=\pgf@intersect@type%
+}
+
+\def\pgf@intersect@line@and@line{%
+ \pgf@intersectionoflines{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}%
+ {\pgfpoint@intersect@start@b}{\pgfpoint@intersect@end@b}%
+}%
+
+\def\pgf@intersect@line@and@curve{%
+ \pgf@intersectionoflineandcurve%
+ {\pgf@process{\pgfpoint@intersect@start@a}}{\pgf@process{\pgfpoint@intersect@end@a}}%
+ {\pgf@process{\pgfpoint@intersect@start@b}}{\pgf@process{\pgfpoint@intersect@firstsupport@b}}%
+ {\pgf@process{\pgfpoint@intersect@secondsupport@b}}{\pgf@process{\pgfpoint@intersect@end@b}}%
+}
+
+\def\pgf@intersect@curve@and@line{%
+ \pgf@intersectionofcurveandline%
+ {\pgf@process{\pgfpoint@intersect@start@a}}{\pgf@process{\pgfpoint@intersect@firstsupport@a}}%
+ {\pgf@process{\pgfpoint@intersect@secondsupport@a}}{\pgf@process{\pgfpoint@intersect@end@a}}%
+ {\pgf@process{\pgfpoint@intersect@start@b}}{\pgf@process{\pgfpoint@intersect@end@b}}%
+}
+
+\def\pgf@intersect@curve@and@curve{%
+ \pgf@intersectionofcurves%
+ {\pgf@process{\pgfpoint@intersect@start@a}}{\pgf@process{\pgfpoint@intersect@firstsupport@a}}%
+ {\pgf@process{\pgfpoint@intersect@secondsupport@a}}{\pgf@process{\pgfpoint@intersect@end@a}}%
+ {\pgf@process{\pgfpoint@intersect@start@b}}{\pgf@process{\pgfpoint@intersect@firstsupport@b}}%
+ {\pgf@process{\pgfpoint@intersect@secondsupport@b}}{\pgf@process{\pgfpoint@intersect@end@b}}%
+}
+
+
+\def\pgfintersectionoflines#1#2#3#4{%
+ \pgf@intersect@solutions=0\relax%
+ \pgf@intersectionoflines{#1}{#2}{#3}{#4}%
+}
+
+\def\pgf@intersectionoflines#1#2#3#4{%
+ \pgf@iflinesintersect{#1}{#2}{#3}{#4}%
+ {%
+ \global\advance\pgf@intersect@solutions by1\relax%
+ \expandafter\pgfextract@process\csname pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions\endcsname{%
+ \pgfpointintersectionoflines{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}%
+ {\pgfpoint@intersect@start@b}{\pgfpoint@intersect@end@b}%
+ }%
+ \ifpgf@intersect@sort%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\pgfpointdiff{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}}%
+ \edef\pgf@marshal{%
+ \noexpand\pgfmathveclen@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@ya}}%
+ }%
+ \pgf@marshal%
+ \let\pgf@intersect@length@a=\pgfmathresult%
+ \pgf@process{\pgfpointdiff{\pgfpoint@intersect@start@a}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}%
+ \edef\pgf@marshal{%
+ \noexpand\pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ }%
+ \pgf@marshal%
+ \pgfmathdivide@{\pgfmathresult}{\pgf@intersect@length@a}%
+ \pgf@x=\pgfmathresult pt\relax%
+ \advance\pgf@x by\pgf@intersect@time@offset pt\relax%
+ \expandafter\xdef\csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname%
+ {\pgfmath@tonumber{\pgf@x}}%
+ \fi%
+ }{}%
+}
+
+% Test if two lines L1 and L2 intersect.
+%
+% #1 - first point P1 on L1.
+% #2 - second point P2 on L1.
+% #3 - first point P3 on L2.
+% #2 - second point P4 on L2.
+% #5 - code executed if intersection occurs.
+% #6 - code executed if intersection does no occur.
+%
+% Let L1 be represented by P1+(P2-P1)s where 0<=s<=1
+% Let L2 be represented by P3+(P4-P3)t where 0<=t<=1
+%
+% Then L1 and L2 intersect at
+%
+% s = |x2-x1 x3-x1| / |x4-x3 x2-x1|
+% |y2-y1 y3-y1| |y4-y3 y2-y1|
+%
+% t = |x4-x3 x3-x1| / |x4-x3 x2-x1|
+% |y4-y3 y3-y1| |y4-y3 y2-y1|
+%
+% with 0<=s,t<=1
+%
+% s and t do not need to be calculated:
+%
+% Let s = A / C and t = B / C
+%
+% Then 0<=s<=1 if !(C=0) && ((A=0) || ((A>0) && !(C<A)) || ((A<0) && !(C>A)))
+% 0<=t<=1 if !(C=0) && ((B=0) || ((B>0) && !(C<B)) || ((B<0) && !(C>B)))
+%
+\newif\ifpgf@s
+\newif\ifpgf@t
+\def\pgfiflinesintersect#1#2#3#4{%
+ \begingroup%
+ \pgf@iflinesintersect{\pgf@process{#1}}{\pgf@process{#2}}{\pgf@process{#3}}{\pgf@process{#4}}%
+ {\aftergroup\pgfutil@firstoftwo}{\aftergroup\pgfutil@secondoftwo}%
+ \endgroup%
+}
+
+\def\pgf@iflinesintersect#1#2#3#4{%
+ #4\relax%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ #3\relax%
+ \advance\pgf@xc by-\pgf@x%
+ \advance\pgf@yc by-\pgf@y%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ #2\relax%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ #1\relax%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \advance\pgf@xb by-\pgf@x%
+ \advance\pgf@yb by-\pgf@y%
+ %
+ % xc = x4-x3; yc=y4-y3;
+ % xb = x3-x1; yb=y3-y1;
+ % xa = x2-x1; ya=y2-y1;
+ %
+ %
+ % Normalise a little. 16384 may not be a robust choice.
+ %
+ \c@pgf@counta=\pgf@xa\divide\c@pgf@counta by16384\relax%
+ \c@pgf@countb=\pgf@xb\divide\c@pgf@countb by16384\relax%
+ \c@pgf@countc=\pgf@ya\divide\c@pgf@countc by16384\relax%
+ \c@pgf@countd=\pgf@yb\divide\c@pgf@countd by16384\relax%
+ \multiply\c@pgf@counta by\c@pgf@countd%
+ \multiply\c@pgf@countc by\c@pgf@countb%
+ \advance\c@pgf@counta by-\c@pgf@countc%
+ \pgfutil@tempcnta=\c@pgf@counta%
+ %
+ \c@pgf@counta=\pgf@xc\divide\c@pgf@counta by16384\relax%
+ \c@pgf@countc=\pgf@yc\divide\c@pgf@countc by16384\relax%
+ \multiply\c@pgf@countd by\c@pgf@counta%
+ \multiply\c@pgf@countb by\c@pgf@countc%
+ \advance\c@pgf@countd by-\c@pgf@countb%
+ \pgfutil@tempcntb=\c@pgf@countd%
+ %
+ \c@pgf@countb=\pgf@xa\divide\c@pgf@countb by16384\relax%
+ \c@pgf@countd=\pgf@ya\divide\c@pgf@countd by16384\relax%
+ \multiply\c@pgf@counta by\c@pgf@countd%
+ \multiply\c@pgf@countc by\c@pgf@countb%
+ \advance\c@pgf@counta by-\c@pgf@countc%
+ %
+ \pgf@sfalse%
+ \pgf@tfalse%
+ \ifnum\c@pgf@counta=0\relax%
+ \else%
+ \ifnum\pgfutil@tempcnta=0\relax%
+ \pgf@strue%
+ \else%
+ \ifnum\pgfutil@tempcnta>0\relax%
+ \ifnum\c@pgf@counta<\pgfutil@tempcnta%
+ \else%
+ \pgf@strue%
+ \fi%
+ \else%
+ \ifnum\c@pgf@counta>\pgfutil@tempcnta%
+ \else%
+ \pgf@strue%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum\pgfutil@tempcntb=0\relax%
+ \pgf@ttrue%
+ \else%
+ \ifnum\pgfutil@tempcntb>0\relax%
+ \ifnum\c@pgf@counta<\pgfutil@tempcntb%
+ \else%
+ \pgf@ttrue%
+ \fi%
+ \else%
+ \ifnum\c@pgf@counta>\pgfutil@tempcntb%
+ \else%
+ \pgf@ttrue%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \let\pgf@intersect@next=\pgfutil@secondoftwo%
+ \ifpgf@s%
+ \ifpgf@t%
+ \let\pgf@intersect@next=\pgfutil@firstoftwo%
+ \fi%
+ \fi%
+ \pgf@intersect@next%
+}
+
+
+
+
+\def\pgfintersectionoflineandcurve#1#2#3#4#5#6{%
+ \pgf@intersect@solutions=0\relax%
+ \pgf@intersectionoflineandcurve{#1}{#2}{#3}{#4}{#5}{#6}%
+}
+
+\def\pgf@intersectionoflineandcurve#1#2#3#4#5#6{%
+ \pgf@intersectionofcurves%
+ {\pgf@process{#1}}%
+ {%
+ \pgf@process{%
+ \pgfpointadd{#1\relax\pgf@x=0.666666\pgf@x\pgf@y=0.666666\pgf@y}%
+ {#2\relax\pgf@x=0.333333\pgf@x\pgf@y=0.333333\pgf@y}%
+ }%
+ }%
+ {%
+ \pgf@process{%
+ \pgfpointadd{#1\relax\pgf@x=0.333333\pgf@x\pgf@y=0.333333\pgf@y}%
+ {#2\relax\pgf@x=0.666666\pgf@x\pgf@y=0.666666\pgf@y}%
+ }%
+ }%
+ {\pgf@process{#2}}%
+ {\pgf@process{#3}}%
+ {\pgf@process{#4}}%
+ {\pgf@process{#5}}%
+ {\pgf@process{#6}}%
+}%
+
+\def\pgf@intersectionofcurveandline#1#2#3#4#5#6{%
+ \pgf@intersectionofcurves%
+ {\pgf@process{#1}}%
+ {\pgf@process{#2}}%
+ {\pgf@process{#3}}%
+ {\pgf@process{#4}}%
+ {\pgf@process{#5}}%
+ {%
+ \pgf@process{%
+ \pgfpointadd{#5\relax\pgf@x=0.666666\pgf@x\pgf@y=0.666666\pgf@y}%
+ {#6\relax\pgf@x=0.333333\pgf@x\pgf@y=0.333333\pgf@y}%
+ }%
+ }%
+ {%
+ \pgf@process{%
+ \pgfpointadd{#5\relax\pgf@x=0.333333\pgf@x\pgf@y=0.333333\pgf@y}%
+ {#6\relax\pgf@x=0.666666\pgf@x\pgf@y=0.666666\pgf@y}%
+ }%
+ }%
+ {\pgf@process{#6}}%
+}%
+
+
+
+
+\def\pgfintersectiontolerance{0.1pt}
+\def\pgfintersectiontolerancefactor{0.1}
+
+
+
+% Find the intersections of two bezier curves.
+%
+% #1 - #4 = curve 1.
+% #5 - #8 = curve 2.
+% #9 = the solution number.
+%
+% There is no guarantee of ordering of solutions. If there are
+% no solutions, the origin is returned.
+%
+\def\pgfpointintersectionofcurves#1#2#3#4#5#6#7#8#9{%
+ \pgf@intersect@solutions=0\relax%
+ \pgf@intersectionofcurves%
+ {\pgf@process{#1}}{\pgf@process{#2}}{\pgf@process{#3}}{\pgf@process{#4}}%
+ {\pgf@process{#5}}{\pgf@process{#6}}{\pgf@process{#7}}{\pgf@process{#8}}%
+ \pgfpointintersectionsolution{#9}%
+}
+
+% Return any intersection points of two curves C1 and C2.
+% No order can be guaranteed for the solutions.
+%
+% #1, #2, #3, #4 - the points on C1
+% #5, #6, #7, #8 - the points on C2
+%
+% Returns:
+%
+% \pgf@intersect@solutions - the number of solutions.
+% \pgfpointintersectionsolution{<S>} - the point for soultion S.
+%
+% (Sort of) use:
+%
+% intersection(C1,C2)
+% S = {};
+% intersection'(C1,C2);
+% return S;
+%
+% intersection'(C1,C2)
+% B1 = boundingbox(C1);
+% B2 = boundingbox(C2);
+% if intersect(B1,B2)
+% if (B1.width < q) and (B1.height < q) and
+% (B2.width < q) and (B2.height < q)
+% S = S + {average_of_all_points(B1,B2)}; \\ is there a better choice?
+% else
+% Q = subdivideLeft(C1);
+% R = subdivideRight(C1);
+% intersection'(C2,Q);
+% intersection'(C2,R);
+%
+% where q is a small value (tolerance).
+%
+\def\pgfintersectionofcurves#1#2#3#4#5#6#7#8{%
+ \pgf@intersect@solutions=0\relax%
+ \pgf@intersectionofcurves%
+ {\pgf@process{#1}}{\pgf@process{#2}}{\pgf@process{#3}}{\pgf@process{#4}}%
+ {\pgf@process{#5}}{\pgf@process{#6}}{\pgf@process{#7}}{\pgf@process{#8}}%
+}%
+\def\pgf@intersectionofcurves#1#2#3#4#5#6#7#8{%
+ \begingroup%
+ \dimendef\pgf@time@a=2\relax%
+ \dimendef\pgf@time@aa=4\relax%
+ \dimendef\pgf@time@b=6\relax%
+ \dimendef\pgf@time@bb=8\relax%
+ \pgf@time@a=0pt\relax%
+ \pgf@time@aa=1pt\relax%
+ \pgf@time@b=0pt\relax%
+ \pgf@time@bb=1pt\relax%
+ \let\pgf@intersect@subdivide@curve=\pgf@intersect@subdivide@curve@b%
+ \let\pgf@curve@subdivde@after=\pgf@@intersectionofcurves%
+ \pgf@@intersectionofcurves{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \endgroup%
+}
+
+\def\pgf@@intersectionofcurves#1#2#3#4#5#6#7#8{%
+ \pgf@intersect@boundingbox@reset%
+ \pgf@intersect@boundingbox@update{#1}%
+ \pgf@intersect@boundingbox@update{#2}%
+ \pgf@intersect@boundingbox@update{#3}%
+ \pgf@intersect@boundingbox@update{#4}%
+ \edef\pgf@intersect@boundingbox@b{%
+ \noexpand\pgf@x=\the\pgf@xa%
+ \noexpand\pgf@y=\the\pgf@ya%
+ \noexpand\pgf@xa=\the\pgf@xb%
+ \noexpand\pgf@ya=\the\pgf@yb%
+ }%
+ \pgf@intersect@boundingbox@reset%
+ \pgf@intersect@boundingbox@update{#5}%
+ \pgf@intersect@boundingbox@update{#6}%
+ \pgf@intersect@boundingbox@update{#7}%
+ \pgf@intersect@boundingbox@update{#8}%
+ \edef\pgf@intersect@boundingbox@a{%
+ \noexpand\pgf@xb=\the\pgf@xa%
+ \noexpand\pgf@yb=\the\pgf@ya%
+ \noexpand\pgf@xc=\the\pgf@xb%
+ \noexpand\pgf@yc=\the\pgf@yb%
+ }%
+ \pgf@intersect@boundingbox@a%
+ \pgf@intersect@boundingbox@b%
+ \ifdim\pgf@xa<\pgf@xb%
+ \else%
+ \ifdim\pgf@x>\pgf@xc%
+ \else%
+ \ifdim\pgf@ya<\pgf@yb%
+ \else%
+ \ifdim\pgf@y>\pgf@yc%
+ \else%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \let\pgf@intersect@subdivde=\relax%
+ \ifdim\pgf@xc<\pgfintersectiontolerance\relax%
+ \ifdim\pgf@xa<\pgfintersectiontolerance\relax%
+ \ifdim\pgf@yc<\pgfintersectiontolerance\relax%
+ \ifdim\pgf@ya<\pgfintersectiontolerance\relax%
+ \pgfextract@process\pgf@intersect@solution@candidate{%
+ \pgf@intersect@boundingbox@a%
+ \pgf@intersect@boundingbox@b%
+ \pgf@x=0.25\pgf@x%
+ \advance\pgf@x by0.25\pgf@xa%
+ \advance\pgf@x by0.25\pgf@xb%
+ \advance\pgf@x by0.25\pgf@xc%
+ \pgf@y=0.25\pgf@y%
+ \advance\pgf@y by0.25\pgf@ya%
+ \advance\pgf@y by0.25\pgf@yb%
+ \advance\pgf@y by0.25\pgf@yc%
+ }%
+ % We must avoid duplicate solutions.
+ \let\pgf@intersect@subdivde=\pgf@stop%
+ \pgf@ifsolution@duplicate\pgf@intersect@solution@candidate{}%
+ {%
+ \global\advance\pgf@intersect@solutions by1\relax%
+ \expandafter\global\expandafter\let%
+ \csname pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions\endcsname=%
+ \pgf@intersect@solution@candidate%
+ {%
+ \ifpgf@intersect@sort%
+ \advance\pgf@time@a by\pgf@time@aa%
+ \divide\pgf@time@a by2\relax%
+ \advance\pgf@time@a by\pgf@intersect@time@offset pt\relax%
+ \expandafter\xdef%
+ \csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname%
+ {\pgfmath@tonumber{\pgf@time@a}}%
+ \fi%
+ }%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifx\pgf@intersect@subdivde\pgf@stop%
+ \else%
+ \pgf@intersect@subdivide@curve{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgf@intersect@subdivide@curve@b#1#2#3#4#5#6#7#8{%
+ \begingroup%
+ \advance\pgf@time@bb by\pgf@time@b\relax%
+ \divide\pgf@time@bb by2\relax%
+ \let\pgf@intersect@subdivide@curve=\pgf@intersect@subdivide@curve@a%
+ \pgf@curve@subdivide@left{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+ \endgroup%
+ \begingroup%
+ \advance\pgf@time@b by\pgf@time@bb\relax%
+ \divide\pgf@time@b by2\relax%
+ \let\pgf@intersect@subdivide@curve=\pgf@intersect@subdivide@curve@a%
+ \pgf@curve@subdivide@right{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+ \endgroup%
+}
+
+\def\pgf@intersect@subdivide@curve@a#1#2#3#4#5#6#7#8{%
+ \begingroup%
+ \advance\pgf@time@aa by\pgf@time@a\relax%
+ \divide\pgf@time@aa by2\relax%
+ \let\pgf@intersect@subdivide@curve=\pgf@intersect@subdivide@curve@b%
+ \pgf@curve@subdivide@left{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+ \endgroup%
+ \begingroup%
+ \advance\pgf@time@a by\pgf@time@aa\relax%
+ \divide\pgf@time@a by2\relax%
+ \let\pgf@intersect@subdivide@curve=\pgf@intersect@subdivide@curve@b%
+ \pgf@curve@subdivide@right{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+ \endgroup%
+}
+
+\def\pgf@intersect@boundingbox@reset{%
+ \pgf@xa=16000pt\relax%
+ \pgf@ya=16000pt\relax%
+ \pgf@xb=-16000pt\relax%
+ \pgf@yb=-16000pt\relax%
+}
+
+\def\pgf@intersect@boundingbox@update#1{%
+ #1\relax%
+ \ifdim\pgf@x<\pgf@xa\pgf@xa=\pgf@x\fi%
+ \ifdim\pgf@y<\pgf@ya\pgf@ya=\pgf@y\fi%
+ \ifdim\pgf@x>\pgf@xb\pgf@xb=\pgf@x\fi%
+ \ifdim\pgf@y>\pgf@yb\pgf@yb=\pgf@y\fi%
+}
+
+
+\def\pgf@curve@subdivide@left#1#2#3#4{%
+ %
+ % The left curve (from t=0 to t=.5)
+ %
+ #1\relax%
+ \pgfutil@tempdima=\pgf@x%
+ \pgfutil@tempdimb=\pgf@y%
+ \pgf@xa=.5\pgf@x\pgf@ya=.5\pgf@y%
+ \pgf@xb=.25\pgf@x\pgf@yb=.25\pgf@y%
+ \pgf@xc=.125\pgf@x\pgf@yc=.125\pgf@y%
+ #2\relax%
+ \advance\pgf@xa by.5\pgf@x\advance\pgf@ya by.5\pgf@y%
+ \advance\pgf@xb by.5\pgf@x\advance\pgf@yb by.5\pgf@y%
+ \advance\pgf@xc by.375\pgf@x\advance\pgf@yc by.375\pgf@y%
+ #3\relax%
+ \advance\pgf@xb by.25\pgf@x\advance\pgf@yb by.25\pgf@y%
+ \advance\pgf@xc by.375\pgf@x\advance\pgf@yc by.375\pgf@y%
+ #4\relax%
+ \advance\pgf@xc by.125\pgf@x\advance\pgf@yc by.125\pgf@y%
+ \edef\pgf@marshal{%
+ \noexpand\pgf@curve@subdivde@after%
+ {\noexpand\pgf@x=\the\pgfutil@tempdima\noexpand\pgf@y=\the\pgfutil@tempdimb}%
+ {\noexpand\pgf@x=\the\pgf@xa\noexpand\pgf@y\the\pgf@ya}%
+ {\noexpand\pgf@x=\the\pgf@xb\noexpand\pgf@y=\the\pgf@yb}
+ {\noexpand\pgf@x=\the\pgf@xc\noexpand\pgf@y=\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+}
+
+\def\pgf@curve@subdivide@right#1#2#3#4{%
+ %
+ % The right curve (from t=0.5 to t=1)
+ %
+ #1\relax%
+ \pgfutil@tempdima=.125\pgf@x\pgfutil@tempdimb=.125\pgf@y%
+ #2\relax%
+ \advance\pgfutil@tempdima by.375\pgf@x\advance\pgfutil@tempdimb by.375\pgf@y%
+ \pgf@xa=.25\pgf@x\pgf@ya=.25\pgf@y%
+ #3\relax%
+ \advance\pgfutil@tempdima by.375\pgf@x\advance\pgfutil@tempdimb by.375\pgf@y%
+ \advance\pgf@xa by.5\pgf@x\advance\pgf@ya by.5\pgf@y%
+ \pgf@xb=.5\pgf@x\pgf@yb=.5\pgf@y%
+ #4\relax%
+ \advance\pgfutil@tempdima by.125\pgf@x\advance\pgfutil@tempdimb by.125\pgf@y%
+ \advance\pgf@xa by.25\pgf@x\advance\pgf@ya by.25\pgf@y%
+ \advance\pgf@xb by.5\pgf@x\advance\pgf@yb by.5\pgf@y%
+ \pgf@xc=\pgf@x\pgf@yc=\pgf@y%
+ \edef\pgf@marshal{%
+ \noexpand\pgf@curve@subdivde@after%
+ {\pgf@x\the\pgfutil@tempdima\pgf@y\the\pgfutil@tempdimb}%
+ {\pgf@x\the\pgf@xa\pgf@y\the\pgf@ya}{\pgf@x\the\pgf@xb\pgf@y\the\pgf@yb}
+ {\pgf@x\the\pgf@xc\pgf@y\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+}
+
+
+% A solution S1 is considered a duplicate of S2, if
+%
+% |x1 - x2|f < q and |y1 - y2|f < q
+%
+% where q is a small value (tolerance).
+%
+% #1 - the solution.
+%
+\def\pgf@ifsolution@duplicate#1{%
+ #1%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \let\pgf@intersect@next=\pgfutil@secondoftwo%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@intersect@solutions\relax%
+ \else%
+ \pgf@process{\csname pgfpoint@g@intersect@solution@\pgfmathcounter\endcsname}%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \ifdim\pgf@x<0pt\relax\pgf@x=-\pgf@x\fi%
+ \ifdim\pgf@y<0pt\relax\pgf@y=-\pgf@y\fi%
+ %
+ \pgf@x=\pgfintersectiontolerancefactor\pgf@x%
+ \pgf@y=\pgfintersectiontolerancefactor\pgf@y%
+ \ifdim\pgf@x<\pgfintersectiontolerance\relax%
+ \ifdim\pgf@y<\pgfintersectiontolerance\relax%
+ \let\pgf@intersect@next=\pgfutil@firstoftwo%
+ \fi%
+ \fi%
+ \repeatpgfmathloop%
+ \pgf@intersect@next%
+}
+
+
+\newif\ifpgf@intersect@solutions@sortfinish
+
+% Sort solutions according to their time index.
+%
+\def\pgfintersectionsolutionsortbytime{%
+ \pgf@intersect@solutions@sortfinishtrue%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter=\pgfintersectionsolutions\relax%
+ \else%
+ \pgfutil@tempcnta=\pgfmathcounter%
+ \advance\pgfutil@tempcnta by1\relax%
+ \ifdim\csname pgf@intersect@solution@\pgfmathcounter @time@a\endcsname pt>%
+ \csname pgf@intersect@solution@\the\pgfutil@tempcnta @time@a\endcsname pt\relax%
+ \pgf@intersect@solutions@sortfinishfalse%
+ %
+ \pgfutil@namelet{pgf@intersect@temp}{pgfpoint@intersect@solution@\pgfmathcounter}%
+ \pgfutil@namelet{pgfpoint@intersect@solution@\pgfmathcounter}%
+ {pgfpoint@intersect@solution@\the\pgfutil@tempcnta}%
+ \pgfutil@namelet{pgfpoint@intersect@solution@\the\pgfutil@tempcnta}{pgf@intersect@temp}%
+ %
+ \pgfutil@namelet{pgf@intersect@temp}{pgf@intersect@solution@\pgfmathcounter @time@a}%
+ \pgfutil@namelet{pgf@intersect@solution@\pgfmathcounter @time@a}%
+ {pgf@intersect@solution@\the\pgfutil@tempcnta @time@a}%
+ \pgfutil@namelet{pgf@intersect@solution@\the\pgfutil@tempcnta @time@a}{pgf@intersect@temp}%
+ \fi%
+ \repeatpgfmathloop%
+ \ifpgf@intersect@solutions@sortfinish%
+ \else%
+ \expandafter\pgfintersectionsolutionsortbytime%
+ \fi%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
new file mode 100644
index 00000000000..d7bb3d9dd57
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
@@ -0,0 +1,223 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+\newdimen\pgflsystemstep
+\newcount\c@pgf@lsystem@iteration
+
+\newif\ifpgf@lsystem@randomize@step
+\newif\ifpgf@lsystem@randomize@angle
+
+\pgfkeys{/pgf/lindenmayer system/.cd,%
+ step/.code={\pgfmathsetlength\pgflsystemstep{#1}},%
+ randomize step percent/.code={%
+ \pgfmathparse{#1}%
+ \let\pgflsystemrandomizesteppercent=\pgfmathresult%
+ \ifdim\pgfmathresult pt=0pt\relax%
+ \pgf@lsystem@randomize@stepfalse%
+ \else%
+ \pgf@lsystem@randomize@steptrue%
+ \fi%
+ },%
+ left angle/.code={\pgfmathparse{#1}\let\pgflsystemleftangle=\pgfmathresult},%
+ right angle/.code={\pgfmathparse{#1}\let\pgflsystemrightangle=\pgfmathresult},%
+ angle/.style={/pgf/lindenmayer system/left angle=#1, /pgf/lindenmayer system/right angle=#1},%
+ randomize angle percent/.code={%
+ \pgfmathparse{#1}%
+ \let\pgflsystemrandomizeanglepercent=\pgfmathresult%
+ \ifdim\pgfmathresult pt=0pt\relax%
+ \pgf@lsystem@randomize@anglefalse%
+ \else%
+ \pgf@lsystem@randomize@angletrue%
+ \fi%
+ }%
+}
+
+\pgfkeys{/pgf/lindenmayer system/.cd,
+ step=5pt,%
+ randomize step percent=0,%
+ angle=90,%
+ randomize angle percent=0%
+}
+
+\long\def\pgfdeclarelindenmayersystem#1#2{%
+ \pgfutil@ifundefined{pgf@lsystem@#1}%
+ {%
+ \begingroup%
+ \edef\pgf@lsystem@name{#1}%
+ \expandafter\global\expandafter\let\csname pgf@lsystem@#1\endcsname=\pgf@lsystem@name%
+ \let\symbol=\pgf@lsystem@symbol%
+ \let\rule=\pgf@lsystem@rule%
+ #2%
+ \endgroup%
+ }%
+ {\PackageError{pgf}{Lindenmayer system `#1' is already defined}{}}%
+}
+
+\def\pgf@lsystem@symbol#1#2{%
+ \expandafter\gdef\csname pgf@lsystem@\pgf@lsystem@name @symbol@#1\endcsname{#2}%
+}
+
+\def\pgf@lsystem@rule#1{\expandafter\pgf@lsystem@rule@#1\pgf@stop}
+\def\pgf@lsystem@rule@#1{\def\pgf@lsystem@rule@head{#1}\pgf@lsystem@rule@@}
+\def\pgf@lsystem@rule@@#1->{% Now some `fooling around' to deal with unwanted spaces.
+ \let\pgf@lsystem@rule@body=\pgfutil@empty%
+ \pgfutil@ifnextchar x{\pgf@lsystem@rule@@@}{\pgf@lsystem@rule@@@}}
+\def\pgf@lsystem@rule@@@#1{%
+ \ifx#1\pgf@stop%
+ \expandafter\global\expandafter\let%
+ \csname pgf@lsystem@\pgf@lsystem@name @rule@\pgf@lsystem@rule@head\endcsname=\pgf@lsystem@rule@body%
+ \else%
+ \edef\pgf@lsystem@rule@body{\pgf@lsystem@rule@body#1}%
+ \expandafter\pgf@lsystem@rule@@@%
+ \fi%
+}
+
+\def\pgflindenmayersystem#1#2#3{%
+ \begingroup%
+ \edef\pgf@lsystem@name{#1}%
+ \edef\pgf@lsystem@axiom{#2}%
+ \pgfmathtruncatemacro\pgf@lsystem@order{#3}%
+ %
+ \let\pgf@lsystem@current@symbol=\relax%
+ %
+ \c@pgf@lsystem@iteration=0\relax%
+ %
+ \ifnum\pgf@lsystem@order=0\relax%
+ \expandafter\pgf@lsystem@draw\pgf@lsystem@axiom\pgf@stop
+ \let\pgf@lsystem@next=\pgf@lsystem@end%
+ \else%
+ \let\pgf@lsystem@next=\pgf@lsystem@run%
+ \fi%
+ \expandafter\pgf@lsystem@next\pgf@lsystem@axiom\pgf@lsystem@stop%
+}
+
+\def\pgf@lsystem@run#1{%
+ \ifx#1\pgf@lsystem@stop%
+ \def\pgf@lsystem@token{\pgf@lsystem@stop}%
+ \let\pgf@lsystem@next=\pgf@lsystem@end%
+ \else%
+ \ifx#1\pgf@stop%
+ \advance\c@pgf@lsystem@iteration by-1\relax%
+ \let\pgf@system@token=\pgfutil@empty%
+ \let\pgf@lsystem@next=\pgf@lsystem@run%
+ \else%
+ % Does #1 appear on the RHS of a rule...?
+ \expandafter\let\expandafter\pgf@lsystem@token\expandafter=%
+ \csname pgf@lsystem@\pgf@lsystem@name @rule@#1\endcsname%
+ \ifx\pgf@lsystem@token\relax%
+ % ...nope. So draw it straight away.
+ \pgf@lsystem@draw#1\pgf@stop%
+ \let\pgf@lsystem@token=\pgfutil@empty%
+ \else%
+ % ...yep. So, if the order has been reached draw the LHS
+ % immediately. Otherwise add the LHS to the token stream
+ % and continue.
+ \advance\c@pgf@lsystem@iteration by1\relax%
+ \ifnum\c@pgf@lsystem@iteration=\pgf@lsystem@order%
+ \expandafter\pgf@lsystem@draw\pgf@lsystem@token \pgf@stop%
+ \advance\c@pgf@lsystem@iteration by-1\relax%
+ \let\pgf@lsystem@token=\pgfutil@empty%
+ \else%
+ \expandafter\def\expandafter\pgf@lsystem@token\expandafter{\pgf@lsystem@token \pgf@stop}%
+ \fi%
+ \fi%
+ \let\pgf@lsystem@next=\pgf@lsystem@run%
+ \fi%
+ \fi%
+ \expandafter\pgf@lsystem@next\pgf@lsystem@token}
+
+\def\pgf@lsystem@end#1\pgf@lsystem@stop{\endgroup}
+
+\def\pgf@lsystem@draw#1{%
+ \ifx#1\pgf@stop%
+ \let\pgf@lsystem@next=\relax%
+ \else%
+ \expandafter\let\expandafter\pgf@lsystem@current@symbol\expandafter=%
+ \csname pgf@lsystem@\pgf@lsystem@name @symbol@#1\endcsname%
+ \ifx\pgf@lsystem@current@symbol\relax% Try a default symbol.
+ \expandafter\let\expandafter\pgf@lsystem@current@symbol\expandafter=%
+ \csname pgf@lsystem@symbol@default@#1\endcsname%
+ \fi%
+ \let\pgf@lsystem@next=\pgf@lsystem@@draw%
+ \fi%
+ \pgf@lsystem@next}
+
+\def\pgf@lsystem@@draw{%
+ \edef\pgflsystemcurrentstep{\the\pgflsystemstep}%
+ \let\pgflsystemcurrentrightangle=\pgflsystemrightangle%
+ \let\pgflsystemcurrentrightangle=\pgflsystemleftangle%
+ \pgf@lsystem@current@symbol%
+ \pgf@lsystem@draw}
+
+\expandafter\def\csname pgf@lsystem@symbol@default@F\endcsname{\pgflsystemdrawforward}
+\expandafter\def\csname pgf@lsystem@symbol@default@f\endcsname{\pgflsystemmoveforward}
+\expandafter\def\csname pgf@lsystem@symbol@default@+\endcsname{\pgflsystemturnleft}
+\expandafter\def\csname pgf@lsystem@symbol@default@-\endcsname{\pgflsystemturnright}
+\expandafter\def\csname pgf@lsystem@symbol@default@[\endcsname{\pgflsystemsavestate}
+\expandafter\def\csname pgf@lsystem@symbol@default@]\endcsname{\pgflsystemrestorestate}
+
+\def\pgflsystemradonmizestep{%
+ \ifpgf@lsystem@randomize@step%
+ \pgfmathrand%
+ \pgf@x=\pgflsystemrandomizesteppercent pt\relax%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \divide\pgf@x by20\relax%
+ \advance\pgf@x by\pgflsystemstep\relax%
+ \edef\pgflsystemcurrentstep{\the\pgf@x}%
+ \else%
+ \edef\pgflsystemcurrentstep{\the\pgflsystemstep}%
+ \fi%
+}
+
+\def\pgflsystemdrawforward{%
+ \pgflsystemradonmizestep
+ \pgftransformxshift{+\pgflsystemcurrentstep}%
+ \pgfpathlineto{\pgfpointorigin}}
+
+\def\pgflsystemmoveforward{%
+ \pgflsystemradonmizestep
+ \pgftransformxshift{+\pgflsystemcurrentstep}%
+ \pgfpathmoveto{\pgfpointorigin}}
+
+\def\pgflsystemranomizerightangle{%
+ \ifpgf@lsystem@randomize@angle%
+ \pgf@x=\pgflsystemrandomizeanglepercent pt\relax%
+ \divide\pgf@x by20\relax%
+ \pgfmathrand%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \advance\pgf@x by\pgflsystemrightangle pt\relax%
+ \edef\pgflsystemcurrentrightangle{\pgfmath@tonumber{\pgf@x}}%
+ \else%
+ \let\pgflsystemcurrentrightangle=\pgflsystemrightangle%
+ \fi%
+}
+
+\def\pgflsystemranomizeleftangle{%
+ \ifpgf@lsystem@randomize@angle%
+ \pgf@x=\pgflsystemrandomizeanglepercent pt\relax%
+ \divide\pgf@x by20\relax%
+ \pgfmathrand%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \advance\pgf@x by\pgflsystemleftangle pt\relax%
+ \edef\pgflsystemcurrentleftangle{\pgfmath@tonumber{\pgf@x}}%
+ \else%
+ \let\pgflsystemcurrentleftangle=\pgflsystemleftangle%
+ \fi%
+}
+
+\def\pgflsystemturnright{%
+ \pgflsystemranomizerightangle
+ \pgftransformrotate{-\pgflsystemcurrentrightangle}}
+
+\def\pgflsystemturnleft{%
+ \pgflsystemranomizeleftangle
+ \pgftransformrotate{\pgflsystemcurrentleftangle}}
+
+\def\pgflsystemsavestate{\begingroup}
+\def\pgflsystemrestorestate{\endgroup\pgfpathmoveto{\pgfpointorigin}}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
index c9c29958585..acfc3fa7b2e 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarypatterns.code.tex,v 1.12 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarypatterns.code.tex,v 1.13 2008/03/03 13:52:35 tantau Exp $
% Lines in different directions
@@ -241,6 +241,7 @@
}
\pgfutil@definecolor{pgf@lightsteelblue}{rgb}{0.6875,0.765625,0.8671875}
+\pgfutil@colorlet{pgf@darklightsteelblue}{black!50!pgf@lightsteelblue}
\pgfdeclarepatterninherentlycolored{crosshatch dots light steel blue}
{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
@@ -249,11 +250,11 @@
\pgfsetfillcolor{pgf@lightsteelblue}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
\pgfusepath{fill}
- \pgfsetfillcolor{black!80!pgf@lightsteelblue!10}
+ \pgfsetfillcolor{pgf@darklightsteelblue!10}
\pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}
\pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}
\pgfusepath{fill}
- \pgfsetfillcolor{black!80!pgf@lightsteelblue!70}
+ \pgfsetfillcolor{pgf@darklightsteelblue!70}
\pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}
\pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}
\pgfusepath{fill}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
index a0f504431eb..5ab9e84a796 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.9 2007/03/09 17:49:32 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.15 2010/05/31 10:11:22 tantau Exp $
\newif\ifpgf@plot@started
@@ -280,7 +280,8 @@
\def\pgf@plotstreamstart{%
\global\let\pgf@plotstreampoint=\pgf@plot@xcomb@handler%
\global\let\pgf@plotstreamspecial=\pgfutil@gobble%
- \global\let\pgf@plotstreamend=\relax%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfplotxzerolevelstreamstart
}%
}
@@ -288,7 +289,11 @@
\pgf@process{#1}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
- \pgfpathmoveto{\pgfqpoint{0pt}{\pgf@ya}}%
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \pgfpathmoveto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
}
@@ -306,7 +311,8 @@
\def\pgf@plotstreamstart{%
\global\let\pgf@plotstreampoint=\pgf@plot@ycomb@handler%
\global\let\pgf@plotstreamspecial=\pgfutil@gobble%
- \global\let\pgf@plotstreamend=\relax%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfplotyzerolevelstreamstart
}%
}
@@ -314,12 +320,412 @@
\pgf@process{#1}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
- \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}%
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
}
+% PGF Bar or comb plots usually draw something from zero to the current plot's coordinate.
+%
+% The 'zero' offset can be changed using an input stream.
+%
+% There are two such streams which can be configured independently.
+% The first one returns "zeros" for coordinate x, the second one
+% returns "zeros" for coordinate y.
+%
+% \pgfplotxzerolevelstreamstart
+% \pgfplotxzerolevelstreamnext % assigns \pgf@x globally
+% \pgfplotxzerolevelstreamnext
+% \pgfplotxzerolevelstreamnext
+% \pgfplotxzerolevelstreamend
+%
+% and
+% \pgfplotyzerolevelstreamstart
+% \pgfplotyzerolevelstreamnext % assigns \pgf@x globally
+% \pgfplotyzerolevelstreamend
+%
+\def\pgfplotxzerolevelstreamstart{\pgf@plotxzerolevelstreamstart}%
+\def\pgfplotxzerolevelstreamend{\pgf@plotxzerolevelstreamend}%
+\def\pgfplotxzerolevelstreamnext{\pgf@plotxzerolevelstreamnext}
+\def\pgfplotyzerolevelstreamstart{\pgf@plotyzerolevelstreamstart}%
+\def\pgfplotyzerolevelstreamend{\pgf@plotyzerolevelstreamend}%
+\def\pgfplotyzerolevelstreamnext{\pgf@plotyzerolevelstreamnext}
+
+% This zero level stream always returns '#1' (a dimension).
+\def\pgfplotxzerolevelstreamconstant#1{%
+ \edef\pgfplotxzerolevelstreamconstant@val{#1}%
+ \def\pgf@plotxzerolevelstreamstart{%
+ \global\let\pgf@plotxzerolevelstreamend=\relax
+ \gdef\pgf@plotxzerolevelstreamnext{\global\pgf@x=\pgfplotxzerolevelstreamconstant@val\relax}%
+ }%
+}%
+\pgfplotxzerolevelstreamconstant{0pt}%
+
+% This zero level stream always returns '#1'.
+\def\pgfplotyzerolevelstreamconstant#1{%
+ \edef\pgfplotyzerolevelstreamconstant@val{#1}%
+ \def\pgf@plotyzerolevelstreamstart{%
+ \global\let\pgf@plotyzerolevelstreamend=\relax
+ \gdef\pgf@plotyzerolevelstreamnext{\global\pgf@x=\pgfplotyzerolevelstreamconstant@val\relax}%
+ }%
+}%
+\pgfplotyzerolevelstreamconstant{0pt}%
+
+\def\pgfplotbarwidth{\pgfkeysvalueof{/pgf/bar width}}
+
+\pgfqkeys{/pgf}{%
+ bar width/.initial=10pt,
+ bar shift/.initial=0pt,
+ bar interval width/.initial=1,
+ bar interval shift/.initial=0.5,
+}
+
+% This handler places a rectangle at each point in the plot stream, a
+% rectangle which touches the x-axis at one end and the current point
+% at the other end:
+% --(X)--
+% | |
+% | |
+% | |
+% --(0)--
+% Example:
+%
+% \pgfplothandlerybar
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerybar{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybar@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfmathparse{\pgfplotbarwidth}%
+ \xdef\pgfplotbarwidth@{\pgfmathresult pt}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar shift}}%
+ \xdef\pgfplotbarshift@{\pgfmathresult pt}%
+ \pgfplotyzerolevelstreamstart
+ }%
+}
+\def\pgf@plot@ybar@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@xb\pgfplotbarwidth@\relax
+ \pgf@xc=\pgf@x
+ \advance\pgf@xc by-.5\pgf@xb
+ \advance\pgf@xc by\pgfplotbarshift@\relax
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+}
+% This handler places a rectangle at each point in the plot stream, a
+% rectangle which touches the y-axis at one end and the current point
+% at the other end:
+% ---------
+% | |
+% (0) (X)
+% | |
+% ---------
+% Example:
+%
+% \pgfplothandlerxbar
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerxbar{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbar@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfmathparse{\pgfplotbarwidth}%
+ \xdef\pgfplotbarwidth@{\pgfmathresult pt}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar shift}}%
+ \xdef\pgfplotbarshift@{\pgfmathresult pt}%
+ \pgfplotxzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@xbar@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@x
+ \expandafter\pgf@xb\pgfplotbarwidth@\relax
+ \pgf@xc=\pgf@y
+ \advance\pgf@xc by-.5\pgf@xb
+ \advance\pgf@xc by\pgfplotbarshift@\relax
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+}
+
+% This handler is a variant of \pgfplothandlerybar which works with
+% intervals instead of points.
+%
+% Bars are drawn between successive input coordinates and the width is
+% determined relatively to the interval length.
+%
+% It looks like this:
+%
+% |---| |-----|
+% | | | |
+% | | | |
+% | | | |
+% (X)------(X)-----------(X)
+%
+% where (X) denotes the x-axis offsets of input coordinates.
+%
+% In more detail, if (x_i,y_i) and (x_{i+1},y_{i+1}) denote successive
+% input coordinates, the bar will be placed above the
+% interval [x_i,x_{i+1}], centered at
+%
+% x_i + \pgfkeysvalueof{/pgf/bar interval shift} * (x_{i+1} - x_i)
+%
+% with width
+%
+% \pgfkeysvalueof{/pgf/bar interval width} * (x_{i+1} - x_i).
+%
+% If you have N+1 input points, you will get N bars (one for each
+% interval). The y_i value of the last bar will be ignored.
+%
+% Example:
+%
+% \pgfplothandlerybarinterval
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerybarinterval{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler@first%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}%
+ \xdef\pgfplotbarintervalwidth@{\pgfmathresult}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}%
+ \xdef\pgfplotbarintervalshift@{\pgfmathresult}%
+ \pgfplotyzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@ybarinterval@handler@first#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}%
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@y}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler%
+}
+\def\pgf@plot@ybarinterval@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@plot@barinterval@bar
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@y}%
+ \pgf@xc=\pgf@plot@barinterval@intervalstart\relax
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}%
+ \pgf@xb=\pgf@x
+ \advance\pgf@xb by-\pgf@xc
+ \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb
+ \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb
+ \advance\pgf@xc by-.5\pgf@xb% center
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+}
+
+% Like \pgfplothandlerybarinterval but for xbar.
+\def\pgfplothandlerxbarinterval{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler@first%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}%
+ \xdef\pgfplotbarintervalwidth@{\pgfmathresult}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}%
+ \xdef\pgfplotbarintervalshift@{\pgfmathresult}%
+ \pgfplotxzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@xbarinterval@handler@first#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}%
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@x}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler%
+}
+\def\pgf@plot@xbarinterval@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@plot@barinterval@bar
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@x}%
+ \pgf@xc=\pgf@plot@barinterval@intervalstart\relax
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}%
+ \pgf@xb=\pgf@y
+ \advance\pgf@xb by-\pgf@xc
+ \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb
+ \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb
+ \advance\pgf@xc by-.5\pgf@xb% center
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+}
+
+
+% This handler is very similar to \pgfplothandlerlineto, but it
+% produces CONSTANT connected pieces of the form
+%
+% x
+% |
+% x--- |
+% | x----
+% x-|
+%
+% Example:
+%
+% \pgfplothandlerconstantlineto
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerconstantlineto{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@const@line@handler#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@y}%
+ \pgf@plot@first@action{}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@handler@@%
+}
+\def\pgf@plot@const@line@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgf@yb\pgf@plot@const@line@handler@last\relax
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}%
+}
+
+% A variant of \pgfplothandlerconstantlineto which places its mark on
+% the right line ends.
+%
+% |---x
+% ---x |
+% |--x
+% x
+%
+% Example:
+%
+% \pgfplothandlerconstantlinetomarkright
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerconstantlinetomarkright{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@right@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@const@line@mark@right@handler#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@x}%
+ \pgf@plot@first@action{}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@right@handler@@%
+}
+\def\pgf@plot@const@line@mark@right@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgf@yb\pgf@plot@const@line@handler@last\relax
+ \pgfpathlineto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}%
+}
+
+% This handler is in fact a variant of \pgfplothandlerconstantlineto,
+% but it does not draw vertical lines. It produces a sequence of
+% line-to and move-to operations such that plot marks are placed at
+% each right end:
+%
+% ---x
+% ---x
+% ---x
+% --x
+%
+% Example:
+%
+% \pgfplothandlerjumpmarkright
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerjumpmarkright{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkright@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@jumpmarkright@handler#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@x}%
+ \pgf@plot@first@action{}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkright@handler@@%
+}
+\def\pgf@plot@jumpmarkright@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgf@yb\pgf@plot@const@line@handler@last\relax
+ \pgfpathmoveto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}%
+}
+
+% This handler is in fact a variant of \pgfplothandlerconstantlineto,
+% but it does not draw vertical lines. It produces a sequence of
+% line-to and move-to operations such that plot marks are placed at
+% each left end:
+%
+% x---
+% x---
+% x---
+% x--
+%
+% Example:
+%
+% \pgfplothandlerjumpmarkleft
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerjumpmarkleft{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkleft@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@jumpmarkleft@handler#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@y}%
+ \pgf@plot@first@action{}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkleft@handler@@%
+}
+\def\pgf@plot@jumpmarkleft@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgf@yb\pgf@plot@const@line@handler@last\relax
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}%
+}
@@ -515,6 +921,102 @@
+% This handler turns creates a series of straight line segements
+% between consecutive points, but leaving /pgf/gap around stream point
+% space.
+%
+% Example:
+%
+% \pgfplothandlergaplineto
+% \pgfplotxyfile{mytable}
+
+\pgfkeys{/pgf/gap around stream point/.initial=1.5pt}
+
+\def\pgfplothandlergaplineto{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@gap@lineto@handler@initial%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+
+\def\pgf@plot@gap@lineto@handler@initial#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \xdef\pgf@plot@gap@lineto@last{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@gap@lineto@handler%
+}
+
+\def\pgf@plot@gap@lineto@handler#1{%
+ % Ok, compute normalized line vector
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \xdef\pgf@plot@gap@lineto@next{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgf@plot@gap@lineto@last}{\pgf@plot@gap@lineto@next}}}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfpathmoveto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap
+ around stream point}}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}{\pgf@plot@gap@lineto@last}}%
+ \pgfpathlineto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap
+ around stream point}}{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}}{\pgf@plot@gap@lineto@next}}%
+ \global\let\pgf@plot@gap@lineto@last=\pgf@plot@gap@lineto@next%
+}
+
+
+
+
+% This handler works like \pgfplothandlergaplineto, only the last
+% point is connected to the first point, creating a closed curve
+% space.
+%
+% Example:
+%
+% \pgfplothandlergapcycle
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlergapcycle{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@gap@cycle@handler@initial%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgf@plot@gap@cycle@handler@finish%
+ \global\let\pgf@plot@gap@cycle@first=\relax%
+ }%
+}
+
+\def\pgf@plot@gap@cycle@handler@initial#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \xdef\pgf@plot@gap@cycle@last{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \global\let\pgf@plot@gap@cycle@first=\pgf@plot@gap@cycle@last%
+ \global\let\pgf@plotstreampoint=\pgf@plot@gap@cycle@handler%
+}
+
+\def\pgf@plot@gap@cycle@handler#1{%
+ % Ok, compute normalized line vector
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \xdef\pgf@plot@gap@cycle@next{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgf@plot@gap@cycle@last}{\pgf@plot@gap@cycle@next}}}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfpathmoveto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap
+ around stream point}}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}{\pgf@plot@gap@cycle@last}}%
+ \pgfpathlineto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap
+ around stream point}}{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}}{\pgf@plot@gap@cycle@next}}%
+ \global\let\pgf@plot@gap@cycle@last=\pgf@plot@gap@cycle@next%
+}
+
+\def\pgf@plot@gap@cycle@handler@finish{%
+ \ifx\pgf@plot@gap@cycle@first\relax%
+ \else
+ \pgf@plot@gap@cycle@handler{\pgf@plot@gap@cycle@first}%
+ \fi
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
index e20805d50a1..57df579e3f3 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplotmarks.code.tex,v 1.5 2007/03/09 17:49:32 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplotmarks.code.tex,v 1.12 2010/10/15 07:34:06 ludewich Exp $
% A stroked circle mark
@@ -19,6 +19,32 @@
}
+% A Mercedes-line star
+
+\pgfdeclareplotmark{Mercedes star}
+{%
+ \pgfpathmoveto{\pgfqpointpolar{90}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfqpointpolar{-30}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfqpointpolar{-150}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfusepathqstroke
+}
+
+\pgfdeclareplotmark{Mercedes star flipped}
+{%
+ \pgfpathmoveto{\pgfqpointpolar{-90}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfqpointpolar{30}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfqpointpolar{150}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfpointorigin}
+ \pgfusepathqstroke
+}
+
+
+
% A six-pointed star mark
@@ -47,6 +73,19 @@
}
+% An 10-pointed star mark
+
+\pgfdeclareplotmark{10-pointed star}
+{%
+ \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpointpolar{18}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{18}{\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpointpolar{-54}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{-54}{\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpointpolar{234}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpointpolar{162}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}
+ \pgfusepathqstroke
+}
+
+
% An \oplus mark
\pgfdeclareplotmark{oplus}
@@ -209,4 +248,206 @@
\pgfusepathqfillstroke
}
+\newif\ifpgfmarktext@usetikznode
+\pgfkeys{
+ /pgf/text mark/.initial=p,
+ /pgf/text mark style/.initial=,
+ /pgf/text mark as node/.is if=pgfmarktext@usetikznode,
+ /pgf/text mark as node/.default=true,
+ %
+ % backw. compat: the extra search path confuses the '.unknown'
+ % handlers, so this here is deprecated:
+ /pgf/text mark/style/.style={/pgf/text mark style={#1}},%
+ /pgf/text mark/as node/.style={/pgf/text mark as node=#1},%
+}%
+
+\pgfdeclareplotmark{text}
+{
+ \pgfkeysgetvalue{/pgf/text mark style}\pgfmarktext@style
+ \pgfkeysgetvalue{/pgf/text mark}\pgfmarktext@
+ \ifpgfmarktext@usetikznode
+ \expandafter\node\expandafter[\pgfmarktext@style]{\pgfmarktext@};
+ \else
+ \expandafter\pgftext\expandafter[\pgfmarktext@style]{\pgfmarktext@}%
+ \fi
+}
+
+\pgfkeysdef{/pgf/mark color}{\def\pgf@mark@color{#1}}
+\let\pgf@mark@color\pgfutil@empty
+
+\def\pgf@set@mark@color{%
+ \ifx\pgf@mark@color\pgfutil@empty
+ \pgfsys@color@rgb@fill{1}{1}{1}%
+ \else
+ \pgfsetfillcolor{\pgf@mark@color}%
+ \fi
+}%
+\def\pgf@mark@color@none{none}%
+
+% A half-down-filled and half-up-filled-white diamond-shaped mark
+% (the shape can be rotated by "mark options = {rotate = 90}")
+% created by Tomek
+
+\pgfdeclareplotmark{halfcircle}{%
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto
+ {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpatharc{180}{360}{\pgfplotmarksize}%
+ \pgfusepathqfill
+ \endpgfscope%
+ \fi
+ \pgfpathmoveto
+ {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto
+ {\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathcircle{\pgfpointorigin}%
+ {\pgfplotmarksize}%
+ \pgfusepathqstroke
+}
+\pgfdeclareplotmark{halfcircle*}{%
+ \pgfpathmoveto
+ {\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpatharc{0}{180}{\pgfplotmarksize}%
+ \pgfpathclose
+ \pgfusepathqfill
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto
+ {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpatharc{180}{360}{\pgfplotmarksize}%
+ \pgfusepathqfill
+ \endpgfscope%
+ \fi
+ \pgfpathcircle{\pgfpointorigin}%
+ {\pgfplotmarksize}%
+ \pgfusepathqstroke
+}
+
+% A half-down-filled and half-up-filled-white diamond-shaped mark
+% created by Magnus Tewes
+
+\pgfdeclareplotmark{halfdiamond*}{%
+ \pgfpathmoveto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
+ \pgfusepathqfill
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
+ \pgfusepathqfill
+ \endpgfscope
+ \fi
+ \pgfpathmoveto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathclose
+ \pgfusepathqstroke
+}
+
+% A half-down-filled and half-up-filled-white tilted-squared-shaped mark
+% created by Magnus Tewes
+
+\pgfdeclareplotmark{halfsquare*}{%
+ \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfusepathqfill
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfusepathqfill
+ \endpgfscope
+ \fi
+ \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathclose
+ \pgfusepathqstroke
+}
+
+% A half-right-filled and half-up-filled-white tilted-squared-shaped mark
+% created by Magnus Tewes
+
+\pgfdeclareplotmark{halfsquare right*}{%
+ \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfusepathqfill
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfusepathqfill
+ \endpgfscope
+ \fi
+ \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathclose
+ \pgfusepathqstroke
+}
+
+% A half-left-filled and half-up-filled-white tilted-squared-shaped mark
+% created by Magnus Tewes
+
+\pgfdeclareplotmark{halfsquare left*}{%
+ \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfusepathqfill
+ \ifx\pgf@mark@color@none\pgf@mark@color
+ \else
+ \pgfscope
+ \pgf@set@mark@color
+ \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfusepathqfill
+ \endpgfscope
+ \fi
+ \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
+ \pgfpathclose
+ \pgfusepathqstroke
+}
+
+
+% A stroke-filled heart-shaped mark
+% created by Magnus Tewes
+\pgfdeclareplotmark{heart}{%
+ \pgfpathmoveto{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}
+ \pgfpathcurveto{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.66\pgfplotmarksize}}{\pgfqpoint{-.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}
+ \pgfpathcurveto{\pgfqpoint{-.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}{\pgfqpoint{-\pgfplotmarksize}{-.75\pgfplotmarksize}}{\pgfqpoint{-\pgfplotmarksize}{0pt}}
+ \pgfpathcurveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}{\pgfqpoint{-\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{-.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}
+ \pgfpathcurveto{\pgfqpoint{-.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{0pt}{.5825\pgfplotmarksize}}{\pgfqpoint{0pt}{0pt}}
+ \pgfpathcurveto{\pgfqpoint{0pt}{0pt}}{\pgfqpoint{0pt}{.5825\pgfplotmarksize}}{\pgfqpoint{.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}
+ \pgfpathcurveto{\pgfqpoint{.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{\pgfplotmarksize}{0pt}}
+ \pgfpathcurveto{\pgfqpoint{\pgfplotmarksize}{0pt}}{\pgfqpoint{\pgfplotmarksize}{-.75\pgfplotmarksize}}{\pgfqpoint{.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}
+ \pgfpathcurveto{\pgfqpoint{.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.66\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}
+ \pgfpathclose
+ \pgfusepathqfillstroke
+}
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
new file mode 100644
index 00000000000..1043825d60f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
@@ -0,0 +1,515 @@
+%--------------------------------------------
+%
+% TeX profiling library
+%
+% Copyright 2010 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/>.
+%
+%--------------------------------------------
+
+\pgfutil@ifundefined{pdfelapsedtime}{%
+ \PackageError{pgf}{library 'profiler' can only be used with pdftex Rev. >= 1.671 because it needs the \string\pdfelapsedtime\space command}{}%
+ \global\let\pdfelapsedtime=\c@pgf@counta
+}{}
+
+
+% Defines a new profiler entry named `#1'.
+%
+% This allocates a set of counters.
+\def\pgfprofilenew#1{%
+ \pgfutil@ifundefined{c@pgfprofile@elapsedtotal@#1}{%
+ \expandafter\gdef\csname c@pgfprofile@elapsedtotal@#1\endcsname{0}%
+ \expandafter\gdef\csname c@pgfprofile@elapsedself@#1\endcsname{0}%
+ \expandafter\gdef\csname c@pgfprofile@numinvocations@#1\endcsname{0}%
+ \expandafter\gdef\csname c@pgfprofile@subtractforself@#1\endcsname{0}%
+ \expandafter\gdef\csname c@pgfprofile@semaphor@#1\endcsname{0}%
+ \expandafter\gdef\csname c@pgfprofile@elapsed@at@start@#1\endcsname{0}%
+ \pgfprofile@all@registered@list@add{#1}%
+ }{%
+ % it is already defined and registered. Shouldn't hurt, might
+ % even be a good feature.
+ }%
+}%
+
+\def\pgfprofile@TeX@DIALECT@toenvironment@begin#1{\csname #1\endcsname}%
+\def\pgfprofile@TeX@DIALECT@toenvironment@end#1{\csname end#1\endcsname}%
+
+\def\pgfprofile@@to@pgfretval#1{%
+ \expandafter\let\expandafter\pgfretval#1%
+}%
+
+% Defines a new profiler entry for the environment `#1'.
+%
+% This calls \pgfprofilenew and handles the begin/end of the
+% environment automatically.
+%
+% #1 the environment name (a string)
+%
+% Optionally in square brackets: the profiler entry name
+% \pgfprofilenewforenvironment{<environment name>}
+% \pgfprofilenewforenvironment[<profiler entry name>]{<environment name>}
+\def\pgfprofilenewforenvironment{\pgfutil@ifnextchar[{\pgfprofilenewforenvironment@}{\pgfprofilenewforenvironment@[]}}%
+\def\pgfprofilenewforenvironment@[#1]#2{%
+ \expandafter\pgfprofile@@to@pgfretval\pgfprofile@TeX@DIALECT@toenvironment@begin{#2}%
+ \ifx\pgfretval\relax
+ \PackageError{pgf}{\string\pgfprofilenewforenvironment{#2} doesn't work: the environment `#2' is (not yet?) known or not known in this context}{}%
+ \else
+ \expandafter\global\expandafter\let\csname pgfprofile@orig@begin@#2\endcsname=\pgfretval
+ \expandafter\pgfprofile@@to@pgfretval\pgfprofile@TeX@DIALECT@toenvironment@end{#2}%
+ \expandafter\global\expandafter\let\csname pgfprofile@orig@end@#2\endcsname=\pgfretval
+ %
+ \def\pgfprofile@temp{#1}%
+ \ifx\pgfprofile@temp\pgfutil@empty
+ \pgfprofilenewforenvironment@@{\pgfprofileenv #2}{#2}%
+ \else
+ \pgfprofilenewforenvironment@@{#1}{#2}%
+ \fi
+ \fi
+}%
+\def\pgfprofilenewforenvironment@@#1#2{%
+ \pgfprofilenew{#1}%
+ \expandafter\expandafter\expandafter\gdef\pgfprofile@TeX@DIALECT@toenvironment@begin{#2}{%
+ \pgfprofilestart{#1}%
+ \csname pgfprofile@orig@begin@#2\endcsname
+ }%
+ \expandafter\expandafter\expandafter\gdef\pgfprofile@TeX@DIALECT@toenvironment@end{#2}{%
+ \csname pgfprofile@orig@end@#2\endcsname
+ \pgfprofileend{#1}%
+ }%
+}
+
+
+\def\pgfprofilecs{<CS>}%
+\def\pgfprofileenv{<ENV>}%
+
+% Defines a new profiler entry for the control sequence '#1'.
+%
+% This calls \pgfprofilenew and enhances the control sequence with
+% support for timings.
+%
+% #1: the control sequence (with backslash!)
+% #2: the number of arguments (see below).
+%
+% The following commands are supported:
+% - commands which take one (optional) argument in square brackets,
+% - commands which take one (optional) argument in square brackets
+% followed by one optional argument which has to be delimited with
+% curly braces (use an empty argument for '#2' in this case),
+% - commands which take one (optional) argument in square brackets
+% and *exactly* #2 arguments afterwards.
+\def\pgfprofilenewforcommand{\pgfutil@ifnextchar[{\pgfprofilenewforcommand@}{\pgfprofilenewforcommand@[]}}
+\def\pgfprofilenewforcommand@[#1]#2#3{%
+ \def\pgfprofile@temp{#3}%
+ \ifx\pgfprofile@temp\pgfutil@empty
+ \pgfprofilenewforcommandpattern[#1]{#2}{<autocheck>}{}%
+ \else
+ \ifcase#3\relax
+ \pgfprofilenewforcommandpattern[#1]{#2}{}{}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1}{{##1}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2}{{##1}{##2}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2##3}{{##1}{##2}{##3}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2##3##4}{{##1}{##2}{##3}{##4}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2##3##4##5}{{##1}{##2}{##3}{##4}{##5}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2##3##4##5##6}{{##1}{##2}{##3}{##4}{##5}{##6}}%
+ \or
+ \pgfprofilenewforcommandpattern[#1]{#2}{##1##2##3##4##5##6##7}{{##1}{##2}{##3}{##4}{##5}{##6}{##7}}%
+ \else
+ \PackageError{pgf}{library 'profiler' can't replace control sequences with '#3' arguments automatically, sorry.}%
+ \fi
+ \fi
+}%
+
+% \pgfprofilenewforcommandpattern[<profile entry name>]{<\CS>}{<definition pattern>}{<invocation pattern>}
+%
+% example:
+% \pgfprofilenewforcommandpattern{\pgfqkeys}{##1##2}{{##1}{##2}}
+%
+% \def\mymacro##1\to##2\in##3{ .... }
+% \pgfprofilenewforcommandpattern{\mymacro}{##1\to##2\in##3}{{##1}\to{##2}\in{##3}}
+\def\pgfprofilenewforcommandpattern{\pgfutil@ifnextchar[{\pgfprofilenewforcommandpattern@}{\pgfprofilenewforcommandpattern@[]}}
+\def\pgfprofilenewforcommandpattern@[#1]#2#3#4{%
+ \def\pgfprofile@known{1}%
+ \ifx#2\undefined
+ \def\pgfprofile@known{0}%
+ \else
+ \ifx#2\relax
+ \def\pgfprofile@known{0}%
+ \fi
+ \fi
+ \if\pgfprofile@known0%
+ \PackageError{pgf}{\string\pgfprofilenewforcommandpattern{\string#2} doesn't work: the command `\string#2' is (not yet?) known or not known in this context}{}%
+ \else
+ \begingroup
+ \pgfprofile@cs@to@name{#2}%
+ \let\pgfprofilenew@cmdname=\pgfretval
+ %
+ \def\pgfprofile@temp{#1}%
+ \ifx\pgfprofile@temp\pgfutil@empty
+ \edef\pgfprofilenew@profilerentryname{\pgfprofilecs\pgfprofilenew@cmdname}%
+ \else
+ \edef\pgfprofilenew@profilerentryname{#1}%
+ \fi
+ \expandafter\global\expandafter\let\csname pgfprofile@name@for@\pgfprofilenew@cmdname\endcsname=\pgfprofilenew@profilerentryname
+ \pgfprofilenew{\pgfprofilenew@profilerentryname}%
+ \expandafter\gdef\csname b@pgfprofile@show@\pgfprofilenew@profilerentryname\endcsname{0}%
+ %
+ \expandafter\global\expandafter\let\csname pgfprofile@orig@\pgfprofilenew@cmdname\endcsname=#2%
+ \toks0={#3}%
+ \edef\pgfprofile@temp{\the\toks0}%%
+ \def\pgfprofile@tempb{<autocheck>}%
+ \ifx\pgfprofile@temp\pgfprofile@tempb
+ \expandafter\global\expandafter\let\csname pgfprofile@repl@\pgfprofilenew@cmdname\endcsname=\pgfprofileinvokecommand@uptoonearg
+ \else
+ \expandafter\gdef\csname pgfprofile@repl@\pgfprofilenew@cmdname\endcsname#3{%
+ \pgfprofile@invokeorig{#4}%
+ }%
+ \fi
+ \xdef#2{\noexpand\pgfprofileinvokecommand{\pgfprofilenew@cmdname}}%
+ \endgroup
+ \fi
+}%
+
+\def\pgfprofileshowinvocationsfor#1{%
+ \pgfutil@ifundefined{b@pgfprofile@show@#1}{%
+ \PackageError{pgf}{\string\pgfprofileshowinvocationsfor{#1} doesn't work: the argument is no profiler entry}{}%
+ }{%
+ \expandafter\gdef\csname b@pgfprofile@show@#1\endcsname{1}%
+ \expandafter\gdef\csname b@pgfprofile@show@edef@#1\endcsname{0}%
+ }%
+}%
+\def\pgfprofileshowinvocationsexpandedfor#1{%
+ \pgfutil@ifundefined{b@pgfprofile@show@#1}{%
+ \PackageError{pgf}{\string\pgfprofileshowinvocationsfor{#1} doesn't work: the argument is no profiler entry}{}%
+ }{%
+ \expandafter\gdef\csname b@pgfprofile@show@#1\endcsname{1}%
+ \expandafter\gdef\csname b@pgfprofile@show@edef@#1\endcsname{1}%
+ }%
+}%
+
+\def\pgfprofile@no@optional@arg@text{<noarg>}
+\def\pgfprofileinvokecommand#1{%
+ \pgfutil@ifnextchar[{\pgfprofileinvokecommand@{#1}}{\pgfprofileinvokecommand@{#1}[<noarg>]}%
+}%
+\def\pgfprofileinvokecommand@#1[#2]{%
+ \def\pgfprofileinvokecommand@cs{#1}%
+ \def\pgfprofileinvokecommand@optarg{#2}%
+ \edef\pgfprofileinvokecommand@profilerentryname{\csname pgfprofile@name@for@#1\endcsname}%
+ \csname pgfprofile@repl@#1\endcsname%
+}%
+
+% #1 contains ALL arguments, including any braces.
+\def\pgfprofile@invokeorig#1{%
+ % re-insert the control sequence name and the optional argument:
+ % this wasn't possible directly.
+ \begingroup
+ \toks1=\expandafter{\pgfprofileinvokecommand@optarg}%
+ \toks2={#1}%
+ \toks3=\expandafter{\csname pgfprofile@orig@\pgfprofileinvokecommand@cs\endcsname}%
+ %
+ \ifx\pgfprofileinvokecommand@optarg\pgfprofile@no@optional@arg@text
+ % no [] argument after original command:
+ \xdef\pgfprofile@invokeorig@doitfinally{\the\toks3 \the\toks2 }%%
+ \else
+ \xdef\pgfprofile@invokeorig@doitfinally{\the\toks3[\the\toks1]\the\toks2 }%
+ \fi
+ \if1\csname b@pgfprofile@show@\pgfprofileinvokecommand@profilerentryname\endcsname
+ \pgfprofile@orig@show
+ \fi
+ \endgroup
+ \edef\pgfprofile@temp{{\pgfprofileinvokecommand@cs}{\pgfprofileinvokecommand@profilerentryname}}%
+ \expandafter\pgfprofile@invokeorig@\pgfprofile@temp%
+}%
+\def\pgfprofile@orig@show{%
+ \toks4=\expandafter{\csname\pgfprofileinvokecommand@cs\endcsname}%
+ \ifx\pgfprofileinvokecommand@optarg\pgfprofile@no@optional@arg@text
+ \def\pgfprofile@orig@show@args{\the\toks2 }%
+ \else
+ \def\pgfprofile@orig@show@args{[\the\toks1] \the\toks2 }%
+ \fi
+ \if1\csname b@pgfprofile@show@edef@\pgfprofileinvokecommand@profilerentryname\endcsname
+ \edef\pgfprofile@orig@show@args{\pgfprofile@orig@show@args}%
+ \edef\pgfprofile@orig@show@args{\pgfprofile@orig@show@args}%
+ \fi
+ \immediate\write16{pgflibraryprofiler: calling
+ \#\csname c@pgfprofile@numinvocations@\pgfprofileinvokecommand@profilerentryname\endcsname\space
+ (\the\toks4 \pgfprofile@orig@show@args)}%
+}%
+
+% #1: control sequence name (without backslash)
+% #2: profiler entry name
+\def\pgfprofile@invokeorig@#1#2{%
+ % this check should avoid save stack impact
+ \pgfprofileifisrunning{#2}{%
+ \pgfprofile@invokeorig@doitfinally%
+ }{%
+ \pgfprofilestart{#2}%
+ \pgfprofile@invokeorig@doitfinally%
+ \pgfprofileend{#2}%
+ }%
+}%
+
+
+\def\pgfprofileinvokecommand@uptoonearg{%
+ \pgfutil@ifnextchar\bgroup{\pgfprofileinvokecommand@onearg}{\pgfprofileinvokecommand@noarg}%
+}%
+\def\pgfprofileinvokecommand@onearg#1{%
+ \pgfprofile@invokeorig{{#1}}%
+}%
+\def\pgfprofileinvokecommand@noarg{%
+ \pgfprofile@invokeorig{}%
+}%
+
+
+
+% Starts / Resumes timing of the profiler entry named `#1'.
+%
+% The timing will continue until \pgfprofileend{#1} is called.
+%
+% Nested calls of \pgfprofilestart{#1} (with the same argument) will
+% result in the same result as if just one \pgfprofilestart command
+% has been issued.
+\def\pgfprofilestart#1{%
+ \pgfprofileifisrunning{#1}{%
+ \relax
+ }{%
+ \expandafter\xdef\csname c@pgfprofile@elapsed@at@start@#1\endcsname{\the\pdfelapsedtime}%
+ \expandafter\gdef\csname c@pgfprofile@subtractforself@#1\endcsname{0}%
+ \pgfprofile@advance{c@pgfprofile@numinvocations@#1}{1}%
+ \pgfprofilestackpush{#1}%
+ }%
+ \pgfprofile@advance{c@pgfprofile@semaphor@#1}{1}%
+}%
+
+% Stops / Interrupts timing of the profiler entry named `#1'.
+\def\pgfprofileend#1{%
+ \pgfprofile@advance{c@pgfprofile@semaphor@#1}{-1}%
+ \pgfprofileifisrunning{#1}{%
+ \relax
+ }{%
+ \begingroup
+ \c@pgf@countb=\pdfelapsedtime\relax
+ \advance\c@pgf@countb by-\csname c@pgfprofile@elapsed@at@start@#1\endcsname\relax
+ %
+ \pgfprofilestackpop\pgfretval
+ \edef\pgfprofile@temp{#1}%
+ \ifx\pgfprofile@temp\pgfretval
+ \else
+ \immediate\write16{pgflibraryprofiler WARNING: possible error in self time computation...}%
+ \fi
+ \pgfprofilestackifempty{%
+ \relax
+ }{%
+ \pgfprofilestacktop\pgfretval
+ \pgfprofile@advance{c@pgfprofile@subtractforself@\pgfretval}{\c@pgf@countb}%
+ }%
+ %
+ \pgfprofile@advance{c@pgfprofile@elapsedtotal@#1}{\c@pgf@countb}%
+ \advance\c@pgf@countb by-\csname c@pgfprofile@subtractforself@#1\endcsname\relax
+ \pgfprofile@advance{c@pgfprofile@elapsedself@#1}{\c@pgf@countb}%
+ \endgroup
+ }%
+}%
+
+% invokes '#2' if '#1' is currently running and '#3' if not.
+\def\pgfprofileifisrunning#1#2#3{%
+ \ifnum\csname c@pgfprofile@semaphor@#1\endcsname=0 \def\pgfprofileifisrunning@next{#3}\else \def\pgfprofileifisrunning@next{#2}\fi
+ \pgfprofileifisrunning@next
+}%
+
+% Sets the profiler entry whose total time is used to compute all
+% other relative times.
+\def\pgfprofilesetrel#1{\edef\pgfprofile@rel{#1}}%
+
+% Stops all running timings and postprocesses them.
+\def\pgfprofilepostprocess{%
+ \begingroup
+ %
+ % prepare files.
+ \c@pgf@countb=\time
+ \divide\c@pgf@countb by60
+ \c@pgf@countd=\c@pgf@countb
+ \multiply\c@pgf@countd by60
+ \c@pgf@countc=\time
+ \advance\c@pgf@countc by-\c@pgf@countd
+ \immediate\openout\w@pgf@writea=\jobname.profiler.\the\year-\pgfprofiletotwodigitstr\month-\pgfprofiletotwodigitstr\day_\pgfprofiletotwodigitstr\c@pgf@countb h_\pgfprofiletotwodigitstr\c@pgf@countc m.dat
+ \immediate\write\w@pgf@writea{%
+ \pgfprofile@percent relative values are measured against the totaltime of `\pgfprofile@rel'.%
+ }%
+ \immediate\write16{pgflibraryprofiler: relative values are measured against the totaltime of `\pgfprofile@rel'.}%
+ \immediate\write\w@pgf@writea{%
+ profilerentry\pgfprofile@TAB
+ totaltime[s]\pgfprofile@TAB
+ totaltime[percent]\pgfprofile@TAB
+ selftime[s]\pgfprofile@TAB
+ selftime[percent]\pgfprofile@TAB
+ numinvocations\pgfprofile@TAB}%
+ %
+ %
+ % compute main time and prepare computation of relative times:
+ \pgfprofileifisrunning{\pgfprofile@rel}{%
+ \pgfprofileend{\pgfprofile@rel}%
+ }{}%
+ \pgf@xa=\csname c@pgfprofile@elapsedtotal@\pgfprofile@rel\endcsname sp
+ \edef\pgfprofiletotaltime{\pgf@sys@tonumber\pgf@xa}%
+ \pgfmathreciprocal@{\pgfprofiletotaltime}%
+ \let\pgfprofiletotaltime@inv=\pgfmathresult
+ %
+ % postprocess each of them:
+ \pgfprofile@all@registered@list@foreach{%
+ \pgfprofileifisrunning{##1}{%
+ \pgfprofileend{##1}%
+ }{}%
+ \pgfprofilepostprocess@single{##1}%
+ }%
+ \immediate\write\w@pgf@writea{%
+ \pgfprofile@percent\space vim: ts=40 nowrap nostartofline
+ }%
+ \immediate\closeout\w@pgf@writea
+ \endgroup
+}%
+
+{%
+\catcode`\[=1 %
+\catcode`\]=2 %
+\catcode`\{=12 %
+\catcode`\}=12 %
+\catcode`\^^I=12
+\gdef\pgfprofile@lbrace[{]%
+\gdef\pgfprofile@rbrace[}]%
+\gdef\pgfprofile@TAB[^^I]%
+]
+{
+\catcode`\%=12 \gdef\pgfprofile@percent{%}}
+
+\def\pgfprofilepostprocess@single#1{%
+ \begingroup
+ \pgf@xa=\csname c@pgfprofile@elapsedtotal@#1\endcsname sp
+ \pgf@xb=\csname c@pgfprofile@elapsedself@#1\endcsname sp
+ \pgf@ya=\pgfprofiletotaltime@inv\pgf@xa
+ \pgf@yb=\pgfprofiletotaltime@inv\pgf@xb
+ \multiply\pgf@ya by100
+ \multiply\pgf@yb by100
+ \edef\pgfprofilecur@total{\pgf@sys@tonumber\pgf@xa}%
+ \edef\pgfprofilecur@self{\pgf@sys@tonumber\pgf@xb}%
+ \edef\pgfprofilecur@total@rel{\pgf@sys@tonumber\pgf@ya}%
+ \edef\pgfprofilecur@self@rel{\pgf@sys@tonumber\pgf@yb}%
+ \immediate\write16{
+ pgflibraryprofiler(#1)
+ \pgfprofile@lbrace
+ total time=\pgfprofilecur@total sec; (\pgfprofilecur@total@rel\pgfprofile@percent)
+ self time=\pgfprofilecur@self sec; (\pgfprofilecur@self@rel\pgfprofile@percent)
+ invocations=\csname c@pgfprofile@numinvocations@#1\endcsname;
+ \pgfprofile@rbrace
+ }%
+ \immediate\write\w@pgf@writea{%
+ #1\pgfprofile@TAB
+ \pgfprofilecur@total\pgfprofile@TAB
+ \pgfprofilecur@total@rel\pgfprofile@TAB
+ \pgfprofilecur@self\pgfprofile@TAB
+ \pgfprofilecur@self@rel\pgfprofile@TAB
+ \csname c@pgfprofile@numinvocations@#1\endcsname\pgfprofile@TAB
+ }%
+ \endgroup
+}%
+% Invokes '#2' for each element of the command separated list '#1'.
+% the current list element is available as '#1' inside of '#2'.
+\long\def\pgfprofileforeachentryinCSV#1#2{%
+ \long\def\pgfprofileinvokeforeach@@##1{#2}%
+ \pgfprofileforeachentryinCSVisterminated@loop#1,\pgfeov
+}%
+\long\def\pgfprofileforeachentryinCSVisterminated@loop{%
+ \pgfutil@ifnextchar\pgfeov{\pgfutil@gobble}{\pgfprofileforeachentryinCSV@next}%
+}%
+\long\def\pgfprofileforeachentryinCSV@next#1,{%
+ \pgfprofileinvokeforeach@@{#1}%
+ \pgfprofileforeachentryinCSVisterminated@loop%
+}%
+
+\xdef\pgfprofile@all@registered@list{}
+\xdef\pgfprofile@currently@running@list{}
+
+\def\pgfprofile@all@registered@list@add#1{%
+ \ifx\pgfprofile@all@registered@list\pgfutil@empty
+ \xdef\pgfprofile@all@registered@list{#1}%
+ \else
+ \xdef\pgfprofile@all@registered@list{\pgfprofile@all@registered@list,#1}%
+ \fi
+}%
+
+\def\pgfprofile@all@registered@list@foreach#1{%
+ \expandafter\pgfprofileforeachentryinCSV\expandafter{\pgfprofile@all@registered@list}{#1}%
+}%
+
+\def\pgfprofile@advance#1#2{%
+ \begingroup
+ \c@pgf@counta=\csname #1\endcsname\relax
+ \advance\c@pgf@counta by#2\relax
+ \expandafter\xdef\csname #1\endcsname{\the\c@pgf@counta}%
+ \endgroup
+}%
+
+\def\pgfprofile@cs@to@name@#1#2\relax{\def\pgfretval{#2}}
+
+% defines '\pgfretval' to be the control sequences name of '#1' *without* the backslash.
+\def\pgfprofile@cs@to@name#1{%
+ \expandafter\pgfprofile@cs@to@name@\string#1\relax
+}%
+
+\newcount\c@pgfprofile@stacktop
+
+\c@pgfprofile@stacktop=-1
+\def\pgfprofilestackpush#1{%
+ \global\advance\c@pgfprofile@stacktop by1
+ \expandafter\xdef\csname pgfprofile@stack@\the\c@pgfprofile@stacktop\endcsname{#1}%
+}%
+% pops the current stack top to macro #1
+\def\pgfprofilestackpop#1{%
+ \pgfprofilestacktop#1%
+ \global\advance\c@pgfprofile@stacktop by-1
+}%
+% returns the stack's top to macro #1
+\def\pgfprofilestacktop#1{%
+ \expandafter\let\expandafter#1\csname pgfprofile@stack@\the\c@pgfprofile@stacktop\endcsname
+}%
+\def\pgfprofilestackifempty#1#2{%
+ \ifnum\c@pgfprofile@stacktop<0 #1\else #2\fi
+}%
+
+
+\def\pgfprofiletotwodigitstr#1{\ifnum#1<10 0\the#1\else\the#1\fi}
+
+\pgfprofilenew{main job}
+\pgfprofilestart{main job}
+\expandafter\xdef\csname c@pgfprofile@elapsed@at@start@main job\endcsname{0}%
+\pgfprofilesetrel{main job}
+
+\pgfutil@ifundefined{AtEndDocument}{%
+ % no latex. ok.
+}{%
+ % do latex specific stuff:
+ \pgfprofilenew{preamble}
+ \pgfprofilestart{preamble}
+ \expandafter\xdef\csname c@pgfprofile@elapsed@at@start@preamble\endcsname{0}%
+ \AtBeginDocument{\pgfprofileend{preamble}}%
+ %
+ \AtEndDocument{\pgfprofilepostprocess}%
+}%
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex
new file mode 100644
index 00000000000..285f6d21772
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex
@@ -0,0 +1,409 @@
+% Copyright 2008 by Till Tantau and others
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshadings.code.tex,v 1.2 2008/10/29 23:06:34 tantau Exp $
+
+
+%
+% An hsv color wheel. Initial code graciously donated by Ken Starks.
+%
+
+\pgfdeclarefunctionalshading{color wheel white center}
+{\pgfpoint{-50bp}{-50bp}}
+{\pgfpoint{50bp}{50bp}}
+{}
+{ % x y
+ 2 copy % ... x y x y
+ 2 copy abs exch abs add 0.0001 ge
+ {atan 360.0 div} % ... x y heading; heading being in
+ %the interval [0, 1.0]
+ { pop } % silently deal with error: return
+ % arbitrary heading of zero for origin
+ ifelse % because we will use it for 'Hue'
+ 3 1 roll % ... heading x y
+ dup mul % ... heading x y*y
+ exch dup mul % ... heading y*y x*x
+ add sqrt % ... heading ra_pt (distance from origin in points)
+ 25.0 div % scale it means a ra of 25bp
+ dup 1.0 ge % BOOLEAN. ready to clamp to interval [0, 1.0]
+ { pop 1.0 }{} ifelse % We shall use the scaled ra as 'Saturation'
+ %2.5 mul 0.25 sub % now, Ra in [0.1, 0.5] --> Saturation
+ % in [0.0, 1.0]. Saturation varies between the two radii
+ 1.0 % ... H S V ( with 'Value' set to literal constant of 1.0 )
+ % C version to use as model:
+ % H' = H * 6
+ % i = floor(H')
+ % f = H' - i
+ % P = V * (1.0 - S)
+ % Q = V * (1.0 - (S*f))
+ % T = V * (1.0 - (S * (1.0 - f)))
+ 3 2 roll 6.0 mul dup 4 1 roll % H' S V H'
+ floor cvr % H' S V i
+ dup 5 1 roll % i H' S V i
+ 3 index sub neg % i H' S V f
+ 1.0 3 index sub % i H' S V f (1.0 - S )
+ 2 index mul % i H' S V f P
+ 6 1 roll % P i H' S V f
+ dup 3 index mul neg 1.0 add % P i H' S V f ( 1.0 - (f*S))
+ 2 index mul % P i H' S V f Q
+ 7 1 roll % Q P i H' S V f
+ neg 1.0 add % Q P i H' S V (1.0 - f)
+ 2 index mul neg 1.0 add % Q P i H' S V (1.0 - S * (1.0 - f))
+ 1 index mul % Q P i H' S V T
+ 7 2 roll % V T Q P i H' S
+ pop pop % V T Q P i
+ %%%
+ % end of BLOCK B. The rest is just stack manipulation
+ dup 0.5 le % TEST II [ i == 0 ]
+ { % BLOCK C [ take stack to V T P ]
+ pop exch pop
+ }
+ { dup 1.5 le % TEST III [ i == 1 ]
+ { % BLOCK D [ take stack to Q V P ]
+ pop exch 4 1 roll exch pop
+ }
+ { dup 2.5 le % TEST IV [ i == 2 ]
+ { % BLOCK E [ take stack to P V T ]
+ pop 4 1 roll pop
+ }
+ { dup 3.5 le % TEST V [ i == 3 ]
+ { % BLOCK F [ take stack to P Q V ]
+ pop exch 4 2 roll pop
+ }
+ { dup 4.5 le % TEST VI [ i == 4 ]
+ { % BLOCK G [ take stack to T P V ]
+ pop exch pop 3 -1 roll
+ }
+ { % BLOCK H [ take stack to V P Q ]
+ pop 3 1 roll exch pop
+ }
+ ifelse
+ }
+ ifelse % for V
+ }
+ ifelse % for IV
+ }
+ ifelse % for III
+ }
+ ifelse % for II
+}
+
+\pgfdeclarefunctionalshading{color wheel black center}
+{\pgfpoint{-50bp}{-50bp}}
+{\pgfpoint{50bp}{50bp}}
+{}
+{ % x y
+ 2 copy % ... x y x y
+ 2 copy abs exch abs add 0.0001 ge
+ {atan 360.0 div} % ... x y heading; heading being in
+ %the interval [0, 1.0]
+ { pop } % silently deal with error: return
+ % arbitrary heading of zero for origin
+ ifelse % because we will use it for 'Hue'
+ 3 1 roll % ... heading x y
+ dup mul % ... heading x y*y
+ exch dup mul % ... heading y*y x*x
+ add sqrt % ... heading ra_pt (distance from origin in points)
+ 25.0 div % scale it means a ra of 25bp
+ dup 1.0 ge % BOOLEAN. ready to clamp to interval [0, 1.0]
+ { pop 1.0 }{} ifelse % We shall use the scaled ra as 'Saturation'
+ %2.5 mul 0.25 sub % now, Ra in [0.1, 0.5] --> Saturation
+ % in [0.0, 1.0]. Saturation varies between the two radii
+ 1.0 exch % ... H S V ( with 'Value' set to literal constant of 1.0 )
+ % C version to use as model:
+ % H' = H * 6
+ % i = floor(H')
+ % f = H' - i
+ % P = V * (1.0 - S)
+ % Q = V * (1.0 - (S*f))
+ % T = V * (1.0 - (S * (1.0 - f)))
+ 3 2 roll 6.0 mul dup 4 1 roll % H' S V H'
+ floor cvr % H' S V i
+ dup 5 1 roll % i H' S V i
+ 3 index sub neg % i H' S V f
+ 1.0 3 index sub % i H' S V f (1.0 - S )
+ 2 index mul % i H' S V f P
+ 6 1 roll % P i H' S V f
+ dup 3 index mul neg 1.0 add % P i H' S V f ( 1.0 - (f*S))
+ 2 index mul % P i H' S V f Q
+ 7 1 roll % Q P i H' S V f
+ neg 1.0 add % Q P i H' S V (1.0 - f)
+ 2 index mul neg 1.0 add % Q P i H' S V (1.0 - S * (1.0 - f))
+ 1 index mul % Q P i H' S V T
+ 7 2 roll % V T Q P i H' S
+ pop pop % V T Q P i
+ %%%
+ % end of BLOCK B. The rest is just stack manipulation
+ dup 0.5 le % TEST II [ i == 0 ]
+ { % BLOCK C [ take stack to V T P ]
+ pop exch pop
+ }
+ { dup 1.5 le % TEST III [ i == 1 ]
+ { % BLOCK D [ take stack to Q V P ]
+ pop exch 4 1 roll exch pop
+ }
+ { dup 2.5 le % TEST IV [ i == 2 ]
+ { % BLOCK E [ take stack to P V T ]
+ pop 4 1 roll pop
+ }
+ { dup 3.5 le % TEST V [ i == 3 ]
+ { % BLOCK F [ take stack to P Q V ]
+ pop exch 4 2 roll pop
+ }
+ { dup 4.5 le % TEST VI [ i == 4 ]
+ { % BLOCK G [ take stack to T P V ]
+ pop exch pop 3 -1 roll
+ }
+ { % BLOCK H [ take stack to V P Q ]
+ pop 3 1 roll exch pop
+ }
+ ifelse
+ }
+ ifelse % for V
+ }
+ ifelse % for IV
+ }
+ ifelse % for III
+ }
+ ifelse % for II
+}
+
+\pgfdeclarefunctionalshading{color wheel}
+{\pgfpoint{-50bp}{-50bp}}
+{\pgfpoint{50bp}{50bp}}
+{}
+{ % x y
+ 2 copy abs exch abs add 0.0001 ge
+ {atan 360.0 div} % ... x y heading; heading being in
+ %the interval [0, 1.0]
+ { pop } % silently deal with error: return
+ % arbitrary heading of zero for origin
+ ifelse % because we will use it for 'Hue'
+ 1.0 1.0 % ... H S V
+ % C version to use as model:
+ % H' = H * 6
+ % i = floor(H')
+ % f = H' - i
+ % P = V * (1.0 - S)
+ % Q = V * (1.0 - (S*f))
+ % T = V * (1.0 - (S * (1.0 - f)))
+ 3 2 roll 6.0 mul dup 4 1 roll % H' S V H'
+ floor cvr % H' S V i
+ dup 5 1 roll % i H' S V i
+ 3 index sub neg % i H' S V f
+ 1.0 3 index sub % i H' S V f (1.0 - S )
+ 2 index mul % i H' S V f P
+ 6 1 roll % P i H' S V f
+ dup 3 index mul neg 1.0 add % P i H' S V f ( 1.0 - (f*S))
+ 2 index mul % P i H' S V f Q
+ 7 1 roll % Q P i H' S V f
+ neg 1.0 add % Q P i H' S V (1.0 - f)
+ 2 index mul neg 1.0 add % Q P i H' S V (1.0 - S * (1.0 - f))
+ 1 index mul % Q P i H' S V T
+ 7 2 roll % V T Q P i H' S
+ pop pop % V T Q P i
+ %%%
+ % end of BLOCK B. The rest is just stack manipulation
+ dup 0.5 le % TEST II [ i == 0 ]
+ { % BLOCK C [ take stack to V T P ]
+ pop exch pop
+ }
+ { dup 1.5 le % TEST III [ i == 1 ]
+ { % BLOCK D [ take stack to Q V P ]
+ pop exch 4 1 roll exch pop
+ }
+ { dup 2.5 le % TEST IV [ i == 2 ]
+ { % BLOCK E [ take stack to P V T ]
+ pop 4 1 roll pop
+ }
+ { dup 3.5 le % TEST V [ i == 3 ]
+ { % BLOCK F [ take stack to P Q V ]
+ pop exch 4 2 roll pop
+ }
+ { dup 4.5 le % TEST VI [ i == 4 ]
+ { % BLOCK G [ take stack to T P V ]
+ pop exch pop 3 -1 roll
+ }
+ { % BLOCK H [ take stack to V P Q ]
+ pop 3 1 roll exch pop
+ }
+ ifelse
+ }
+ ifelse % for V
+ }
+ ifelse % for IV
+ }
+ ifelse % for III
+ }
+ ifelse % for II
+}
+
+
+%
+% A bilinear interpolation.
+%
+
+\colorlet{lower left}{white}
+\colorlet{lower right}{white}
+\colorlet{upper left}{white}
+\colorlet{upper right}{white}
+
+\pgfdeclarefunctionalshading[lower left,lower right,upper left,upper right]{bilinear interpolation}
+{\pgfpointorigin}
+{\pgfpoint{100bp}{100bp}}
+{
+ \pgfshadecolortorgb{lower left}{\pgf@lib@shadings@ll}\pgfshadecolortorgb{lower right}{\pgf@lib@shadings@lr}
+ \pgfshadecolortorgb{upper right}{\pgf@lib@shadings@ur}\pgfshadecolortorgb{upper left}{\pgf@lib@shadings@ul}
+}{
+ 25 sub 50 div exch 25 sub 50 div 2 copy % Calculate y/100 x/100.
+% 100 div exch 100 div 2 copy % Calculate y/100 x/100.
+ neg 1 add exch neg 1 add % Calculate 1-y/100 1-x/100.
+ 3 1 roll 2 copy exch 5 2 roll 6 copy 6 copy % Set up stack.
+ \pgf@lib@shadings@llred mul exch \pgf@lib@shadings@lrred mul add mul % Process red component.
+ 4 1 roll
+ \pgf@lib@shadings@urred mul exch \pgf@lib@shadings@ulred mul add mul
+ add
+ 13 1 roll
+ \pgf@lib@shadings@llgreen mul exch \pgf@lib@shadings@lrgreen mul add mul % Process green component.
+ 4 1 roll
+ \pgf@lib@shadings@urgreen mul exch \pgf@lib@shadings@ulgreen mul add mul
+ add
+ 7 1 roll
+ \pgf@lib@shadings@llblue mul exch \pgf@lib@shadings@lrblue mul add mul % Process blue component.
+ 4 1 roll
+ \pgf@lib@shadings@urblue mul exch \pgf@lib@shadings@ulblue mul add mul
+ add
+}
+
+
+%
+% A Mandelbrot set shading. Just for fun...
+%
+
+\pgfdeclarefunctionalshading{Mandelbrot set}
+{\pgfpoint{-50bp}{-50bp}}
+{\pgfpoint{50bp}{50bp}}{}
+{
+ 12.5 div exch 12.5 div exch
+ 1 index 1 index
+ % Stack: c_r c_i z_r z_i
+ % Formula: z' = z^2 + c = (z_r + i z_i)^2 + c_r + i c_i
+ % = (z_r^2 - z_i^2 + c_r) + i (2 z_r z_i + c_i)
+ %
+ % First iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Second iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Third iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Fourth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Check for break (to avoid too large numbers)
+ 1 index dup mul 1 index dup mul add
+ 4 lt {
+ % Fifth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Sixth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Seventh iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Eighth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Ninth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ % Tenth iteration
+ % 1. Compute z_r^2 -z_i^2 + c_r
+ 1 index dup mul % z_r^2
+ 1 index dup mul % z_i^2
+ sub % z_r^2 - z_i^2
+ 4 index add % z_r^2 -z_i^2 + c_r
+ % 2. Compute 2 z_r z_i + c_i
+ 3 1 roll
+ mul 2 mul % 2 z_r z_i
+ 2 index add % 2 z_r z_i + c_i
+ } { pop pop 1000.0 1000.0 } ifelse
+ % Compute distance
+ dup mul exch
+ dup mul
+ add sqrt
+ dup 4 1 roll
+ 2 gt { pop pop 2.0 exch div 1.0 exch sub dup dup} {pop pop 0.0 0.0 0.0} ifelse
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex
deleted file mode 100644
index 41f0fcfb243..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex
+++ /dev/null
@@ -1,1097 +0,0 @@
-% Copyright 2007 by Till Tantau and Mark Wibrow
-%
-% 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.
-
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.multipart.code.tex,v 1.7 2008/01/15 15:41:18 vibrovski Exp $
-
-\newbox\pgfnodepartlowerbox
-
-%
-% A circle that is split in the middle into an upper and a lower part.
-%
-% This node consists of two parts: The upper (main) part is shown in
-% the upper half of the circle. The second part is the (optional)
-% lower part.
-%
-% Parts: text, lower
-
-\pgfdeclareshape{circle split}
-{
- %
- % Node parts
- %
- \nodeparts{text,lower}
-
- %
- % Anchors
- %
- \savedanchor\centerpoint{%
- \pgf@x=.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgf@y=-\pgf@y%
- \advance\pgf@y by-\dp\pgfnodeparttextbox%
- \advance\pgf@y by-.5\pgflinewidth%
- }%
- \savedanchor\loweranchor{%
- \pgf@x=-.5\wd\pgfnodepartlowerbox%
- \advance\pgf@x by.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgf@y=-2\pgf@y%
- \advance\pgf@y by-\ht\pgfnodepartlowerbox%
- \advance\pgf@y by-.5\pgflinewidth%
- \advance\pgf@y by-\dp\pgfnodeparttextbox%
- \advance\pgf@y by-.5\pgflinewidth%
- }
-
- \saveddimen\radius{%
- %
- % Caculate ``height radius''
- %
- %\pgf@ya=.5\ht\pgfnodeparttextbox%
-% \advance\pgf@ya by.5\dp\pgfnodeparttextbox%
-% \advance\pgf@ya by.5\ht\pgfnodepartlowerbox%
-% \advance\pgf@ya by.5\dp\pgfnodepartlowerbox%
-% \advance\pgf@ya by.5\pgflinewidth%
- %
- % MW: Suggested correction for above calculation: Use the tallest box * 2.
- %
- \pgf@ya=.5\ht\pgfnodeparttextbox%
- \advance\pgf@ya by.5\dp\pgfnodeparttextbox%
- \pgf@yb=.5\ht\pgfnodepartlowerbox%
- \advance\pgf@yb by.5\dp\pgfnodepartlowerbox%
- \ifdim\pgf@ya>\pgf@yb\relax%
- \pgf@ya2.0\pgf@ya\relax%
- \else%
- \pgf@ya2.0\pgf@yb\relax%
- \fi%
- \advance\pgf@ya by.5\pgflinewidth%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@ya by2\pgf@yb%
- %
- % Caculate ``width radius''
- %
- \pgf@xa=.5\wd\pgfnodeparttextbox%
- \ifdim\pgf@xa<.5\wd\pgfnodepartlowerbox%
- \pgf@xa=.5\wd\pgfnodepartlowerbox%
- \fi%
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@xa by\pgf@xb%
- %
- % Calculate length of radius vector:
- %
- \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
- \ifdim\pgf@x>\pgf@y%
- \c@pgf@counta=\pgf@x%
- \ifnum\c@pgf@counta=0\relax%
- \else%
- \divide\c@pgf@counta by 255\relax%
- \pgf@xa=16\pgf@xa\relax%
- \divide\pgf@xa by\c@pgf@counta%
- \pgf@xa=16\pgf@xa\relax%
- \fi%
- \else%
- \c@pgf@counta=\pgf@y%
- \ifnum\c@pgf@counta=0\relax%
- \else%
- \divide\c@pgf@counta by 255\relax%
- \pgf@ya=16\pgf@ya\relax%
- \divide\pgf@ya by\c@pgf@counta%
- \pgf@xa=16\pgf@ya\relax%
- \fi%
- \fi%
- \pgf@x=\pgf@xa%
- %
- % If necessary, adjust radius so that the size requirements are
- % met:
- %
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@x<.5\pgf@xb%
- \pgf@x=.5\pgf@xb%
- \fi%
- \ifdim\pgf@x<.5\pgf@yb%
- \pgf@x=.5\pgf@yb%
- \fi%
- %
- % Now, add larger of outer sepearations.
- %
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@xb<\pgf@yb%
- \advance\pgf@x by\pgf@yb%
- \else%
- \advance\pgf@x by\pgf@xb%
- \fi%
- }
-
- %
- % Anchors
- %
- \inheritanchorborder[from=circle]
- \inheritanchor[from=circle]{north}
- \inheritanchor[from=circle]{north west}
- \inheritanchor[from=circle]{north east}
- \inheritanchor[from=circle]{center}
- \inheritanchor[from=circle]{west}
- \inheritanchor[from=circle]{east}
- \inheritanchor[from=circle]{mid}
- \inheritanchor[from=circle]{mid west}
- \inheritanchor[from=circle]{mid east}
- \inheritanchor[from=circle]{base}
- \inheritanchor[from=circle]{base west}
- \inheritanchor[from=circle]{base east}
- \inheritanchor[from=circle]{south}
- \inheritanchor[from=circle]{south west}
- \inheritanchor[from=circle]{south east}
- \anchor{lower}{\loweranchor}
-
- %
- % Background path
- %
- \inheritbackgroundpath[from=circle]
- \beforebackgroundpath{
- \pgfutil@tempdima=\radius%
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@xb<\pgf@yb%
- \advance\pgfutil@tempdima by-\pgf@yb%
- \else%
- \advance\pgfutil@tempdima by-\pgf@xb%
- \fi%
- \advance\pgfutil@tempdima by-.5\pgflinewidth%
- \pgfsetshortenstart{0pt}%
- \pgfsetshortenend{0pt}%
- \pgfsetarrows{-}%
- \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpoint{-1\pgfutil@tempdima}{0pt}}}%
- \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpoint{\pgfutil@tempdima}{0pt}}}%
- \pgfusepath{stroke}%
- }
-}
-
-
-
-
-
-% (Most) keys for shape rectangle split.
-%
-% /pgf/rectangle split parts : Set the number of rectangles to split into.
-% /pgf/rectangle split part align : Align the for the boxes in each part
-% (also keys for each part)
-% /pgf/rectangle split use custom fill : Use a custom (behindbackground path) fill.
-% /pgf/rectangle split part fill : Custom fill for ech part.
-% (also keys for each part)
-% /pgf/rectangle split draw splits : Draw the line between node parts.
-% /pgf/rectangle split empty part height : Set the default height for empty boxes.
-
-
-\newif\ifpgfrectanglesplitdrawsplits
-\pgfrectanglesplitdrawsplitstrue
-
-\newif\ifpgfrectanglesplitusecustomfill
-\pgfrectanglesplitusecustomfillfalse
-
-\pgfkeys{/pgf/.cd,
- rectangle split parts/.initial=4,
- rectangle split empty part height/.initial=1ex,
- rectangle split draw splits/.is if=pgfrectanglesplitdrawsplits,
- %
- rectangle split part align/.code=\pgf@lib@shapes@rectanglesplit@assigntoparts{#1}{align},
- rectangle split text part align/.initial=center,
- rectangle split second part align/.initial=center,
- rectangle split third part align/.initial=center,
- rectangle split fourth part align/.initial=center,
- %
- rectangle split use custom fill/.is if=pgfrectanglesplitusecustomfill,
- rectangle split part fill/.code={%
- \pgfrectanglesplitusecustomfilltrue%
- \pgf@lib@shapes@rectanglesplit@assigntoparts{#1}{fill}%
- },
- rectangle split text part fill/.initial=white,
- rectangle split second part fill/.initial=white,
- rectangle split third part fill/.initial=white,
- rectangle split fourth part fill/.initial=white
-}
-
-% Internal macros for the rectangle split shape.
-%
-\def\pgf@lib@shapes@rectanglesplit@left{left}
-\def\pgf@lib@shapes@rectanglesplit@right{right}
-
-\def\pgf@lib@shapes@rectanglesplit@assigntoparts#1#2{%
- \expandafter\pgf@lib@shapes@rectanglesplit@@assigntoparts#1,\@@,\@@,\@@,\@@,\pgf@lib#2\pgf@lib}
-\def\pgf@lib@shapes@rectanglesplit@@assigntoparts#1,#2,#3,#4,#5\pgf@lib#6\pgf@lib{%
- \pgfkeys{/pgf/.cd,%
- rectangle split text part #6=#1,
- rectangle split second part #6=#1,
- rectangle split third part #6=#1,
- rectangle split fourth part #6=#1
- }%
- \ifx#2\@@\else%
- \pgfkeys{/pgf/.cd,%
- rectangle split second part #6=#2,
- rectangle split third part #6=#2,
- rectangle split fourth part #6=#2
- }%
- \fi%
- \ifx#3\@@\else%
- \pgfkeys{/pgf/.cd,%
- rectangle split third part #6=#3,
- rectangle split fourth part #6=#3
- }%
- \fi%
- \ifx#4\@@\else%
- \pgfkeys{/pgf/rectangle split fourth part #6=#4}%
- \fi%
-}%
-
-\newbox\pgfnodepartsecondbox
-\newbox\pgfnodepartthirdbox
-\newbox\pgfnodepartfourthbox
-
-\pgfdeclareshape{rectangle split}{%
- \nodeparts{text,second,third,fourth}
- \savedmacro\getrectanglesplitparameters{%
- %
- % If the height+depth of any box is 0pt use the default empty height.
- %
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle split empty part height}}
- \pgf@y\ht\pgfnodeparttextbox%
- \advance\pgf@y\dp\pgfnodeparttextbox%
- \ifdim\pgf@y=0pt\relax%
- \setbox\pgfnodeparttextbox=\hbox{%
- \vrule width0pt height\the\pgfutil@tempdima depth0pt%
- }%
- \fi%
- \pgf@y\ht\pgfnodepartsecondbox%
- \advance\pgf@y\dp\pgfnodepartsecondbox%
- \ifdim\pgf@y=0pt\relax%
- \setbox\pgfnodepartsecondbox=\hbox{%
- \vrule width0pt height\the\pgfutil@tempdima depth0pt%
- }%
- \fi%
- \pgf@y\ht\pgfnodepartthirdbox%
- \advance\pgf@y\dp\pgfnodepartthirdbox%
- \ifdim\pgf@y=0pt\relax%
- \setbox\pgfnodepartthirdbox=\hbox{%
- \vrule width0pt height\the\pgfutil@tempdima depth0pt%
- }%
- \fi%
- \pgf@y\ht\pgfnodepartfourthbox%
- \advance\pgf@y\dp\pgfnodepartfourthbox%
- \ifdim\pgf@y=0pt\relax%
- \setbox\pgfnodepartfourthbox=\hbox{%
- \vrule width0pt height\the\pgfutil@tempdima depth0pt%
- }%
- \fi%
- %
- % Empty boxes (without voiding them) if they are not used.
- %
- \pgfmathtruncatemacro\parts{\pgfkeysvalueof{/pgf/rectangle split parts}}%
- \addtosavedmacro{\parts}%
- \ifnum\parts<2\relax%
- \setbox\pgfnodepartsecondbox=\hbox{}%
- \fi%
- \ifnum\parts<3\relax%
- \setbox\pgfnodepartthirdbox=\hbox{}%
- \fi%
- \ifnum\parts<4\relax%
- \setbox\pgfnodepartfourthbox=\hbox{}%
- \fi%
- %
- % Save the line width.
- %
- \pgfmathsetlength\pgf@x{\pgflinewidth}
- \edef\linewidth{\the\pgf@x}%
- \addtosavedmacro{\linewidth}%
- %
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \edef\innerysep{\the\pgf@y}%
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \edef\innerxsep{\the\pgf@x}%
- %
- % Get the widths.
- %
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@xa.5\wd\pgfnodepartsecondbox%
- \pgf@xb.5\wd\pgfnodepartthirdbox%
- \pgf@xc.5\wd\pgfnodepartfourthbox%
- %
- % Find the maximum width%
- %
- \pgfutil@tempdima\pgf@x%
- \ifdim\pgfutil@tempdima<\pgf@xa%
- \pgfutil@tempdima\pgf@xa%
- \fi%
- \ifdim\pgfutil@tempdima<\pgf@xb%
- \pgfutil@tempdima\pgf@xb%
- \fi%
- \ifdim\pgfutil@tempdima<\pgf@xc%
- \pgfutil@tempdima\pgf@xc%
- \fi%
- %
- % Adjust for alignment.
- %
- \edef\pgf@lib@temp{\pgfkeysvalueof{/pgf/rectangle split text part align}}%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@left%
- \pgf@x-\pgfutil@tempdima%
- \else%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@right%
- \pgf@x-2.0\pgf@x%
- \advance\pgf@x\pgfutil@tempdima%
- \else%
- \pgf@x-\pgf@x%
- \fi%
- \fi%
- %
- \edef\pgf@lib@temp{\pgfkeysvalueof{/pgf/rectangle split second part align}}%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@left%
- \pgf@xa-\pgfutil@tempdima%
- \else%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@right%
- \pgf@xa-2.0\pgf@xa%
- \advance\pgf@xa\pgfutil@tempdima%
- \else%
- \pgf@xa-\pgf@xa%
- \fi%
- \fi%
- %
- \edef\pgf@lib@temp{\pgfkeysvalueof{/pgf/rectangle split third part align}}%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@left%
- \pgf@xb-\pgfutil@tempdima%
- \else%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@right%
- \pgf@xb-2.0\pgf@xb%
- \advance\pgf@xb\pgfutil@tempdima%
- \else%
- \pgf@xb-\pgf@xb%
- \fi%
- \fi%
- %
- \edef\pgf@lib@temp{\pgfkeysvalueof{/pgf/rectangle split fourth part align}}%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@left%
- \pgf@xc-\pgfutil@tempdima%
- \else%
- \ifx\pgf@lib@temp\pgf@lib@shapes@rectanglesplit@right%
- \pgf@xc-2.0\pgf@xc%
- \advance\pgf@xc\pgfutil@tempdima%
- \else%
- \pgf@xc-\pgf@xc%
- \fi%
- \fi%
- %
- % Make relative to x.
- %
- \advance\pgf@xa-\pgf@x%
- \advance\pgf@xb-\pgf@x%
- \advance\pgf@xc-\pgf@x%
- \pgf@x0pt%
- %
- % Find the minimum.
- %
- \pgfutil@tempdimb\pgf@x%
- \ifdim\pgfutil@tempdimb>\pgf@xa%
- \pgfutil@tempdimb\pgf@xa%
- \fi%
- \ifdim\pgfutil@tempdimb>\pgf@xb%
- \pgfutil@tempdimb\pgf@xb%
- \fi%
- \ifdim\pgfutil@tempdimb>\pgf@xc%
- \pgfutil@tempdimb\pgf@xc%
- \fi%
- %
- % Anchor for the text box is (0pt, 0pt)
- %
- \pgfsavepgf@process\textanchor{\pgfqpoint{0pt}{0pt}}%
- %
- % Anchor for second box.
- %
- \pgfsavepgf@process\lowestanchor{\pgfqpoint{0pt}{0pt}}%
- \let\lowestbox\pgfnodeparttextbox%
- \ifnum\parts>1\relax%
- \pgfsavepgf@process\secondanchor{%
- \pgf@x\pgf@xa%
- \pgf@y-\dp\pgfnodeparttextbox%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\pgflinewidth%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\ht\pgfnodepartsecondbox%
- }%
- \let\lowestanchor\secondanchor%
- \let\lowestbox\pgfnodepartsecondbox%
- \else%
- \let\secondanchor\textanchor%
- \fi%
- %
- % Anchor for third box.
- %
- \ifnum\parts>2\relax%
- \pgfsavepgf@process\thirdanchor{%
- \lowestanchor%
- \pgf@x\pgf@xb%
- \advance\pgf@y-\dp\pgfnodepartsecondbox%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\pgflinewidth%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\ht\pgfnodepartthirdbox%
- }%
- \let\lowestanchor\thirdanchor%
- \let\lowestbox\pgfnodepartthirdbox%
- \else%
- \let\thirdanchor\secondanchor%
- \fi%
- %
- % Anchor for fourth box.
- %
- \ifnum\parts>3\relax%
- \pgfsavepgf@process\fourthanchor{%
- \lowestanchor%
- \pgf@x\pgf@xc%
- \advance\pgf@y-\dp\lowestbox%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\pgflinewidth%
- \advance\pgf@y-\innerysep\relax%
- \advance\pgf@y-\ht\pgfnodepartfourthbox%
- }%
- \let\lowestanchor\fourthanchor%
- \let\lowestbox\pgfnodepartfourthbox%
- \else%
- \let\fourthanchor\thirdanchor%
- \fi%
- %
- \addtosavedmacro{\textanchor}%
- \addtosavedmacro{\secondanchor}%
- \addtosavedmacro{\thirdanchor}%
- \addtosavedmacro{\fourthanchor}%
- %
- % Adjust the boxwidth for minimum width
- %
- \pgfmathaddtolength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgfutil@tempdima<.5\pgf@x%
- \pgfutil@tempdima.5\pgf@x%
- \fi%
- \pgfmathaddtolength\pgfutil@tempdima{-\pgfkeysvalueof{/pgf/inner xsep}}%
- %
- % Get some important points.
- %
- \pgfsavepgf@process\southwest{%
- \lowestanchor%
- \pgf@x\pgfutil@tempdimb%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgf@ya\linewidth\relax%
- \advance\pgf@x-.5\pgf@ya%
- \advance\pgf@y-\dp\lowestbox%
- \advance\pgf@y-.5\pgf@ya%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \pgfsavepgf@process\northeast{%
- \pgf@x\pgfutil@tempdimb%
- \advance\pgf@x2.0\pgfutil@tempdima%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgf@ya\linewidth\relax%
- \advance\pgf@x.5\pgf@ya%
- \pgf@y\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\pgf@ya%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \addtosavedmacro{\northeast}%
- \addtosavedmacro{\southwest}%
- \pgfsavepgf@process\centerpoint{%
- \pgfpointadd{\southwest}{%
- \pgfpointdiff{\southwest}{\northeast}%
- \pgf@x.5\pgf@x%
- \pgf@y.5\pgf@y%
- }%
- }%
- \addtosavedmacro{\centerpoint}%
- \pgfsavepgf@process\south{%
- \centerpoint%
- \pgf@xa\pgf@x%
- \southwest%
- \pgf@x\pgf@xa%
- }%
- %
- % Get the split points.
- %
- \let\lastsplit\south%
- \ifnum\parts>1\relax%
- \pgfsavepgf@process\textsplit{%
- \pgf@x\pgfutil@tempdimb%
- \advance\pgf@x\pgfutil@tempdima%
- \pgf@y-\dp\pgfnodeparttextbox%
- \advance\pgf@y-\innerysep%
- \advance\pgf@y-.5\pgflinewidth%
- }%
- \else%
- \let\textsplit\south%
- \fi%
- \addtosavedmacro{\textsplit}%
- \pgfsavepgf@process\textspliteast{%
- \textsplit%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\textspliteast}%
- \pgfsavepgf@process\textsplitwest{%
- \textsplit%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\textsplitwest}%
- \ifnum\parts>2\relax%
- \pgfsavepgf@process\secondsplit{%
- \secondanchor%
- \pgf@x\pgfutil@tempdimb%
- \advance\pgf@x\pgfutil@tempdima%
- \advance\pgf@y-\dp\pgfnodepartsecondbox%
- \advance\pgf@y-\innerysep%
- \advance\pgf@y-.5\pgflinewidth%
- }%
- \else%
- \let\secondsplit\south%
- \fi%
- \addtosavedmacro{\secondsplit}%
- \pgfsavepgf@process\secondspliteast{%
- \secondsplit%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\secondspliteast}%
- \pgfsavepgf@process\secondsplitwest{%
- \secondsplit%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\secondsplitwest}%
- \ifnum\parts>3\relax%
- \pgfsavepgf@process\thirdsplit{%
- \thirdanchor%
- \pgf@x\pgfutil@tempdimb%
- \advance\pgf@x\pgfutil@tempdima%
- \advance\pgf@y-\dp\pgfnodepartthirdbox%
- \advance\pgf@y-\innerysep%
- \advance\pgf@y-.5\pgflinewidth%
- }%
- \let\lastsplit\thirdsplit%
- \else%
- \let\thirdsplit\south%
- \fi%
- \addtosavedmacro{\thirdsplit}%
- \pgfsavepgf@process\thirdspliteast{%
- \thirdsplit%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\thirdspliteast}%
- \pgfsavepgf@process\thirdsplitwest{%
- \thirdsplit%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro{\thirdsplitwest}%
- }%
- \savedanchor\basepoint{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
- \pgf@y0pt\relax%
- }%
- \savedanchor\midpoint{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- \anchor{center}{\getrectanglesplitparameters\centerpoint}%
- \anchor{base}{\basepoint}%
- \anchor{mid}{\midpoint}%
- \anchor{second}{\getrectanglesplitparameters\secondanchor}%
- \anchor{third}{\getrectanglesplitparameters\thirdanchor}%
- \anchor{fourth}{\getrectanglesplitparameters\fourthanchor}%
- \anchor{north east}{\getrectanglesplitparameters\northeast}
- \anchor{south west}{\getrectanglesplitparameters\southwest}
- \anchor{south east}{%
- \getrectanglesplitparameters%
- \northeast%
- \pgf@xa\pgf@x%
- \southwest%
- \pgf@x\pgf@xa}
- \anchor{north west}{%
- \getrectanglesplitparameters%
- \northeast%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya}
- \anchor{south}{%
- \getrectanglesplitparameters%
- \centerpoint%
- \pgf@xa\pgf@x%
- \southwest%
- \pgf@x\pgf@xa}
- \anchor{north}{%
- \getrectanglesplitparameters%
- \centerpoint%
- \pgf@xa\pgf@x%
- \northeast%
- \pgf@x\pgf@xa}
- \anchor{west}{%
- \getrectanglesplitparameters%
- \centerpoint%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya}
- \anchor{east}{%
- \getrectanglesplitparameters%
- \centerpoint%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya}
- \anchor{text split}{\getrectanglesplitparameters\textsplit}
- \anchor{text split east}{\getrectanglesplitparameters\textspliteast}
- \anchor{text split west}{\getrectanglesplitparameters\textsplitwest}
- \anchor{second split}{\getrectanglesplitparameters\secondsplit}
- \anchor{second split east}{\getrectanglesplitparameters\secondspliteast}
- \anchor{second split west}{\getrectanglesplitparameters\secondsplitwest}
- \anchor{third split}{\getrectanglesplitparameters\thirdsplit}
- \anchor{third split east}{\getrectanglesplitparameters\thirdspliteast}
- \anchor{third split west}{\getrectanglesplitparameters\thirdsplitwest}
- \anchor{text east}{%
- \getrectanglesplitparameters%
- \ifnum\parts>1\relax%
- \textsplit%
- \pgf@ya\pgf@y
- \northeast%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@ya\linewidth\relax%
- \advance\pgf@y-.25\pgf@ya%
- \else%
- \centerpoint%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- \fi%
- }
- \anchor{text west}{%
- \getrectanglesplitparameters%
- \ifnum\parts>1\relax%
- \textsplit%
- \pgf@ya\pgf@y
- \southwest%
- \pgf@xa\pgf@x%
- \northeast%
- \pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@ya\linewidth\relax%
- \advance\pgf@y-.25\pgf@ya%
- \else%
- \centerpoint%
- \pgf@ya\pgf@y%
- \southwest%
- \pgf@y\pgf@ya%
- \fi%
- }
- \anchor{second east}{%
- \getrectanglesplitparameters%
- \ifnum\parts>1\relax%
- \northeast%
- \pgf@xa\pgf@x%
- \secondsplit%
- \pgf@ya\pgf@y
- \textsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \southwest%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- \fi%
- }
- \anchor{second west}{%
- \getrectanglesplitparameters%
- \ifnum\parts>1\relax%
- \southwest%
- \pgf@xa\pgf@x%
- \secondsplit%
- \pgf@ya\pgf@y
- \textsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \southwest%
- \fi%
- }
- \anchor{third east}{%
- \getrectanglesplitparameters%
- \ifnum\parts>2\relax%
- \northeast%
- \pgf@xa\pgf@x%
- \thirdsplit%
- \pgf@ya\pgf@y
- \secondsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \southwest%
- \pgf@ya\pgf@y%
- \northeast%
- \pgf@y\pgf@ya%
- \fi%
- }
- \anchor{third west}{%
- \getrectanglesplitparameters%
- \ifnum\parts>2\relax%
- \southwest%
- \pgf@xa\pgf@x%
- \thirdsplit%
- \pgf@ya\pgf@y
- \secondsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \southwest
- \fi%
- }
- \anchor{fourth east}{%
- \getrectanglesplitparameters%
- \ifnum\parts>3\relax%
- \northeast%
- \pgf@xa\pgf@x%
- \southwest%
- \pgf@ya\linewidth\relax%
- \pgf@ya.5\pgf@ya%
- \advance\pgf@ya\pgf@y%
- \thirdsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \northeast%
- \pgf@xa\pgf@x%
- \southwest%
- \pgf@x\pgf@xa%
- \fi%
- }
- \anchor{fourth west}{%
- \getrectanglesplitparameters%
- \ifnum\parts>3\relax%
- \southwest%
- \pgf@xa\pgf@x%
- \pgf@ya\linewidth\relax%
- \pgf@ya.5\pgf@ya%
- \advance\pgf@ya\pgf@y%
- \thirdsplit%
- \advance\pgf@y\pgf@ya%
- \pgf@y.5\pgf@y%
- \pgf@x\pgf@xa%
- \else%
- \southwest%
- \fi%
- }
- \backgroundpath{%
- \getrectanglesplitparameters%
- %
- % Remove outer sep.
- %
- \pgfsavepgf@process\southwest{%
- \southwest%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \pgfsavepgf@process\northeast{%
- \northeast%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \pgfsavepgf@process\textsplit{%
- \textsplit%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\secondsplit{%
- \secondsplit%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\thirdsplit{%
- \thirdsplit%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfpathrectangle{\southwest}{\pgfpointdiff{\southwest}{\northeast}}%
- {%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \ifnum\parts>1\relax%
- \pgfpathmoveto{\textsplit\pgf@ya\pgf@y\southwest\pgf@y\pgf@ya}%
- \pgfpathlineto{\textsplit\pgf@ya\pgf@y\northeast\pgf@y\pgf@ya}%
- \fi%
- \ifnum\parts>2\relax%
- \pgfpathmoveto{\secondsplit\pgf@ya\pgf@y\southwest\pgf@y\pgf@ya}%
- \pgfpathlineto{\secondsplit\pgf@ya\pgf@y\northeast\pgf@y\pgf@ya}%
- \fi%
- \ifnum\parts>3\relax%
- \pgfpathmoveto{\thirdsplit\pgf@ya\pgf@y\southwest\pgf@y\pgf@ya}%
- \pgfpathlineto{\thirdsplit\pgf@ya\pgf@y\northeast\pgf@y\pgf@ya}%
- \fi%
- }%
- }
- \behindbackgroundpath{%
- \ifpgfrectanglesplitusecustomfill%
- %
- % Remove outer sep.
- %
- \getrectanglesplitparameters%
- \pgfsavepgf@process\southwest{%
- \southwest%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \pgfsavepgf@process\northeast{%
- \northeast%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- \pgfsavepgf@process\textspliteast{%
- \textspliteast%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\textsplitwest{%
- \textsplitwest%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\secondspliteast{%
- \secondspliteast%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\secondsplitwest{%
- \secondsplitwest%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\thirdspliteast{%
- \thirdspliteast%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \pgfsavepgf@process\thirdsplitwest{%
- \thirdsplitwest%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- %
- % Always fill the text box.
- %
- \pgfpathmoveto{\textsplitwest}%
- \pgfpathlineto{\northeast\pgf@ya\pgf@y\southwest\pgf@y\pgf@ya}%
- \pgfpathlineto{\northeast}%
- \ifnum\parts>1\relax%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \fi%
- \pgfpathlineto{\textspliteast}%
- \pgfpathclose%
- \ifnum\parts>1\relax%
- \egroup%
- \fi%
- \pgfsetfillcolor{\pgfkeysvalueof{/pgf/rectangle split text part fill}}%
- \pgfusepath{fill}%
- %
- % Second box.
- %
- \ifnum\parts>1\relax%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathmoveto{\textsplitwest}%
- \pgfpathlineto{\textspliteast}%
- \ifnum\parts=2\relax%
- \egroup%
- \fi%
- \pgfpathlineto{\secondspliteast}%
- \pgfpathlineto{\secondsplitwest}%
- \ifnum\parts=2\relax%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \fi%
- \pgfpathclose%
- \pgfsetfillcolor{\pgfkeysvalueof{/pgf/rectangle split second part fill}}%
- \pgfusepath{fill}%
- \egroup%
- \fi%
- %
- % Third box.
- %
- \ifnum\parts>2\relax%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathmoveto{\secondsplitwest}%
- \pgfpathlineto{\secondspliteast}%
- \ifnum\parts=3\relax%
- \egroup%
- \fi%
- \pgfpathlineto{\thirdspliteast}%
- \pgfpathlineto{\thirdsplitwest}%
- \ifnum\parts=3\relax%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \fi%
- \pgfpathclose%
- \pgfsetfillcolor{\pgfkeysvalueof{/pgf/rectangle split third part fill}}%
- \pgfusepath{fill}%
- \egroup%
- \fi%
- %
- % And the fourth box.
- %
- \ifnum\parts>3\relax%
- \pgfpathmoveto{\thirdsplitwest}%
- \pgfpathlineto{\southwest}%
- \pgfpathlineto{\southwest\pgf@ya\pgf@y\northeast\pgf@y\pgf@ya}%
- \bgroup%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathlineto{\thirdspliteast}%
- \pgfpathclose%
- \egroup%
- \pgfsetfillcolor{\pgfkeysvalueof{/pgf/rectangle split fourth part fill}}%
- \pgfusepath{fill}%
- \fi%
- \fi%
- }
- \anchorborder{%
- \pgfutil@tempdima\pgf@x%
- \pgfutil@tempdimb\pgf@y%
- \getrectanglesplitparameters%
- \pgfpointdiff{\southwest}{\northeast}%
- \pgf@x.5\pgf@x%
- \pgf@y.5\pgf@y%
- \edef\pgf@marshall{%
- \noexpand\pgfpointborderrectangle{%
- \noexpand\pgfqpoint{\the\pgfutil@tempdima}{\the\pgfutil@tempdimb}%
- }%
- {%
- \noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}%
- }%
- }%
- \pgf@marshall%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
-}
-
-
-% Shape: ellipse split.
-%
-\pgfdeclareshape{ellipse split}{%
- \nodeparts{text,lower}
- \savedanchor\radii{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgf@y2.0\pgf@y%
- \advance\pgf@y.5\pgflinewidth%
- \pgf@xa.5\wd\pgfnodeparttextbox%
- \pgf@xb.5\wd\pgfnodepartlowerbox%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@xb\pgf@x%
- \pgf@ya\ht\pgfnodeparttextbox%
- \advance\pgf@ya\dp\pgfnodeparttextbox%
- \pgf@yb\ht\pgfnodepartlowerbox%
- \advance\pgf@yb\dp\pgfnodepartlowerbox%
- \advance\pgf@ya\pgf@y%
- \advance\pgf@yb\pgf@y%
- \ifdim\pgf@xa>\pgf@xb%
- \pgf@x1.414213\pgf@xa%
- \else%
- \pgf@x1.414213\pgf@xb%
- \fi%
- \ifdim\pgf@ya>\pgf@yb%
- \pgf@y1.414213\pgf@ya%
- \else%
- \pgf@y1.414213\pgf@yb%
- \fi%
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- }
- \savedanchor\lower{%
- \pgf@x-.5\wd\pgfnodepartlowerbox%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgf@y-2.0\pgf@y%
- \advance\pgf@y-\pgflinewidth%
- \advance\pgf@y-\dp\pgfnodeparttextbox%
- \advance\pgf@y-\ht\pgfnodepartlowerbox%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{-\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y-\dp\pgfnodeparttextbox%
- \advance\pgf@y-.5\pgflinewidth%
- }%
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }%
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{.5ex}%
- }%
- \anchor{center}{\centerpoint}
- \anchor{lower}{\lower}
- \anchor{mid}{\midpoint}
- \anchor{mid east}{\radii\pgf@xa\pgf@x\midpoint\advance\pgf@x\pgf@xa}
- \anchor{mid west}{\radii\pgf@xa\pgf@x\midpoint\advance\pgf@x-\pgf@xa}
- \anchor{base}{\basepoint}
- \anchor{base east}{\radii\pgf@xa\pgf@x\basepoint\advance\pgf@x\pgf@xa}
- \anchor{base west}{\radii\pgf@xa\pgf@x\basepoint\advance\pgf@x-\pgf@xa}
- \anchor{north}{\pgfpointadd{\centerpoint}{\radii\pgf@x0pt}}%
- \anchor{south}{\pgfpointadd{\centerpoint}{\radii\pgf@x0pt\pgf@y-\pgf@y}}%
- \anchor{east}{\pgfpointadd{\centerpoint}{\radii\pgf@y0pt}}%
- \anchor{west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-\pgf@x\pgf@y0pt}}%
- \anchor{north west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-0.707106\pgf@x\pgf@y0.707106\pgf@y}}%
- \anchor{south west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-0.707106\pgf@x\pgf@y-0.707106\pgf@y}}%
- \anchor{north east}{\pgfpointadd{\centerpoint}{\radii\pgf@x0.707106\pgf@x\pgf@y0.707106\pgf@y}}%
- \anchor{south east}{\pgfpointadd{\centerpoint}{\radii\pgf@x0.707106\pgf@x\pgf@y-0.707106\pgf@y}}%
- \backgroundpath{%
- \radii%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- \pgfutil@tempdima\pgf@x%
- \pgfutil@tempdimb\pgf@y%
- \pgfpathellipse{\centerpoint}{\pgfqpoint{\the\pgfutil@tempdima}{0pt}}{\pgfqpoint{0pt}{\the\pgfutil@tempdimb}}%
- \pgfpathmoveto{\centerpoint\advance\pgf@x-\pgfutil@tempdima}%
- \pgfpathlineto{\centerpoint\advance\pgf@x\pgfutil@tempdima}%
- }
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \radii%
- \edef\pgf@marshal{%
- \noexpand\pgfpointadd{\noexpand\pgfpointborderellipse{\noexpand\externalpoint}%
- {\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}}{\noexpand\centerpoint}%
- }%
- \pgf@marshal%
- }%
-}
-
-\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
new file mode 100644
index 00000000000..16d1b2eab0e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
@@ -0,0 +1,681 @@
+% Copyright 2009 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarysvg.path.code.tex,v 1.6 2009/01/24 17:07:14 tantau Exp $
+
+
+\usepgfmodule{parser}
+
+
+
+
+% Scan an SVG-Path
+%
+% #1 = the path
+%
+% Description:
+%
+% This command takes a path in the compressed SVG-syntax. It then
+% issues a sequences of appropriate \pgfpath commands for this
+% path. For a description of the compressed svg path syntax, see a
+% book on svg.
+%
+% The notion of a pixel used by svg makes no sense in pgf (actually
+% it does not really make sense in svg either, but never mind), and
+% instead of pixels "pt" is used as the basic unit. Use coordinate
+% transformation to change this.
+%
+% Example:
+%
+% \pgfpathsvg{M10 20 L 30-20 0 1}
+%
+% % this has the same effect as
+%
+% \pgfpathmoveto{\pgfpoint{10pt}{20pt}}
+% \pgfpathlineto{\pgfpint{30pt}{-20pt}}
+% \pgfpathlineto{\pgfpint{0pt}{1pt}}
+%
+
+\def\pgfpathsvg#1{%
+ \let\pgf@lib@svg@finish@prev\relax%
+ {%
+ \pgftransforminvert%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@path@lastx}{\pgf@path@lasty}}}
+ }
+ \pgf@lib@svg@last@x\pgf@x%
+ \pgf@lib@svg@last@y\pgf@y%
+ \let\pgf@lib@svg@num=\pgfutil@empty%
+ \pgfparserparse{svgpath}#1"%
+}
+
+
+
+\newdimen\pgf@lib@svg@last@x
+\newdimen\pgf@lib@svg@last@y
+\newdimen\pgf@lib@svg@last@c@x
+\newdimen\pgf@lib@svg@last@c@y
+
+\newcount\pgf@lib@svg@count
+\newcount\pgf@lib@svg@max@num
+
+\newif\pgf@lib@svg@relative
+
+
+
+% For the smooth commands (S, s, T, t) we need to keep track of the
+% previous control points. This is done in the following two
+% variables. If they are empty, there was no previous control point of
+% the desired kind, in which case the specification prescribes that
+% the start point is used.
+
+\def\pgf@lib@svg@clear@bezier@quad{
+ \let\pgf@lib@svg@bezier@last=\pgfutil@empty
+ \let\pgf@lib@svg@quad@last=\pgfutil@empty
+}
+\pgf@lib@svg@clear@bezier@quad
+
+%
+% Here comes the DFA:
+%
+
+% Handle a moveto:
+
+\pgfparserdef{svgpath}{all}{the letter M}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@moveto}
+}
+
+\def\pgf@lib@svg@moveto{%
+ \pgf@lib@svg@clear@bezier@quad%
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{0}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{1}pt%
+ \pgfpathmoveto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto}
+}
+
+
+% Handle a relative moveto:
+
+\pgfparserdef{svgpath}{all}{the letter m}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@moveto@rel}
+}
+
+\def\pgf@lib@svg@moveto@rel{%
+ \pgf@lib@svg@clear@bezier@quad%
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{0}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{1}pt%
+ \pgfpathmoveto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel}
+}
+
+
+% Handle a lineto:
+
+\pgfparserdef{svgpath}{all}{the letter L}
+{
+ \pgf@lib@svg@finish@prev%
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto}
+}
+
+\def\pgf@lib@svg@lineto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{0}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{1}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto}%
+ \fi
+}
+
+
+% Handle a relative lineto:
+
+\pgfparserdef{svgpath}{all}{the letter l}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel}
+}
+
+\def\pgf@lib@svg@lineto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{0}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{1}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel}%
+ \fi
+}
+
+
+% Handle a closepath:
+
+\pgfparserdef{svgpath}{all}{the letter Z}
+{
+ \pgf@lib@svg@closepath
+}
+
+\pgfparserdef{svgpath}{all}{the letter z}
+{
+ \pgf@lib@svg@closepath
+}
+
+\def\pgf@lib@svg@closepath{
+ \pgf@lib@svg@finish@prev
+ \pgfpathclose
+ \let\pgf@lib@svg@finish@prev=\relax
+ \pgf@lib@svg@clear@bezier@quad%
+ \pgfparserswitch{initial}%
+}
+
+
+
+
+
+% Handle a horizontal lineto:
+
+\pgfparserdef{svgpath}{all}{the letter H}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto}
+}
+
+\def\pgf@lib@svg@hlineto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{0}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto}
+ \fi
+}
+
+\pgfparserdef{svgpath}{all}{the letter h}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto@rel}
+}
+
+\def\pgf@lib@svg@hlineto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{0}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto@rel}
+ \fi
+}
+
+
+% Handle a horizontal lineto:
+
+\pgfparserdef{svgpath}{all}{the letter V}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto}
+}
+
+\def\pgf@lib@svg@vlineto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{0}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto}
+ \fi
+}
+
+\pgfparserdef{svgpath}{all}{the letter v}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto@rel}
+}
+
+\def\pgf@lib@svg@vlineto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ \pgf@lib@svg@clear@bezier@quad%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{0}pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto@rel}
+ \fi
+}
+
+
+
+
+% Handle a Bezier curve:
+
+\pgfparserdef{svgpath}{all}{the letter C}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto}
+}
+
+\def\pgf@lib@svg@curveto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@quad@last=\pgfutil@empty%
+ \edef\pgf@lib@svg@bezier@last{%
+ \noexpand\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}%
+ % Draw curve
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{4}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{5}pt%
+ \pgfpathcurveto
+ {\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ {\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}%
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ % Go on
+ \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto}
+ \fi
+}
+
+
+\pgfparserdef{svgpath}{all}{the letter c}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto@rel}
+}
+
+\def\pgf@lib@svg@curveto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@quad@last=\pgfutil@empty%
+ \pgf@process{\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}
+ \edef\pgf@lib@svg@bezier@last{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % Draw curve
+ \pgfpathcurveto
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}}%
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}%
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{4}pt}{\pgf@lib@svg@get@num{5}pt}}}%
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{4}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{5}pt%
+ \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto@rel}
+ \fi
+}
+
+
+
+
+
+\pgfparserdef{svgpath}{all}{the letter S}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@smooth}
+}
+
+\def\pgf@lib@svg@curveto@smooth{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Draw curve
+ % Compute first control point
+ \ifx\pgf@lib@svg@bezier@last\pgfutil@empty%
+ \def\pgf@lib@svg@first@cp{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ \else
+ \def\pgf@lib@svg@first@cp{
+ \pgfpointadd
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ {\pgfpointdiff
+ {\pgf@lib@svg@bezier@last}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ }
+ }
+ \fi
+ \pgfpathcurveto
+ {\pgf@lib@svg@first@cp}
+ {\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ {\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@quad@last=\pgfutil@empty%
+ \edef\pgf@lib@svg@bezier@last{%
+ \noexpand\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ % Update
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{2}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{3}pt%
+ % Go on
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@smooth}
+ \fi
+}
+
+
+\pgfparserdef{svgpath}{all}{the letter s}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@rel@smooth}
+}
+
+\def\pgf@lib@svg@curveto@rel@smooth{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Draw curve
+ % Compute first control point
+ \ifx\pgf@lib@svg@bezier@last\pgfutil@empty%
+ \def\pgf@lib@svg@first@cp{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ \else
+ \def\pgf@lib@svg@first@cp{
+ \pgfpointadd
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ {\pgfpointdiff
+ {\pgf@lib@svg@bezier@last}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ }
+ }
+ \fi
+ \pgfpathcurveto
+ {\pgf@lib@svg@first@cp}
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}}%
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@quad@last=\pgfutil@empty%
+ \pgf@process{\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}
+ \edef\pgf@lib@svg@bezier@last{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % update
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{2}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{3}pt%
+ % Go on
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@rel@smooth}
+ \fi
+}
+
+
+
+
+% Handle a quadratic curve:
+
+\pgfparserdef{svgpath}{all}{the letter Q}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto}
+}
+
+\def\pgf@lib@svg@quad@curveto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear bezier last point and save new last control point:
+ \let\pgf@lib@svg@bezier@last=\pgfutil@empty%
+ \edef\pgf@lib@svg@quad@last{%
+ \noexpand\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ % Draw curve
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{2}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{3}pt%
+ \pgfpathquadraticcurveto
+ {\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ % Go on
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto}
+ \fi
+}
+
+
+\pgfparserdef{svgpath}{all}{the letter q}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto@rel}
+}
+
+\def\pgf@lib@svg@quad@curveto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@bezier@last=\pgfutil@empty%
+ \pgf@process{\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}}
+ \edef\pgf@lib@svg@quad@last{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % Draw curve
+ \pgfpathquadraticcurveto
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}}%
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}%
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{2}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{3}pt%
+ \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto@rel}
+ \fi
+}
+
+
+
+
+\pgfparserdef{svgpath}{all}{the letter T}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@smooth}
+}
+
+\def\pgf@lib@svg@quad@curveto@smooth{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Draw curve
+ % Compute first control point
+ \pgf@process{
+ \ifx\pgf@lib@svg@quad@last\pgfutil@empty%
+ \pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}
+ \else
+ \pgfpointadd
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ {\pgfpointdiff
+ {\pgf@lib@svg@quad@last}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ }
+ \fi
+ }
+ \edef\pgf@lib@svg@first@cp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfpathquadraticcurveto
+ {\pgf@lib@svg@first@cp}
+ {\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@bezier@last=\pgfutil@empty%
+ \let\pgf@lib@svg@quad@last=\pgf@lib@svg@first@cp%
+ % Update
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{0}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{1}pt%
+ % Go on
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@smooth}
+ \fi
+}
+
+
+\pgfparserdef{svgpath}{all}{the letter t}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@rel@smooth}
+}
+
+\def\pgf@lib@svg@quad@curveto@rel@smooth{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Draw curve
+ % Compute first control point
+ \pgf@process{
+ \ifx\pgf@lib@svg@quad@last\pgfutil@empty%
+ \pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}
+ \else
+ \pgfpointadd
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ {\pgfpointdiff
+ {\pgf@lib@svg@quad@last}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}
+ }
+ \fi
+ }
+ \edef\pgf@lib@svg@first@cp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfpathquadraticcurveto
+ {\pgf@lib@svg@first@cp}
+ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}}%
+ % Clear quadratic last point and save new last control point:
+ \let\pgf@lib@svg@bezier@last=\pgfutil@empty%
+ \let\pgf@lib@svg@quad@last=\pgf@lib@svg@first@cp%
+ % update
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{0}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{1}pt%
+ % Go on
+ \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@rel@smooth}
+ \fi
+}
+
+
+
+% Handle an arcto:
+
+\pgfparserdef{svgpath}{all}{the letter A}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto}
+}
+
+\def\pgf@lib@svg@arcto{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear bezier last point and save new last control point:
+ \pgf@lib@svg@clear@bezier@quad%
+ % Draw curve
+ \pgf@lib@svg@last@x=\pgf@lib@svg@get@num{5}pt%
+ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{6}pt%
+ \pgfpatharcto
+ {\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}
+ {\pgf@lib@svg@get@num{2}}
+ {\pgf@lib@svg@get@num{3}}
+ {\pgf@lib@svg@get@num{4}}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ % Go on
+ \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto}
+ \fi
+}
+
+\pgfparserdef{svgpath}{all}{the letter a}
+{
+ \pgf@lib@svg@finish@prev
+ \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto@rel}
+}
+
+\def\pgf@lib@svg@arcto@rel{%
+ \ifnum\pgf@lib@svg@count=0\relax% nothing read
+ \else%
+ % Clear bezier last point and save new last control point:
+ \pgf@lib@svg@clear@bezier@quad%
+ % Draw curve
+ \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{5}pt%
+ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{6}pt%
+ \pgfpatharcto
+ {\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}
+ {\pgf@lib@svg@get@num{2}}
+ {\pgf@lib@svg@get@num{3}}
+ {\pgf@lib@svg@get@num{4}}
+ {\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
+ % Go on
+ \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto@rel}
+ \fi
+}
+
+
+
+
+
+% Handle to end of the world
+
+\pgfparserdef{svgpath}{all}{the character "}
+{
+ \pgf@lib@svg@finish@prev
+ \pgfparserswitch{final}
+}
+
+
+
+
+% Handle spacers for numbers
+
+\def\pgf@lib@svg@read@nums#1#2{% get #1 number symbols, then do #2
+ \pgf@lib@svg@count=0\relax
+ \pgf@lib@svg@max@num=#1\relax
+ \pgfparserswitch{num}
+ \def\pgf@lib@svg@finish@prev{
+ \ifx\pgf@lib@svg@num\pgfutil@empty%
+ \else%
+ \expandafter\let\csname pgf@lib@svg@num@\the\pgf@lib@svg@count\endcsname=\pgf@lib@svg@num
+ \advance\pgf@lib@svg@count by1\relax%
+ \let\pgf@lib@svg@num=\pgfutil@empty%
+ \fi
+ #2
+ }
+}
+
+\def\pgf@lib@svg@get@num#1{\csname pgf@lib@svg@num@#1\endcsname}
+
+
+\pgfparserdef{svgpath}{num}{the character ,}
+{
+ \pgf@lib@svg@handle@spacer
+}
+
+\pgfparserdef{svgpath}{num}{\meaning\pgfutil@sptoken}
+{
+ \pgf@lib@svg@handle@spacer
+}
+
+\pgfparserdef{svgpath}{num}{the character -}
+{
+ \pgf@lib@svg@handle@spacer
+ \def\pgf@lib@svg@num{-}%
+}
+
+\def\pgf@lib@svg@handle@spacer{
+ \ifx\pgf@lib@svg@num\pgfutil@empty%
+ % ignore
+ \else
+ \expandafter\let\csname pgf@lib@svg@num@\the\pgf@lib@svg@count\endcsname=\pgf@lib@svg@num
+ \advance\pgf@lib@svg@count by1\relax%
+ \ifnum\pgf@lib@svg@count=\pgf@lib@svg@max@num\relax%
+ \pgf@lib@svg@finish@prev%
+ \fi
+ \let\pgf@lib@svg@num=\pgfutil@empty%
+ \fi
+}
+
+
+% Handle digits
+
+\pgfparserdef{svgpath}{all}{the character .}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num.}}
+
+\pgfparserdef{svgpath}{all}{the character 0}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num0}}
+
+\pgfparserdef{svgpath}{all}{the character 1}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num1}}
+
+\pgfparserdef{svgpath}{all}{the character 2}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num2}}
+
+\pgfparserdef{svgpath}{all}{the character 3}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num3}}
+
+\pgfparserdef{svgpath}{all}{the character 4}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num4}}
+
+\pgfparserdef{svgpath}{all}{the character 5}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num5}}
+
+\pgfparserdef{svgpath}{all}{the character 6}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num6}}
+
+\pgfparserdef{svgpath}{all}{the character 7}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num7}}
+
+\pgfparserdef{svgpath}{all}{the character 8}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num8}}
+
+\pgfparserdef{svgpath}{all}{the character 9}
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num9}}
+
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
new file mode 100644
index 00000000000..e79634a06ea
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
@@ -0,0 +1,680 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+
+%
+% Resistor shape based on a zig-zag-line
+%
+
+\pgfdeclareshape{var resistor IEC}
+{
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % Middle line
+ \pgf@yc=.5\pgf@ya
+ \advance\pgf@yc by.5\pgf@yb
+ % Height
+ \pgf@xc=-.5\pgf@ya
+ \advance\pgf@xc by.5\pgf@yb
+ % Start point
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yc}}
+ % Lines
+ \advance\pgf@xb by.1pt%
+ \pgfutil@loop%
+ \advance\pgf@xa by4\pgf@xc\relax%
+ \ifdim\pgf@xa<\pgf@xb%
+ \advance\pgf@xa by-3\pgf@xc%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \advance\pgf@xa by2\pgf@xc%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \advance\pgf@xa by\pgf@xc%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yc}}%
+ \pgfutil@repeat%
+ \advance\pgf@xb by-.1pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ }
+}
+
+
+
+%
+% Inductor shape based on a bumpy line
+%
+
+\pgfdeclareshape{inductor IEC}
+{
+ \savedanchor\northeast{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=\pgf@xa%
+ \advance\pgf@x by .5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=\pgf@ya%
+ \advance\pgf@y by\pgf@yb%
+ }
+ \savedanchor\southwest{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=-\pgf@xa%
+ \advance\pgf@x by -.5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgf@y=-\pgf@ya%
+ }
+
+ \anchor{center}{\pgfpointorigin}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+
+ \anchorborder{%
+ \ifdim\pgf@y<0pt%
+ % tricky... simpilfy to the origin...
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\southwest}%
+ \advance\pgf@y by-0.5pt%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\pgfqpoint{-\pgf@xa}{-\pgf@ya}}}%
+ \else%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
+ \fi%
+ }
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xa=-\pgf@x \pgf@ya=0pt
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % Height
+ \pgf@xc=\pgf@yb%
+ % Start point
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
+ % Lines
+ \advance\pgf@xb by.1pt%
+ \pgfutil@loop%
+ \advance\pgf@xa by2\pgf@xc\relax%
+ \ifdim\pgf@xa<\pgf@xb%
+ \pgfpatharc{180}{0}{\pgf@xc}%
+ \pgfutil@repeat%
+ \advance\pgf@xb by-.1pt%
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}%
+ }
+}
+
+
+
+
+%
+% Simple capacitor, consisting of two parallel lines
+%
+
+\pgfdeclareshape{capacitor IEC}
+{
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+
+
+%
+% Simple ground, consisting of three lines, getting smaller
+%
+
+\pgfdeclareshape{ground IEC}
+{
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % First line, simple
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ % Advance to middle
+ \pgfmathsetlength\pgf@xa{.5\pgf@xa+.5\pgf@xb}
+ % Make smaller
+ \pgfmathsetlength\pgf@yc{.16666\pgf@yb-.16666\pgf@ya}
+ \advance\pgf@ya by\pgf@yc
+ \advance\pgf@yb by-\pgf@yc
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ % Make even smaller
+ \advance\pgf@ya by\pgf@yc
+ \advance\pgf@yb by-\pgf@yc
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+
+%
+% Battery, consisting of two parallel lines, one smaller than
+% the other
+%
+
+\pgfdeclareshape{battery IEC}
+{
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % First line, simple
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ % Make smaller
+ \pgfmathsetlength\pgf@yc{.25\pgf@yb-.25\pgf@ya}
+ \advance\pgf@ya by\pgf@yc
+ \advance\pgf@yb by-\pgf@yc
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+%
+% Special diodes
+%
+
+
+\pgfdeclareshape{breakdown diode IEC}
+{
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ \pgf@xc=.5\pgf@xa \advance\pgf@xc by.5\pgf@xb
+ \pgf@yc=.5\pgf@ya
+ \advance\pgf@yc by .5\pgf@yb
+ % Triangles:
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ \pgfpathclose
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ \pgfpathclose
+ }
+
+
+ \beforebackgroundpath{
+ {
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ \pgf@yc=.5\pgf@ya
+ \advance\pgf@yc by.5\pgf@yb
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yc}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \pgfusepathqstroke
+ \pgf@xc=.5\pgf@xa
+ \advance\pgf@xc by.5\pgf@xb
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ \pgf@yc=.5\pgf@yb
+ \advance\pgf@yc by-.5\pgf@ya
+ \pgftransformscale{\pgf@sys@tonumber{\pgf@yc}}
+ \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
+ \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
+ \pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
+ \pgfusepathqstroke
+ }
+ }
+}
+
+
+
+
+
+
+% Generic shapes
+%
+% When these shapes are used, you can set a key derived form the
+% shapes name to some code that will be executed as the before
+% background path. This means that the basic shape is fixed, but
+% things like a special line inside the shape or at the border can be
+% added without having to define a whole new shape.
+
+
+\pgfdeclareshape{generic circle IEC}
+{
+ % This shape is a generic circle, to which you can add something to
+ % the before background path using the key
+ % /pgf/generic circle IEC/before background
+ % When this key is invoked, the transformation matrix will have been
+ % setup such that the circle's center is at the origin and that the
+ % position \pgfpoint{1pt}{0pt} lies exactly on the top of the circle
+ % (and, there, on the middle of the line).
+
+ \inheritsavedanchors[from=circle ee]
+ \inheritanchorborder[from=circle ee]
+ \inheritanchor[from=circle ee]{north}
+ \inheritanchor[from=circle ee]{north west}
+ \inheritanchor[from=circle ee]{north east}
+ \inheritanchor[from=circle ee]{center}
+ \inheritanchor[from=circle ee]{west}
+ \inheritanchor[from=circle ee]{east}
+ \inheritanchor[from=circle ee]{south}
+ \inheritanchor[from=circle ee]{south west}
+ \inheritanchor[from=circle ee]{south east}
+ \inheritanchor[from=circle ee]{input}
+ \inheritanchor[from=circle ee]{output}
+ \inheritbackgroundpath[from=circle ee]
+
+ \beforebackgroundpath{
+ {
+ \centerpoint%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgftransformshift{}
+ \pgfutil@tempdima=\radius%
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xb<\pgf@yb%
+ \advance\pgfutil@tempdima by-\pgf@yb%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xb%
+ \fi%
+ \pgftransformscale{\pgf@sys@tonumber{\pgfutil@tempdima}}
+ \pgfkeysvalueof{/pgf/generic circle IEC/before background}
+ }
+ }
+}
+
+
+
+%
+% Generic diode, based on a rectangle
+%
+
+\pgfdeclareshape{generic diode IEC}
+{
+ % This shape is a generic diode, to which you can add something to
+ % the before background path using the key
+ % /pgf/generic diode IEC/before background
+ % When this key is invoked, the transformation matrix will have been
+ % setup such that the center is at the tip of the diode. The
+ % position \pgfpoint{1pt}{0pt} lies exactly on the top of the
+ % (suggested) line before the diode.
+
+ \inheritsavedanchors[from=rectangle ee]
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % Move tip back a little bit
+ \advance\pgf@xb by-.5\pgflinewidth
+ % Triangle triangle:
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
+ \pgf@yc=.5\pgf@ya
+ \advance\pgf@yc by .5\pgf@yb
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \pgfpathclose
+ }
+
+
+ \beforebackgroundpath{
+ {
+ \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
+ \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ \pgf@yc=.5\pgf@ya
+ \advance\pgf@yc by.5\pgf@yb
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yc}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \pgfusepathqstroke
+ \pgftransformshift{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \pgf@yc=.5\pgf@yb
+ \advance\pgf@yc by-.5\pgf@ya
+ \pgftransformscale{\pgf@sys@tonumber{\pgf@yc}}
+ \pgfkeysvalueof{/pgf/generic diode IEC/before background}
+ }
+ }
+}
+
+
+\pgfkeys{
+ /pgf/generic circle IEC/before background/.initial=,
+ /pgf/generic diode IEC/before background/.initial=,
+}
+
+
+
+
+
+%
+% Concacts
+%
+
+\pgfdeclareshape{make contact IEC}
+{
+ \savedanchor\northeast{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=\pgf@xa%
+ \advance\pgf@x by .5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=\pgf@ya%
+ \advance\pgf@y by\pgf@yb%
+ }
+ \savedanchor\southwest{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=-.5\pgf@xa%
+ \advance\pgf@x by -.5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgf@y=-\pgf@ya%
+ }
+
+ \anchor{center}{\pgfpointorigin}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+
+ \anchorborder{%
+ \ifdim\pgf@y<0pt%
+ % tricky... simpilfy to the origin...
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\southwest}%
+ \advance\pgf@y by-0.5pt%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\pgfqpoint{-\pgf@xa}{-\pgf@ya}}}%
+ \else%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
+ \fi%
+ }
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xa=-\pgf@x \pgf@ya=0pt
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % Start point
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+
+%
+% Concacts
+%
+
+\pgfdeclareshape{var make contact IEC}
+{
+ \savedanchor\northeast{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=\pgf@xa%
+ \advance\pgf@x by .5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=\pgf@ya%
+ \advance\pgf@y by\pgf@yb%
+ }
+ \savedanchor\southwest{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=-.5\pgf@xa%
+ \advance\pgf@x by -.5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgf@y=-\pgf@ya%
+ \pgf@xc=0.083333\pgf@x%
+ \advance\pgf@y by\pgf@xc%
+ }
+
+ \anchor{center}{\pgfpointorigin}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+
+ \anchorborder{%
+ \ifdim\pgf@y<0pt%
+ % tricky... simpilfy to the origin...
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\southwest}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\pgfqpoint{-\pgf@xa}{-\pgf@ya}}}%
+ \else%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
+ \fi%
+ }
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\northeast}{
+ \pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xa=-\pgf@x \pgf@ya=0pt
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ \pgf@xc=\pgf@xa
+ \pgfutil@tempdima=2\pgf@xb%
+ \pgfutil@tempdima=0.083333\pgfutil@tempdima%
+ \advance\pgf@xa by \pgfutil@tempdima
+ % Circle
+ {\pgfpathcircle{\pgfqpoint{\pgf@xa}{0pt}}{\pgfutil@tempdima}}
+ % Height
+ % Start point
+ \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgfqpoint{\pgf@xa}{0pt}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}}}
+ \pgf@xc=\pgf@x
+ \pgf@yc=\pgf@y
+ \pgfpathmoveto{\pgfpointadd{\pgfqpoint{\pgf@xa}{0pt}}{%
+ \pgfpointscale{\pgfutil@tempdima}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+
+\pgfdeclareshape{break contact IEC}
+{
+ \savedanchor\northeast{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=\pgf@xa%
+ \advance\pgf@x by .5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=\pgf@ya%
+ \advance\pgf@y by\pgf@yb%
+ }
+ \savedanchor\southwest{%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x=-.5\pgf@xa%
+ \advance\pgf@x by -.5\pgf@xb%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgf@y=-\pgf@ya%
+ }
+
+ \anchor{center}{\pgfpointorigin}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+
+ \anchorborder{%
+ \ifdim\pgf@y<0pt%
+ % tricky... simpilfy to the origin...
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\southwest}%
+ \advance\pgf@y by-0.5pt%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\pgfqpoint{-\pgf@xa}{-\pgf@ya}}}%
+ \else%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
+ \fi%
+ }
+
+ \backgroundpath{
+ \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
+ \pgf@xa=-\pgf@x \pgf@ya=0pt
+ \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % Start point
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ % Break point
+ \pgf@xc=.2\pgf@xb
+ \advance\pgf@xc by-.2\pgf@xa
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{0pt}}
+ \advance\pgf@xb by-\pgf@xc
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
+ }
+}
+
+
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
new file mode 100644
index 00000000000..ddf8a29f629
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
@@ -0,0 +1,176 @@
+% Copyright 2008 by Till Tantau and others Wibrow
+%
+% 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.
+
+
+
+%
+% Base shapes
+%
+% These shapes are identical to the shapes without "ee", only an "input"
+% and an "output" anchor have been added at the left and right end.
+
+\pgfdeclareshape{rectangle ee}
+{
+ \inheritsavedanchors[from=rectangle]
+ \inheritanchorborder[from=rectangle]
+ \inheritanchor[from=rectangle]{north}
+ \inheritanchor[from=rectangle]{north west}
+ \inheritanchor[from=rectangle]{north east}
+ \inheritanchor[from=rectangle]{center}
+ \inheritanchor[from=rectangle]{west}
+ \inheritanchor[from=rectangle]{east}
+ \inheritanchor[from=rectangle]{mid}
+ \inheritanchor[from=rectangle]{mid west}
+ \inheritanchor[from=rectangle]{mid east}
+ \inheritanchor[from=rectangle]{base}
+ \inheritanchor[from=rectangle]{base west}
+ \inheritanchor[from=rectangle]{base east}
+ \inheritanchor[from=rectangle]{south}
+ \inheritanchor[from=rectangle]{south west}
+ \inheritanchor[from=rectangle]{south east}
+ \inheritbackgroundpath[from=rectangle]
+ % New:
+ \anchor{input}{
+ \pgf@process{\northeast}%
+ \pgf@ya=.5\pgf@y%
+ \pgf@process{\southwest}%
+ \pgf@y=.5\pgf@y%
+ \advance\pgf@y by \pgf@ya%
+ }
+ \anchor{output}{%
+ \pgf@process{\southwest}%
+ \pgf@ya=.5\pgf@y%
+ \pgf@process{\northeast}%
+ \pgf@y=.5\pgf@y%
+ \advance\pgf@y by \pgf@ya%
+ }
+}
+
+\pgfdeclareshape{circle ee}
+{
+ \inheritsavedanchors[from=circle]
+ \inheritanchorborder[from=circle]
+ \inheritanchor[from=circle]{north}
+ \inheritanchor[from=circle]{north west}
+ \inheritanchor[from=circle]{north east}
+ \inheritanchor[from=circle]{center}
+ \inheritanchor[from=circle]{west}
+ \inheritanchor[from=circle]{east}
+ \inheritanchor[from=circle]{mid}
+ \inheritanchor[from=circle]{mid west}
+ \inheritanchor[from=circle]{mid east}
+ \inheritanchor[from=circle]{base}
+ \inheritanchor[from=circle]{base west}
+ \inheritanchor[from=circle]{base east}
+ \inheritanchor[from=circle]{south}
+ \inheritanchor[from=circle]{south west}
+ \inheritanchor[from=circle]{south east}
+ \inheritbackgroundpath[from=circle]
+ % New:
+ \anchor{input}{\centerpoint\advance\pgf@x by-\radius}
+ \anchor{output}{\centerpoint\advance\pgf@x by\radius}
+}
+
+
+
+%
+% Current direction indicator. This shape uses the current setting of
+% the current direction arrow tip for the arrow. The shape is a
+% rectangle around the arrow tip.
+%
+
+\pgfdeclareshape{direction ee}
+{
+ \savedanchor\northeast{
+ % Right border is given by right extend
+ \pgf@x=0pt%
+ \csname pgf@arrow@right@\pgfkeysvalueof{/pgf/direction ee arrow}\endcsname
+ % Height is given by minimum height/2
+ \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=.5\pgf@y
+ }
+ \savedanchor\southwest{
+ % Left border is given by left extend
+ \pgf@x=0pt%
+ \csname pgf@arrow@left@\pgfkeysvalueof{/pgf/direction ee arrow}\endcsname
+ \pgf@x=-\pgf@x%
+ % Height is given by minimum height/2
+ \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y=-.5\pgf@y
+ }
+
+ \inheritanchor[from=rectangle ee]{center}
+ \inheritanchor[from=rectangle ee]{north}
+ \inheritanchor[from=rectangle ee]{south}
+ \inheritanchor[from=rectangle ee]{east}
+ \inheritanchor[from=rectangle ee]{west}
+ \inheritanchor[from=rectangle ee]{north east}
+ \inheritanchor[from=rectangle ee]{north west}
+ \inheritanchor[from=rectangle ee]{south east}
+ \inheritanchor[from=rectangle ee]{south west}
+ \inheritanchor[from=rectangle ee]{input}
+ \inheritanchor[from=rectangle ee]{output}
+ \inheritanchorborder[from=rectangle ee]
+ \nodeparts{}% no text
+
+ \behindbackgroundpath{
+ \pgf@process{\southwest}
+ \pgf@xa=\pgf@x
+ \pgf@process{\northeast}
+ \pgf@xb=\pgf@x
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}
+ \pgfusepathqstroke
+ }
+
+ \beforebackgroundpath{
+ {
+ \pgfsetarrowsend{\pgfkeysvalueof{/pgf/direction ee arrow}}
+ \pgfsys@beginscope
+ \pgflowlevelsynccm%
+ \pgflowlevelobj{}{\pgf@endarrow}%
+ \pgfsys@endscope
+ }
+ }
+}
+
+\pgfkeys{
+ /pgf/direction ee arrow/.initial=direction ee,
+}
+
+
+
+% Special arrow for ee directions:
+
+\pgfarrowsdeclare{direction ee}{direction ee}
+{
+ \pgfmathsetlength\pgfutil@tempdima{\pgfgetarrowoptions{direction ee}}%
+ \pgfutil@tempdima=.5\pgfutil@tempdima
+ \pgfarrowsleftextend{+-\pgfutil@tempdima}
+ \pgfarrowsrightextend{+\pgfutil@tempdima}
+}
+{
+ \pgfmathsetlength\pgfutil@tempdima{\pgfgetarrowoptions{direction ee}}%
+ \pgfsetdash{}{+0pt}
+ \pgfsetroundjoin
+ \pgfpathmoveto{\pgfqpoint{-0.5\pgfutil@tempdima}{0.38268343237\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfqpoint{-0.5\pgfutil@tempdima}{-0.38268343237\pgfutil@tempdima}}
+ \pgfpathclose
+ \pgfusepathqfillstroke
+}
+
+\pgfsetarrowoptions{direction ee}{4pt}
+
+
+
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
index 881cda69d98..5b2beb2b0fb 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.IEC.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
@@ -7,12 +7,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+\usepgflibrary{shapes.gates.logic}
\pgfkeys{/pgf/.cd,
- logic gate input sep/.initial=0.125cm,
- logic gate inputs/.initial={normal,normal},%
- logic gate inverted radius/.initial=2pt,%
- logic gate anchors use bounding box/.is if=pgfgateanchorsuseboundingrectangle,%
and gate IEC symbol/.initial=$\char`\&$,
nand gate IEC symbol/.initial=$\char`\&$,
or gate IEC symbol/.initial=$\geq1$,
@@ -32,84 +29,6 @@
right/.code=\pgftransformxshift{\innerhalfwidth}
}
-% Internal macro for parsing inputs.
-%
-\expandafter\ifx\csname pgf@lib@sh@logicgate@parseinputs\endcsname\relax%
-\def\pgf@lib@sh@logicgate@parseinputs#1{%
- \edef\pgf@lib@sh@temp{\pgfkeysvalueof{/pgf/logic gate inputs}}%
- \c@pgf@counta#1\relax%
- \c@pgf@countb0\relax%
- \expandafter\pgfutil@in@\expandafter,\expandafter{\pgf@lib@sh@temp}%
- \ifpgfutil@in@%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@long%
- \else%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@short%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@itext{i}
-\def\pgf@lib@sh@invertedtext{inverted}
-%
-% The `short' version for input specifcation is an extension of
-% ideas due to Juergen Werber and Christoph Bartoschek.
-%
-\def\pgf@lib@sh@logicgate@parseinputs@short{%
- \expandafter\pgf@lib@sh@logicgate@parseinputs@@short\pgf@lib@sh@temp\pgf@stop%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@short#1{%
- \ifx#1\pgf@stop%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \ifnum\c@pgf@countb=\c@pgf@counta%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \advance\c@pgf@countb1\relax%
- \expandafter\ifx\pgf@lib@sh@itext#1%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
- \else%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@short%
- \fi%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@long{%
- \expandafter\pgf@lib@sh@logicgate@parseinputs@@long\pgf@lib@sh@temp,\pgf@stop,%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@long#1,{%
- \ifx#1\pgf@stop%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \ifnum\c@pgf@countb=\c@pgf@counta%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \advance\c@pgf@countb1\relax%
- \def\pgf@lib@sh@temp{#1}%
- \ifx\pgf@lib@sh@invertedtext\pgf@lib@sh@temp%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
- \else%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@@long%
- \fi%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@@long{%
- \pgfutil@ifnextchar x{\pgf@lib@sh@logicgate@parseinputs@@long}%
- {\pgf@lib@sh@logicgate@parseinputs@@long}%
-}
-\fi%
-
\def\pgf@lib@sh@logicgates@IEC@foregroundpath#1{%
\dimensions%
{%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
index 76d6916bcd5..ae857c6fd42 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.gates.logic.US.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
@@ -7,17 +7,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+\usepgflibrary{shapes.gates.logic}
+
\newif\ifpgfgateanchorsuseboundingrectangle%
% Keys for US/CDH logic gates.
%
-\pgfkeys{/pgf/.cd,%
- logic gate input sep/.initial=0.125cm,
- logic gate inputs/.initial={normal,normal},%
- logic gate inverted radius/.initial=2pt,%
- logic gate anchors use bounding box/.is if=pgfgateanchorsuseboundingrectangle,%
+\pgfkeys{
+ /pgf/logic gate anchors use bounding box/.is if=pgfgateanchorsuseboundingrectangle,%
}
% An internal macro for calculating internal dimensions of
@@ -175,84 +174,6 @@
}%
-% Internal macro for parsing inputs.
-%
-\expandafter\ifx\csname pgf@lib@sh@logicgate@parseinputs\endcsname\relax%
-\def\pgf@lib@sh@logicgate@parseinputs#1{%
- \edef\pgf@lib@sh@temp{\pgfkeysvalueof{/pgf/logic gate inputs}}%
- \c@pgf@counta#1\relax%
- \c@pgf@countb0\relax%
- \expandafter\pgfutil@in@\expandafter,\expandafter{\pgf@lib@sh@temp}%
- \ifpgfutil@in@%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@long%
- \else%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@short%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@itext{i}
-\def\pgf@lib@sh@invertedtext{inverted}
-%
-% The `short' version for input specifcation is an extension of
-% ideas due to Juergen Werber and Christoph Bartoschek.
-%
-\def\pgf@lib@sh@logicgate@parseinputs@short{%
- \expandafter\pgf@lib@sh@logicgate@parseinputs@@short\pgf@lib@sh@temp\pgf@stop%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@short#1{%
- \ifx#1\pgf@stop%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \ifnum\c@pgf@countb=\c@pgf@counta%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \advance\c@pgf@countb1\relax%
- \expandafter\ifx\pgf@lib@sh@itext#1%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
- \else%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@short%
- \fi%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@long{%
- \expandafter\pgf@lib@sh@logicgate@parseinputs@@long\pgf@lib@sh@temp,\pgf@stop,%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@long#1,{%
- \ifx#1\pgf@stop%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \ifnum\c@pgf@countb=\c@pgf@counta%
- \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
- \let\pgf@lib@sh@next\relax%
- \else%
- \advance\c@pgf@countb1\relax%
- \def\pgf@lib@sh@temp{#1}%
- \ifx\pgf@lib@sh@invertedtext\pgf@lib@sh@temp%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
- \else%
- \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
- \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
- \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@@long%
- \fi%
- \fi%
- \pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@logicgate@parseinputs@@@long{%
- \pgfutil@ifnextchar x{\pgf@lib@sh@logicgate@parseinputs@@long}%
- {\pgf@lib@sh@logicgate@parseinputs@@long}%
-}
-\fi%
-
% Internal macro for calculation input anchors. Used by
% both and gates and nand gates, and also the not gate and buffer.
%
@@ -1733,287 +1654,302 @@
% Shape not gate US
%
\pgfdeclareshape{not gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1}%
- \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
- \PackageError{PGF}{A not gate must have one input}{}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \midpoint%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@not gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- }
- \anchor{mid west}{%
- \dimensions%
- \pgf@xc\halfside%
- \pgf@xc-.833333\pgf@xc%
- \advance\pgf@xc-\outerxsep%
- \midpoint%
- \advance\pgf@x\pgf@xc%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \basepoint%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@not gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- }
- \anchor{base west}{%
- \dimensions%
- \pgf@xc\halfside%
- \pgf@xc-.833333\pgf@xc%
- \advance\pgf@xc-\outerxsep%
- \basepoint%
- \advance\pgf@x\pgf@xc%
- }%
- \inheritanchor[from=and gate US]{base}
- \anchor{output}{%
- \dimensions%
- \pgf@xc\halfside%
- \centerpoint%
- \advance\pgf@x-.166666\pgf@xc%
- \pgf@xc2.0\pgf@xc%
- \advance\pgf@x.866025\pgf@xc%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\outerxsep%
- }
- \anchor{east}{%
- \dimensions%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- }%
- \anchor{north}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@north west\endcsname%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y1pt}%
- {\csname pgf@anchor@not gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@south west\endcsname%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y-1pt}%
- {\csname pgf@anchor@not gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@south west\endcsname%
- \pgf@ya\pgf@y%
- \pgf@process{%
- \dimensions%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- }%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
- {\csname pgf@anchor@not gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@north west\endcsname%
- \pgf@ya\pgf@y%
- \pgf@process{%
- \dimensions%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- }%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
- {\csname pgf@anchor@not gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{south west}{%
- \dimensions%
- \pgf@xa\halfside%
- \centerpoint%
- \advance\pgf@x-.833333\pgf@xa
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y-1.166666\pgf@xa%
- \pgf@ya\outerysep%
- \advance\pgf@y-1.565\pgf@ya% Selected by trial and error.
- }%
- \anchor{north west}{%
- \dimensions%
- \pgf@xa\halfside%
- \centerpoint%
- \advance\pgf@x-.833333\pgf@xa
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y1.166666\pgf@xa%
- \pgf@ya\outerysep%
- \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
- }%
- \anchor{input}{%
- \dimensions%
- \pgf@lib@sh@logicgate@AND@inputanchor{1}%
- \pgf@xc\halfside%
- \advance\pgf@x.333333\pgf@xc%
- }%
- \anchor{west}{%
- \dimensions%
- \pgf@xc\halfside%
- \pgf@xc-.833333\pgf@xc%
- \advance\pgf@xc-\outerxsep%
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\tipanchor}%
- \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{1.166666\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{-1.166666\pgf@yc}}%
- \pgfpathlineto{\tipanchor}%
- %
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- %
- % Draw the input.
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-.833333\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- \fi%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@not gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@south west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\csname pgf@anchor@not gate US@north west\endcsname}%
- {\csname pgf@anchor@not gate US@south west\endcsname}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@not gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- \fi%
- }%
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1}%
+ \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
+ \PackageError{PGF}{A not gate must have one input}{}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \midpoint%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@not gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ }
+ \anchor{mid west}{%
+ \dimensions%
+ \pgf@xc\halfside%
+ \pgf@xc-.833333\pgf@xc%
+ \advance\pgf@xc-\outerxsep%
+ \midpoint%
+ \advance\pgf@x\pgf@xc%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \basepoint%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@not gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ }
+ \anchor{base west}{%
+ \dimensions%
+ \pgf@xc\halfside%
+ \pgf@xc-.833333\pgf@xc%
+ \advance\pgf@xc-\outerxsep%
+ \basepoint%
+ \advance\pgf@x\pgf@xc%
+ }%
+ \inheritanchor[from=and gate US]{base}
+ \anchor{output}{%
+ \dimensions%
+ \pgf@xc\halfside%
+ \centerpoint%
+ \advance\pgf@x-.166666\pgf@xc%
+ \pgf@xc2.0\pgf@xc%
+ \advance\pgf@x.866025\pgf@xc%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\outerxsep%
+ }
+ \anchor{east}{%
+ \dimensions%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@north west\endcsname%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y1pt}%
+ {\csname pgf@anchor@not gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }
+ \anchor{south}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@south west\endcsname%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y-1pt}%
+ {\csname pgf@anchor@not gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@south west\endcsname%
+ \pgf@ya\pgf@y%
+ \pgf@process{%
+ \dimensions%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ }%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
+ {\csname pgf@anchor@not gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@north west\endcsname%
+ \pgf@ya\pgf@y%
+ \pgf@process{%
+ \dimensions%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ }%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
+ {\csname pgf@anchor@not gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }
+ \anchor{south west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \centerpoint%
+ \advance\pgf@x-.833333\pgf@xa
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y-1.166666\pgf@xa%
+ \pgf@ya\outerysep%
+ \advance\pgf@y-1.565\pgf@ya% Selected by trial and error.
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \centerpoint%
+ \advance\pgf@x-.833333\pgf@xa
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y1.166666\pgf@xa%
+ \pgf@ya\outerysep%
+ \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
+ }%
+ \anchor{input}{%
+ \dimensions%
+ \pgf@lib@sh@logicgate@AND@inputanchor{1}%
+ \pgf@xc\halfside%
+ \advance\pgf@x.333333\pgf@xc%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \pgf@xc\halfside%
+ \pgf@xc-.833333\pgf@xc%
+ \advance\pgf@xc-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ }
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\tipanchor}%
+ \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{1.166666\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{-1.166666\pgf@yc}}%
+ \pgfpathlineto{\tipanchor}%
+ %
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ %
+ % Draw the input.
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-.833333\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ }%
+ }%
+ \anchorborder{%
+ \pgf@lib@gates@not@buffer@border{not gate US}
+ }
}
+\def\pgf@lib@gates@not@buffer@border#1{
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \ifx\pgfmathresult\pgf@lib@zero@text%
+ \csname pgf@anchor@#1@output\endcsname%
+ \else%
+ \ifx\pgfmathresult\pgf@lib@onehundredeighty@text%
+ \csname pgf@anchor@#1@input\endcsname%
+ \else%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\csname pgf@anchor@not gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@south west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\csname pgf@anchor@not gate US@north west\endcsname}%
+ {\csname pgf@anchor@not gate US@south west\endcsname}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\csname pgf@anchor@not gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
+
+
+\def\pgf@lib@zero@text{0.0}
+\def\pgf@lib@onehundredeighty@text{180.0}
@@ -2194,7 +2130,9 @@
\fi%
}%
}%
- \inheritanchorborder[from=not gate US]
+ \anchorborder{%
+ \pgf@lib@gates@not@buffer@border{buffer gate US}
+ }
}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
new file mode 100644
index 00000000000..8b047f04ab1
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
@@ -0,0 +1,98 @@
+% Copyright 2008 by Mark Wibrow
+%
+% 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.
+
+
+% Common keys for all logic gates.
+%
+\pgfkeys{/pgf/.cd,%
+ logic gate input sep/.initial=0.125cm,
+ logic gate inputs/.initial={normal,normal},%
+ logic gate inverted radius/.initial=2pt
+}
+
+
+% Internal macro for parsing inputs.
+%
+\expandafter\ifx\csname pgf@lib@sh@logicgate@parseinputs\endcsname\relax%
+\def\pgf@lib@sh@logicgate@parseinputs#1{%
+ \edef\pgf@lib@sh@temp{\pgfkeysvalueof{/pgf/logic gate inputs}}%
+ \c@pgf@counta#1\relax%
+ \c@pgf@countb0\relax%
+ \expandafter\pgfutil@in@\expandafter,\expandafter{\pgf@lib@sh@temp}%
+ \ifpgfutil@in@%
+ \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@long%
+ \else%
+ \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@short%
+ \fi%
+ \pgf@lib@sh@next%
+}
+\def\pgf@lib@sh@itext{i}
+\def\pgf@lib@sh@invertedtext{inverted}
+%
+% The `short' version for input specifcation is an extension of
+% ideas due to Juergen Werber and Christoph Bartoschek.
+%
+\def\pgf@lib@sh@logicgate@parseinputs@short{%
+ \expandafter\pgf@lib@sh@logicgate@parseinputs@@short\pgf@lib@sh@temp\pgf@stop%
+}
+\def\pgf@lib@sh@logicgate@parseinputs@@short#1{%
+ \ifx#1\pgf@stop%
+ \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
+ \let\pgf@lib@sh@next\relax%
+ \else%
+ \ifnum\c@pgf@countb=\c@pgf@counta%
+ \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
+ \let\pgf@lib@sh@next\relax%
+ \else%
+ \advance\c@pgf@countb1\relax%
+ \expandafter\ifx\pgf@lib@sh@itext#1%
+ \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
+ \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
+ \else%
+ \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
+ \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
+ \fi%
+ \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@short%
+ \fi%
+ \fi%
+ \pgf@lib@sh@next%
+}
+\def\pgf@lib@sh@logicgate@parseinputs@long{%
+ \expandafter\pgf@lib@sh@logicgate@parseinputs@@long\pgf@lib@sh@temp,\pgf@stop,%
+}
+\def\pgf@lib@sh@logicgate@parseinputs@@long#1,{%
+ \ifx#1\pgf@stop%
+ \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
+ \let\pgf@lib@sh@next\relax%
+ \else%
+ \ifnum\c@pgf@countb=\c@pgf@counta%
+ \edef\pgf@lib@sh@logicgate@numinputs{\the\c@pgf@countb}%
+ \let\pgf@lib@sh@next\relax%
+ \else%
+ \advance\c@pgf@countb1\relax%
+ \def\pgf@lib@sh@temp{#1}%
+ \ifx\pgf@lib@sh@invertedtext\pgf@lib@sh@temp%
+ \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
+ \expandafter\def\csname input-\the\c@pgf@countb\endcsname{i}}%
+ \else%
+ \expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
+ \expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
+ \fi%
+ \let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@@@long%
+ \fi%
+ \fi%
+ \pgf@lib@sh@next%
+}
+\def\pgf@lib@sh@logicgate@parseinputs@@@long{%
+ \pgfutil@ifnextchar x{\pgf@lib@sh@logicgate@parseinputs@@long}%
+ {\pgf@lib@sh@logicgate@parseinputs@@long}%
+}
+\fi%
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex
index a188ad2871e..39f90d6f2e6 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.arrows.code.tex,v 1.3 2007/11/10 09:16:33 vibrovski Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex,v 1.1 2008/06/26 16:55:55 tantau Exp $
% keys for shape single arrow
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.callouts.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
index 5a39a629e07..440681b7b87 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.callouts.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
+\usepgflibrary{shapes.symbols}
% Keys for callouts
%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
index 02d4956235c..fc0b1d20aa5 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.code.tex,v 1.14 2007/12/17 16:20:50 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex,v 1.1 2008/06/26 16:55:55 tantau Exp $
% Only the following are loaded by default and only for historical
% reasons.
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
index 2f11e6a4fd2..ae7ec0f3c4e 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.geometric.code.tex,v 1.22 2008/02/01 17:09:04 vibrovski Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex,v 1.1 2008/06/26 16:55:55 tantau Exp $
\pgfdeclareshape{ellipse}
%
@@ -368,7 +368,7 @@
\def\pgf@lib@temp{#1}%
\pgfkeyslet{/pgf/star point ratio}{\pgf@lib@temp}%
\pgf@lib@shapes@starouterradiususesratiotrue%
- }%
+ },%
star rotate/.style={/pgf/shape border rotate=#1}% For compatability with 1.18
}
@@ -3672,7 +3672,7 @@
\advance\pgf@xa\pgf@x%
\pgf@xb\pgf@xa%
\advance\pgf@xa\pgf@x%
- \pgfmathveclen@{\the\pgf@xa}{\the\pgf@y}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@y}}%
\pgf@xa\pgfmathresult pt\relax%
\fi%
%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
index 62e488dc79a..a57b0cd4511 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.misc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.misc.code.tex,v 1.10 2008/02/12 18:02:25 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex,v 1.3 2008/10/07 18:23:25 vibrovski Exp $
\pgfdeclareshape{cross out}
@@ -66,622 +66,412 @@
}
}
+
+% Rounded rectangle
+
+
\pgfkeys{/pgf/.cd,
rounded rectangle west arc/.initial=convex,
rounded rectangle east arc/.initial=convex,
rounded rectangle left arc/.style={/pgf/rounded rectangle west arc=#1},%
- rounded rectangle right arc/.code={/pgf/rounded rectangle east arc=#1},%
+ rounded rectangle right arc/.style={/pgf/rounded rectangle east arc=#1},%
rounded rectangle arc length/.initial=180%
}%
-\def\pgf@lib@shapes@roundedrectangle@concave{concave}%
-\def\pgf@lib@shapes@roundedrectangle@convex{convex}%
+\def\pgf@lib@sh@misc@rr@text@concave{concave}%
+\def\pgf@lib@sh@misc@rr@text@convex{convex}%
-\pgfdeclareshape{rounded rectangle}{
- \savedmacro\leftarc{%
- \edef\leftarc{\pgfkeysvalueof{/pgf/rounded rectangle west arc}}%
+\pgfdeclareshape{rounded rectangle}{%
+ \savedmacro\westarc{%
+ \edef\westarc{\pgfkeysvalueof{/pgf/rounded rectangle west arc}}%
}
- \savedmacro\rightarc{%
- \edef\rightarc{\pgfkeysvalueof{/pgf/rounded rectangle east arc}}%
+ \savedmacro\eastarc{%
+ \edef\eastarc{\pgfkeysvalueof{/pgf/rounded rectangle east arc}}%
}
\savedmacro\roundedrectanglepoints{%
%
- % Get half the arc angle.
+ % Get half the arc angle, a.
%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/rounded rectangle arc length}}%
- \pgf@x.5\pgf@x%
+ \pgf@x=.5\pgf@x%
\edef\halfarcangle{\pgfmath@tonumber{\pgf@x}}%
- \addtosavedmacro\halfarcangle%
+ \addtosavedmacro\halfarcangle%
%
% Get the (half) node dimensions x & y.
%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \edef\innerxsep{\the\pgf@x}%
+ \pgf@xa=0.5\wd\pgfnodeparttextbox%
+ \edef\halftextwidth{\the\pgf@xa}%
+ \addtosavedmacro\halftextwidth%
+ \advance\pgf@x by\pgf@xa%
+ %
\pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Adjust for minimum height
- %
+ \edef\innerysep{\the\pgf@y}%
+ \pgf@ya=.5\ht\pgfnodeparttextbox%
+ \advance\pgf@ya by.5\dp\pgfnodeparttextbox%
+ \edef\halftextheight{\the\pgf@ya}%
+ \addtosavedmacro\halftextheight%
+ \advance\pgf@y by\pgf@ya%
+ %
+ % Adjust for minimum height
%
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
\ifdim\pgf@y<.5\pgf@yb%
- \pgf@y.5\pgf@yb%
+ \pgf@y=.5\pgf@yb%
\fi%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfheight%
+ %
+ % Calculate the radius of the arc ends.
%
- % Calculate the radii xa & ya of the arc ends.
+ \pgfmathcosec@{\halfarcangle}%
+ \pgf@ya=\pgfmathresult\pgf@y%
+ \edef\radius{\the\pgf@ya}%
+ \addtosavedmacro\radius%
%
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rounded rectangle arc length}}%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@ya\pgfmathresult\pgf@y%
- \pgf@xa\pgf@ya%
+ % Arc width = r - r*cos(a/2).
%
- % Calculate the width of the arc end.
+ \pgfmathcos@{\halfarcangle}%
+ \pgf@xa=\pgf@ya%
+ \advance\pgf@xa by-\pgfmathresult\pgf@ya%
%
- \pgfmathcos@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@xb-\pgfmathresult\pgf@xa%
- \advance\pgf@xb\pgf@xa\relax%
- \edef\arcwidth{\the\pgf@xb}%
- \addtosavedmacro{\arcwidth}%
+ % When the node contents are pushed inside a convex arc,
+ % the resulting chord has a height r - r*cos(asin(0.5*h/r)).
%
- % Adjust for minimum width
+ \pgfmathdivide{\halftextheight}{\radius}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ \pgf@xb=\pgf@ya%
+ \advance\pgf@xb by-\pgfmathresult\pgf@ya%
%
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
- \advance\pgf@x\arcwidth\relax%
- \ifdim\pgf@x<.5\pgf@xb%
- \pgf@x.5\pgf@xb%
+ % Adjust for minimum width.
+ %
+ \edef\westarc{\pgfkeysvalueof{/pgf/rounded rectangle west arc}}%
+ \edef\eastarc{\pgfkeysvalueof{/pgf/rounded rectangle east arc}}%
+ %
+ \pgfutil@tempdima=2.0\pgf@x% x still holds the half width.
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
+ \advance\pgfutil@tempdima by\pgf@xa%
+ \else%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \advance\pgfutil@tempdima by\pgf@xb%
+ \fi%
\fi%
- \advance\pgf@x-\arcwidth\relax%
%
- % Get the outer sep.
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@concave%
+ \advance\pgfutil@tempdima by\pgf@xa%
+ \else%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \advance\pgfutil@tempdima by\pgf@xb%
+ \fi%
+ \fi%
%
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\outerxsep{\the\pgf@xb}%
- \edef\outerysep{\the\pgf@yb}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgfutil@tempdima<\pgfutil@tempdimb%
+ \advance\pgfutil@tempdimb by-\pgfutil@tempdima%
+ \divide\pgfutil@tempdimb by2\relax%
+ \edef\xoffset{\the\pgfutil@tempdimb}%
+ \else%
+ \let\xoffset=\innerxsep%
+ \fi%
%
- \edef\xpathradius{\the\pgf@xa}%
- \edef\ypathradius{\the\pgf@ya}%
- \addtosavedmacro\xpathradius%
- \addtosavedmacro\ypathradius%
+ % The node is made wider if convex arcs overlap.
%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@ya\pgf@yb%
- \edef\xradius{\the\pgf@xa}%
- \edef\yradius{\the\pgf@ya}%
- \addtosavedmacro\xradius%
- \addtosavedmacro\yradius%
+ \pgf@x=\halftextwidth\relax%
+ \advance\pgf@x by\xoffset\relax%
+ \pgf@xc=\pgf@ya%
+ \advance\pgf@xc by-\pgf@xb%
+ \ifdim\pgf@xc>\pgf@x\relax%
+ \advance\pgf@xc by-\pgf@x%
+ \advance\pgf@xc by\xoffset\relax%
+ \edef\xoffset{\the\pgf@xc}%
+ \fi%
+ \addtosavedmacro\xoffset%
%
- \advance\pgf@xa-2.0\pgf@xb%
- \advance\pgf@ya-2.0\pgf@yb%
- \edef\xinnerradius{\the\pgf@xa}%
- \edef\yinnerradius{\the\pgf@ya}%
- \addtosavedmacro\xinnerradius%
- \addtosavedmacro\yinnerradius%
+ \pgf@x=\halftextwidth\relax%
+ \advance\pgf@x by\xoffset\relax%
+ \edef\halfwidth{\the\pgf@x}%
+ \addtosavedmacro\halfwidth%
%
- \pgfextract@process\pathcornernoarc{}%
- \addtosavedmacro\pathcornernoarc%
+ \edef\arcwidth{\the\pgf@xa}%
+ \addtosavedmacro\arcwidth%
%
- \pgfextract@process\pathcornerconvexarc{%
- \pathcornernoarc%
- \pgf@xc\arcwidth\relax%
- \advance\pgf@x-.707106\pgf@xc
- }%
- \addtosavedmacro\pathcornerconvexarc%
+ \edef\chordwidth{\the\pgf@xb}%
+ \addtosavedmacro\chordwidth%
%
- \pgfextract@process\pathcornerconcavearc{%
- \pathcornernoarc%
- \advance\pgf@x\arcwidth\relax%
- }%
- \addtosavedmacro\pathcornerconcavearc%
+ \pgfmathsetlengthmacro\outerxsep{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlengthmacro\outerysep{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
%
- \pgfextract@process\anchorcornernoarc{%
- \pathcornernoarc%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- }%
- \addtosavedmacro\anchorcornernoarc%
+ % calculate some horizontal adjustments made for the default miter
+ % drawn when an arc meets the north or south side of the node path.
%
- \pgfextract@process\anchorcornerconvexarc{%
- \pathcornerconvexarc%
- \ifdim\halfarcangle pt=90pt\relax%
- \else%
- \pgfmathsin@{\halfarcangle}%
- \pgf@xa\xpathradius\relax%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfmathcos@{\halfarcangle}%
- \pgf@ya\ypathradius\relax%
- \pgf@ya\pgfmathresult\pgf@ya%
- %
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
- \pgfmathatan@{\pgfmathresult}%
- \let\angle\pgfmathresult%
- \pgfmathadd@{90}{\angle}%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@xb\pgfmathresult\pgf@xb%
- \pgfmathadd@{90}{\halfarcangle}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfmathcos@{\pgfmathresult}%
- \advance\pgf@x\pgfmathresult\pgf@xb%
- \fi%
- \advance\pgf@y\pgf@yb%
- }%
- \addtosavedmacro\anchorcornerconvexarc%
+ \ifdim\halfarcangle pt=90pt\relax% Avoid division by zero.
+ \def\concavexshift{0pt}%
+ \else%
+ % For a concave arc: outer xsep * cosec((90-a/2)/2)*cos((90-a/2)/2).
+ \pgfmathsubtract@{90}{\halfarcangle}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\angletemp=\pgfmathresult%
+ \pgf@x=\outerxsep\relax%
+ \pgfmathcosec@{\angletemp}%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \pgfmathcos@{\angletemp}%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \edef\concavexshift{\the\pgf@x}%
+ \fi%
+ \addtosavedmacro\concavexshift%
%
- \pgfextract@process\anchorcornerconcavearc{%
- \pathcornerconcavearc%
- \ifdim\halfarcangle pt=90pt\relax%
- \else%
- \pgfmathsin@{\halfarcangle}%
- \pgf@xa\xpathradius\relax%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfmathcos@{\halfarcangle}%
- \pgf@ya\ypathradius\relax%
- \pgf@ya\pgfmathresult\pgf@ya%
- %
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
- \pgfmathatan@{\pgfmathresult}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\angle\pgfmathresult%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@xb\pgfmathresult\pgf@xb%
- \pgfmathcos@{\angle}%
- \advance\pgf@x\pgfmathresult\pgf@xb%
- \fi%
- \advance\pgf@y\pgf@yb%
- }%
- \addtosavedmacro\anchorcornerconcavearc%
- %
+ \ifdim\halfarcangle pt=90pt\relax% Avoid division by zero.
+ \def\convexxshift{0pt}%
+ \else%
+ % For a convex arc: outer xsep * cosec((90+a/2)/2)*cos((90+a/2)/2).
+ \pgfmathadd@{90}{\halfarcangle}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\angletemp=\pgfmathresult%
+ \pgf@x=\outerxsep\relax%
+ \pgfmathcosec@{\angletemp}%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \pgfmathcos@{\angletemp}%
+ \pgf@x=\pgfmathresult\pgf@x%
+ \edef\convexxshift{\the\pgf@x}%
+ \fi%
+ \addtosavedmacro\convexxshift%
}%
\saveddimen\halflinewidth{\pgf@x.5\pgflinewidth}%
\savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by-.5\dp\pgfnodeparttextbox%
}
\savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
}
\savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=0pt\relax%
}
\anchor{center}{\centerpoint}%
\anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \csname pgf@anchor@rounded rectangle@east\endcsname%
- \else%
- \csname pgf@anchor@rounded rectangle@south east\endcsname%
- \fi%
- \pgf@xa\pgf@x%
+ \anchor{mid west}{%
+ \csname pgf@anchor@rounded rectangle@west\endcsname%
+ \pgf@xc=\pgf@x%
\midpoint%
- \pgf@x\pgf@xa%
+ \pgf@x=\pgf@xc%
}%
- \anchor{mid west}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \csname pgf@anchor@rounded rectangle@west\endcsname%
- \else%
- \csname pgf@anchor@rounded rectangle@south west\endcsname%
- \fi%
- \pgf@xa\pgf@x%
+ \anchor{mid east}{%
+ \csname pgf@anchor@rounded rectangle@east\endcsname%
+ \pgf@xc=\pgf@x%
\midpoint%
- \pgf@x\pgf@xa%
+ \pgf@x=\pgf@xc%
}%
\anchor{base}{\basepoint}%
- \anchor{base east}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \csname pgf@anchor@rounded rectangle@east\endcsname%
- \else%
- \csname pgf@anchor@rounded rectangle@south east\endcsname%
- \fi%
- \pgf@y0pt%
- }%
\anchor{base west}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \csname pgf@anchor@rounded rectangle@west\endcsname%
- \else%
- \csname pgf@anchor@rounded rectangle@south west\endcsname%
- \fi%
- \pgf@y0pt%
+ \csname pgf@anchor@rounded rectangle@west\endcsname%
+ \pgf@xc=\pgf@x%
+ \basepoint%
+ \pgf@x=\pgf@xc%
+ }%
+ \anchor{base east}{%
+ \csname pgf@anchor@rounded rectangle@east\endcsname%
+ \pgf@xc=\pgf@x%
+ \basepoint%
+ \pgf@x=\pgf@xc%
}%
\anchor{north}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \anchorcornernoarc%
- \pgf@x0pt%
- }%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{\halfheight+\outerysep}}%
}%
- \anchor{east}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \advance\pgf@x\arcwidth\relax%
- \advance\pgf@x\outerxsep\relax%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \advance\pgf@x-\arcwidth\relax%
- \advance\pgf@x\outerxsep\relax%
- \else%
- \anchorcornernoarc%
- \fi%
- \fi%
- \pgf@y0pt\relax%
- }%
+ \anchor{south}{%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{-\halfheight-\outerysep}}%
}%
\anchor{west}{%
+ \roundedrectanglepoints%
\pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \advance\pgf@x\arcwidth\relax%
- \advance\pgf@x\outerxsep\relax%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpoint{-\halfwidth-\arcwidth-\concavexshift}{+0pt}%
\else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \advance\pgf@x-\arcwidth\relax%
- \advance\pgf@x\outerxsep\relax%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpoint{-\halfwidth-\chordwidth-\outerxsep}{+0pt}%
\else%
- \anchorcornernoarc%
+ \pgfpoint{-\halfwidth-\outerxsep}{+0pt}%
\fi%
- \fi%
- \pgf@x-\pgf@x%
- \pgf@y0pt\relax%
+ \fi%
}%
}%
- \anchor{south}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \anchorcornernoarc%
- \pgf@x0pt%
- \pgf@y-\pgf@y
- }%
+ \anchor{north west}{%
+ \roundedrectanglepoints%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpointadd{\centerpoint}{\pgfpoint{-\halfwidth-\chordwidth+\arcwidth-\convexxshift}{+0pt}}%
+ \else%
+ \csname pgf@anchor@rounded rectangle@west\endcsname%
+ \fi%
+ \pgf@xc=\pgf@x%
+ \csname pgf@anchor@rounded rectangle@north\endcsname%
+ \pgf@x=\pgf@xc%
}%
- \anchor{north east}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \anchorcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \anchorcornerconcavearc%
- \else%
- \anchorcornernoarc%
- \fi%
- \fi%
- }%
+ \anchor{south west}{%
+ \roundedrectanglepoints%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpointadd{\centerpoint}{\pgfpoint{-\halfwidth-\chordwidth+\arcwidth-\convexxshift}{+0pt}}%
+ \else%
+ \csname pgf@anchor@rounded rectangle@west\endcsname%
+ \fi%
+ \pgf@xc=\pgf@x%
+ \csname pgf@anchor@rounded rectangle@south\endcsname%
+ \pgf@x=\pgf@xc%
}%
- \anchor{north west}{%
+ \anchor{east}{%
+ \roundedrectanglepoints%
\pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \anchorcornerconvexarc%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpoint{\halfwidth+\arcwidth+\concavexshift}{+0pt}%
\else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \anchorcornerconcavearc%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpoint{\halfwidth+\chordwidth+\outerxsep}{+0pt}%
\else%
- \anchorcornernoarc%
+ \pgfpoint{\halfwidth+\outerxsep}{+0pt}%
\fi%
\fi%
- \pgf@x-\pgf@x%
}%
}%
- \anchor{south west}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \anchorcornerconvexarc%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \anchorcornerconcavearc%
- \else%
- \anchorcornernoarc%
- \fi%
- \fi%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
+ \anchor{north east}{%
+ \roundedrectanglepoints%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\arcwidth+\convexxshift}{+0pt}}%
+ \else%
+ \csname pgf@anchor@rounded rectangle@east\endcsname%
+ \fi%
+ \pgf@xc=\pgf@x%
+ \csname pgf@anchor@rounded rectangle@north\endcsname%
+ \pgf@x=\pgf@xc%
}%
\anchor{south east}{%
- \pgfpointadd{\centerpoint}{%
- \roundedrectanglepoints%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \anchorcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \anchorcornerconcavearc%
- \else%
- \anchorcornernoarc%
- \fi%
- \fi%
- \pgf@y-\pgf@y%
- }%
- }%
- \anchor{shape center}{%
- \roundedrectanglepoints%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi}%
- {%
- \pgfpointadd{%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi
- \pgf@x-\pgf@x}%
- {%
- \pgfpointadd{%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y}%
- {%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi
- \pgf@y-\pgf@y%
- }%
- }%
- }%
- \divide\pgf@x4\relax%
- \divide\pgf@y4\relax%
- }%
+ \roundedrectanglepoints%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\arcwidth+\convexxshift}{+0pt}}%
+ \else%
+ \csname pgf@anchor@rounded rectangle@east\endcsname%
+ \fi%
+ \pgf@xc=\pgf@x%
+ \csname pgf@anchor@rounded rectangle@south\endcsname%
+ \pgf@x=\pgf@xc%
}%
\backgroundpath{%
{%
- \pgftransformshift{\centerpoint}%
\roundedrectanglepoints%
- %
- \pgf@x\xradius\relax%
- \pgf@y\yradius\relax%
- \advance\pgf@x-\outerxsep\relax%
- \advance\pgf@y-\outerysep\relax%
- \edef\xradius{\the\pgf@x}%
- \edef\yradius{\the\pgf@y}%
- %
- \pgfpathmoveto{%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi%
- }%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfpatharc{\halfarcangle}{-\halfarcangle}{\xradius and \yradius}%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfpoint{0pt}{\halfheight}}%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpathlineto{\pgfpoint{\halfwidth+\arcwidth}{+\halfheight}}%
+ \pgfpatharc{180-\halfarcangle}{180+\halfarcangle}{+\radius}%
\else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfpatharc{180-\halfarcangle}{180+\halfarcangle}{\xradius and \yradius}%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpathlineto{\pgfpoint{\halfwidth+\chordwidth-\arcwidth}{+\halfheight}}%
+ \pgfpatharc{+\halfarcangle}{+-\halfarcangle}{+\radius}%
\else%
- \pgfpathlineto{\pathcornernoarc\pgf@y-\pgf@y}%
+ \pgfpathlineto{\pgfqpoint{\halfwidth}{\halfheight}}%
+ \pgfpathlineto{\pgfqpoint{\halfwidth}{-\halfheight}}%
\fi%
\fi%
- \pgfpathlineto{%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pathcornerconvexarc%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pathcornerconcavearc%
- \else%
- \pathcornernoarc%
- \fi%
- \fi%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfpatharc{180+\halfarcangle}{180-\halfarcangle}{\xradius and \yradius}%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpathlineto{\pgfpoint{-\halfwidth-\arcwidth}{+-\halfheight}}%
+ \pgfpatharc{+-\halfarcangle}{+\halfarcangle}{+\radius}%
\else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfpatharc{-\halfarcangle}{\halfarcangle}{\xradius and \yradius}%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpathlineto{\pgfpoint{-\halfwidth-\chordwidth+\arcwidth}{+-\halfheight}}%
+ \pgfpatharc{180+\halfarcangle}{180-\halfarcangle}{+\radius}%
\else%
- \pgfpathlineto{\pathcornernoarc\pgf@x-\pgf@x}%
+ \pgfpathlineto{\pgfqpoint{-\halfwidth}{-\halfheight}}%
+ \pgfpathlineto{\pgfqpoint{-\halfwidth}{\halfheight}}%
\fi%
\fi%
\pgfpathclose%
}%
}
\anchorborder{%
- \pgfextract@process\externalpoint{%
- \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{%
+ \pgfextract@process\externalpoint{}%
\pgfpointadd{\centerpoint}{\externalpoint}%
}%
\roundedrectanglepoints%
%
\pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@west\endcsname}%
+ \let\externalangle=\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@north west\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@north\endcsname}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@north east\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \csname pgf@anchor@rounded rectangle@east\endcsname%
- \advance\pgf@x-\xradius\relax%
- }%
- {0}{\halfarcangle}{\xradius and \yradius}%
- \else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pathcornernoarc%
- \advance\pgf@x\pgf@xa%
- \pgf@y\pgf@ya%
- \advance\pgf@x\xpathradius\relax%
- }%
- {180-\halfarcangle}{180}{\xinnerradius and \yinnerradius}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
- \fi%
- \fi%
+ % Between north east and east.
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfextract@process\arccenter{%
+ \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\radius}{+0pt}}%
+ }%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {\arccenter}{0}{\halfarcangle}{\radius+\outerxsep and \radius+\outerysep}%
\else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ \pgfpointintersectionoflines%
{\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\externalpoint}{\centerpoint}%
\fi%
\else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \csname pgf@anchor@rounded rectangle@west\endcsname%
- \advance\pgf@x\xradius\relax%
- }%
- {180-\halfarcangle}{180}{\xradius and \yradius}%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pathcornernoarc%
- \pgf@x-\pgf@x%
- \advance\pgf@x\pgf@xa%
- \pgf@y\pgf@ya%
- \advance\pgf@x-\xpathradius\relax%
- }%
- {0}{\halfarcangle}{\xinnerradius and \yinnerradius}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
- \fi%
- \fi%
- \fi%
+ % Between north west and north east.
+ \pgfpointintersectionoflines%
+ {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
+ {\externalpoint}{\centerpoint}%
\fi%
\else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south\endcsname}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south west\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \csname pgf@anchor@rounded rectangle@west\endcsname%
- \advance\pgf@x\xradius\relax%
- }%
- {180}{180+\halfarcangle}{\xradius and \yradius}%
- \else%
- \ifx\leftarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pathcornernoarc%
- \pgf@x-\pgf@x%
- \advance\pgf@x\pgf@xa%
- \pgf@y\pgf@ya%
- \advance\pgf@x-\xpathradius\relax%
- }%
- {360-\halfarcangle}{360}{\xinnerradius and \yinnerradius}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
- \fi%
- \fi%
+ % Between south west and north west.
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfextract@process\arccenter{%
+ \pgfpointadd{\centerpoint}{\pgfpoint{-\halfwidth-\chordwidth+\radius}{+0pt}}%
+ }%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {\arccenter}{180-\halfarcangle}{180+\halfarcangle}{\radius+\outerxsep and \radius+\outerysep}%
\else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ \pgfpointintersectionoflines%
+ {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
{\csname pgf@anchor@rounded rectangle@south west\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\externalpoint}{\centerpoint}%
\fi%
\else%
\pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south east\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
+ % Between south east and south west.
+ \pgfpointintersectionoflines%
{\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
+ {\externalpoint}{\centerpoint}%
\else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@convex%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \csname pgf@anchor@rounded rectangle@east\endcsname%
- \advance\pgf@x-\xradius\relax%
+ % Between east and south east.
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfextract@process\arccenter{%
+ \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\radius}{+0pt}}%
}%
- {360-\halfarcangle}{360}{\xradius and \yradius}%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {\arccenter}{360-\halfarcangle}{360}{\radius+\outerxsep and \radius+\outerysep}%
\else%
- \ifx\rightarc\pgf@lib@shapes@roundedrectangle@concave%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pathcornernoarc%
- \advance\pgf@x\pgf@xa%
- \pgf@y\pgf@ya%
- \advance\pgf@x\xpathradius\relax%
- }%
- {180}{180+\halfarcangle}{\xinnerradius and \yinnerradius}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- \fi%
+ \pgfpointintersectionoflines%
+ {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\externalpoint}{\centerpoint}%
\fi%
\fi%
\fi%
\fi%
- }%
+ }
}
-
% Keys for chamfered rectangle
%
% /pgf/chamfered rectangle corners : specify the corners to chamfer.
@@ -689,33 +479,33 @@
% /pgf/chamfered rectangle xsep : set the extent of the x chamferling.
% /pgf/chamfered rectangle ysep : set the extent of the y chamferling.
-\pgfkeys{/pgf/chamfered rectangle corners/.store in=\pgf@chamferedrectangle@corners}
-\pgfkeys{/tikz/chamfered rectangle corners/.store in=\pgf@chamferedrectangle@corners}
+\pgfkeys{/pgf/chamfered rectangle corners/.store in=\pgf@lib@sh@misc@cr@corners}
+\pgfkeys{/tikz/chamfered rectangle corners/.store in=\pgf@lib@sh@misc@cr@corners}
-\def\pgf@chamferedrectangle@chamferall{chamfer all}%
-\def\pgf@chamferedrectangle@chamfer{chamfer}
-\let\pgf@chamferedrectangle@corners\pgf@chamferedrectangle@chamferall
+\def\pgf@lib@sh@misc@cr@chamferall{chamfer all}%
+\def\pgf@lib@sh@misc@cr@chamfer{chamfer}
+\let\pgf@lib@sh@misc@cr@corners\pgf@lib@sh@misc@cr@chamferall
-\def\pgf@chamferedrectangle@getcorners{%
+\def\pgf@lib@sh@misc@cr@getcorners{%
\let\northeastcorner\pgfutil@empty%
\let\southeastcorner\pgfutil@empty%
\let\southwestcorner\pgfutil@empty%
\let\northwestcorner\pgfutil@empty%
- \expandafter\pgfutil@in@\expandafter{\pgf@chamferedrectangle@corners}{chamfer all}%
+ \expandafter\pgfutil@in@\expandafter{\pgf@lib@sh@misc@cr@corners}{chamfer all}%
\ifpgfutil@in@%
- \let\northeastcorner\pgf@chamferedrectangle@round%
- \let\southeastcorner\pgf@chamferedrectangle@round%
- \let\southwestcorner\pgf@chamferedrectangle@round%
- \let\northwestcorner\pgf@chamferedrectangle@round%
+ \let\northeastcorner\pgf@lib@sh@misc@cr@round%
+ \let\southeastcorner\pgf@lib@sh@misc@cr@round%
+ \let\southwestcorner\pgf@lib@sh@misc@cr@round%
+ \let\northwestcorner\pgf@lib@sh@misc@cr@round%
\let\pgf@next\relax%
\else%
- \let\pgf@next\pgf@chamferedrectangle@parsecorners%
+ \let\pgf@next\pgf@lib@sh@misc@cr@parsecorners%
\fi%
\pgf@next}
-\def\pgf@chamferedrectangle@parsecorners{%
- \expandafter\pgf@@chamferedrectangle@parsecorners\pgf@chamferedrectangle@corners,\pgf@stop,%
+\def\pgf@lib@sh@misc@cr@parsecorners{%
+ \expandafter\pgf@@chamferedrectangle@parsecorners\pgf@lib@sh@misc@cr@corners,\pgf@stop,%
}
\def\pgf@@chamferedrectangle@parsecorners#1,{%
@@ -724,19 +514,19 @@
\else%
\pgfutil@in@{@#1@}{@north east@@top left@}%
\ifpgfutil@in@%
- \let\northeastcorner\pgf@chamferedrectangle@chamfer%
+ \let\northeastcorner\pgf@lib@sh@misc@cr@chamfer%
\else%
\pgfutil@in@{@#1@}{@south east@@bottom right@}%
\ifpgfutil@in@%
- \let\southeastcorner\pgf@chamferedrectangle@chamfer%
+ \let\southeastcorner\pgf@lib@sh@misc@cr@chamfer%
\else%
\pgfutil@in@{@#1@}{@south west@@bottom left@}%
\ifpgfutil@in@%
- \let\southwestcorner\pgf@chamferedrectangle@chamfer%
+ \let\southwestcorner\pgf@lib@sh@misc@cr@chamfer%
\else%
\pgfutil@in@{@#1@}{@north west@@top right@}%
\ifpgfutil@in@%
- \let\southeastcorner\pgf@chamferedrectangle@round%
+ \let\northwestcorner\pgf@lib@sh@misc@cr@round%
\fi%
\fi%
\fi%
@@ -766,7 +556,7 @@
%
\pgfdeclareshape{chamfered rectangle}{%
\savedmacro\getchamferedrectanglepoints{%
- \pgf@chamferedrectangle@getcorners%
+ \pgf@lib@sh@misc@cr@getcorners%
%
% Get the node dimensions.
%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex
new file mode 100644
index 00000000000..15d7baf090c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex
@@ -0,0 +1,1354 @@
+% Copyright 2007 by Till Tantau and Mark Wibrow
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex,v 1.2 2010/01/07 01:12:23 vibrovski Exp $
+
+\newbox\pgfnodepartlowerbox
+
+%
+% A circle that is split in the middle into an upper and a lower part.
+%
+% This node consists of two parts: The upper (main) part is shown in
+% the upper half of the circle. The second part is the (optional)
+% lower part.
+%
+% Parts: text, lower
+
+\pgfdeclareshape{circle split}
+{
+ %
+ % Node parts
+ %
+ \nodeparts{text,lower}
+
+ %
+ % Anchors
+ %
+ \savedanchor\centerpoint{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgf@y=-\pgf@y%
+ \advance\pgf@y by-\dp\pgfnodeparttextbox%
+ \advance\pgf@y by-.5\pgflinewidth%
+ }%
+ \savedanchor\loweranchor{%
+ \pgf@x=-.5\wd\pgfnodepartlowerbox%
+ \advance\pgf@x by.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgf@y=-2\pgf@y%
+ \advance\pgf@y by-\ht\pgfnodepartlowerbox%
+ \advance\pgf@y by-.5\pgflinewidth%
+ \advance\pgf@y by-\dp\pgfnodeparttextbox%
+ \advance\pgf@y by-.5\pgflinewidth%
+ }
+
+ \saveddimen\radius{%
+ %
+ % Caculate ``height radius''
+ %
+ %\pgf@ya=.5\ht\pgfnodeparttextbox%
+% \advance\pgf@ya by.5\dp\pgfnodeparttextbox%
+% \advance\pgf@ya by.5\ht\pgfnodepartlowerbox%
+% \advance\pgf@ya by.5\dp\pgfnodepartlowerbox%
+% \advance\pgf@ya by.5\pgflinewidth%
+ %
+ % MW: Suggested correction for above calculation: Use the tallest box * 2.
+ %
+ \pgf@ya=.5\ht\pgfnodeparttextbox%
+ \advance\pgf@ya by.5\dp\pgfnodeparttextbox%
+ \pgf@yb=.5\ht\pgfnodepartlowerbox%
+ \advance\pgf@yb by.5\dp\pgfnodepartlowerbox%
+ \ifdim\pgf@ya>\pgf@yb\relax%
+ \pgf@ya2.0\pgf@ya\relax%
+ \else%
+ \pgf@ya2.0\pgf@yb\relax%
+ \fi%
+ \advance\pgf@ya by.5\pgflinewidth%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya by2\pgf@yb%
+ %
+ % Caculate ``width radius''
+ %
+ \pgf@xa=.5\wd\pgfnodeparttextbox%
+ \ifdim\pgf@xa<.5\wd\pgfnodepartlowerbox%
+ \pgf@xa=.5\wd\pgfnodepartlowerbox%
+ \fi%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa by\pgf@xb%
+ %
+ % Calculate length of radius vector:
+ %
+ \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
+ \ifdim\pgf@x>\pgf@y%
+ \c@pgf@counta=\pgf@x%
+ \ifnum\c@pgf@counta=0\relax%
+ \else%
+ \divide\c@pgf@counta by 255\relax%
+ \pgf@xa=16\pgf@xa\relax%
+ \divide\pgf@xa by\c@pgf@counta%
+ \pgf@xa=16\pgf@xa\relax%
+ \fi%
+ \else%
+ \c@pgf@counta=\pgf@y%
+ \ifnum\c@pgf@counta=0\relax%
+ \else%
+ \divide\c@pgf@counta by 255\relax%
+ \pgf@ya=16\pgf@ya\relax%
+ \divide\pgf@ya by\c@pgf@counta%
+ \pgf@xa=16\pgf@ya\relax%
+ \fi%
+ \fi%
+ \pgf@x=\pgf@xa%
+ %
+ % If necessary, adjust radius so that the size requirements are
+ % met:
+ %
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@x<.5\pgf@xb%
+ \pgf@x=.5\pgf@xb%
+ \fi%
+ \ifdim\pgf@x<.5\pgf@yb%
+ \pgf@x=.5\pgf@yb%
+ \fi%
+ %
+ % Now, add larger of outer sepearations.
+ %
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xb<\pgf@yb%
+ \advance\pgf@x by\pgf@yb%
+ \else%
+ \advance\pgf@x by\pgf@xb%
+ \fi%
+ }
+
+ %
+ % Anchors
+ %
+ \inheritanchorborder[from=circle]
+ \inheritanchor[from=circle]{north}
+ \inheritanchor[from=circle]{north west}
+ \inheritanchor[from=circle]{north east}
+ \inheritanchor[from=circle]{center}
+ \inheritanchor[from=circle]{west}
+ \inheritanchor[from=circle]{east}
+ \inheritanchor[from=circle]{mid}
+ \inheritanchor[from=circle]{mid west}
+ \inheritanchor[from=circle]{mid east}
+ \inheritanchor[from=circle]{base}
+ \inheritanchor[from=circle]{base west}
+ \inheritanchor[from=circle]{base east}
+ \inheritanchor[from=circle]{south}
+ \inheritanchor[from=circle]{south west}
+ \inheritanchor[from=circle]{south east}
+ \anchor{lower}{\loweranchor}
+
+ %
+ % Background path
+ %
+ \inheritbackgroundpath[from=circle]
+ \beforebackgroundpath{
+ \pgfutil@tempdima=\radius%
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xb<\pgf@yb%
+ \advance\pgfutil@tempdima by-\pgf@yb%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xb%
+ \fi%
+ \advance\pgfutil@tempdima by-.5\pgflinewidth%
+ \pgfsetshortenstart{0pt}%
+ \pgfsetshortenend{0pt}%
+ \pgfsetarrows{-}%
+ \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpoint{-1\pgfutil@tempdima}{0pt}}}%
+ \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpoint{\pgfutil@tempdima}{0pt}}}%
+ \pgfusepath{stroke}%
+ }
+}
+
+
+%
+% A circle that is split diagonally into an upper and a lower part.
+%
+% Parts: text, lower
+
+\pgfdeclareshape{circle solidus}{%
+ % Node parts
+ \nodeparts{text,lower}%
+ % Anchors
+ % solidus slants at 45 degrees
+ % text placement minimizes the required radius,
+ % this is achieved placing the "outer" corner
+ % of each box in the line orthogonal to the
+ % solidus which passes through circle center
+ \savedanchor\centerpoint{%
+ \pgf@x=0.5\wd\pgfnodeparttextbox%
+ \advance\pgf@x by0.5\dp\pgfnodeparttextbox%
+ \advance\pgf@x by0.5\ht\pgfnodeparttextbox%
+ \pgf@y=-\pgf@x%
+ \advance\pgf@y by\ht\pgfnodeparttextbox%
+ \advance\pgf@x by0.3536\pgflinewidth%
+ \advance\pgf@y by-0.3536\pgflinewidth%
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x by\pgf@xa%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y by-\pgf@ya%
+ }%
+ \savedanchor\loweranchor{%
+ \pgf@x=0.5\wd\pgfnodeparttextbox%
+ \advance\pgf@x by0.5\dp\pgfnodeparttextbox%
+ \advance\pgf@x by0.5\ht\pgfnodeparttextbox%
+ \pgf@y=-\pgf@x%
+ \advance\pgf@y by\ht\pgfnodeparttextbox%
+ \advance\pgf@x by0.5\ht\pgfnodepartlowerbox%
+ \advance\pgf@x by0.5\dp\pgfnodepartlowerbox%
+ \advance\pgf@x by-0.5\wd\pgfnodepartlowerbox%
+ \advance\pgf@y by-0.5\ht\pgfnodepartlowerbox%
+ \advance\pgf@y by0.5\dp\pgfnodepartlowerbox%
+ \advance\pgf@y by-0.5\wd\pgfnodepartlowerbox%
+ \advance\pgf@x by0.7071\pgflinewidth%
+ \advance\pgf@y by-0.7071\pgflinewidth%
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x by2\pgf@xa%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y by-2\pgf@ya%
+ }%
+ \saveddimen\radius{%
+ % "top" radius
+ \pgf@x=\ht\pgfnodeparttextbox%
+ \advance\pgf@x by\dp\pgfnodeparttextbox%
+ \advance\pgf@x by\wd\pgfnodeparttextbox%
+ % "bottom" radius
+ \pgf@y=\ht\pgfnodepartlowerbox%
+ \advance\pgf@y by\dp\pgfnodepartlowerbox%
+ \advance\pgf@y by\wd\pgfnodepartlowerbox%
+ % use the larger
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x=\pgf@y%
+ \fi%
+ \pgf@x=0.7071\pgf@x%
+ % add spacings
+ \advance\pgf@x by0.5\pgflinewidth%
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgfmathaddtolength{\pgf@x}{veclen(2\pgf@xa,2\pgf@ya)}%
+ % If necessary, adjust radius so that the size requirements are
+ % met:
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x=.5\pgf@xa%
+ \fi%
+ \ifdim\pgf@x<.5\pgf@ya%
+ \pgf@x=.5\pgf@ya%
+ \fi%
+ % Now, add larger of outer separations.
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xa<\pgf@ya%
+ \advance\pgf@x by\pgf@ya%
+ \else%
+ \advance\pgf@x by\pgf@xa%
+ \fi%
+ }%
+ % Anchors
+ \inheritanchorborder[from=circle]%
+ \inheritanchor[from=circle]{north}%
+ \inheritanchor[from=circle]{north west}%
+ \inheritanchor[from=circle]{north east}%
+ \inheritanchor[from=circle]{center}%
+ \inheritanchor[from=circle]{west}%
+ \inheritanchor[from=circle]{east}%
+ \inheritanchor[from=circle]{mid}%
+ \inheritanchor[from=circle]{mid west}%
+ \inheritanchor[from=circle]{mid east}%
+ \inheritanchor[from=circle]{base}%
+ \inheritanchor[from=circle]{base west}%
+ \inheritanchor[from=circle]{base east}%
+ \inheritanchor[from=circle]{south}%
+ \inheritanchor[from=circle]{south west}%
+ \inheritanchor[from=circle]{south east}%
+ \anchor{lower}{\loweranchor}%
+ % Background path
+ \inheritbackgroundpath[from=circle]%
+ \beforebackgroundpath{%
+ \pgfutil@tempdima=\radius%
+ \pgfmathsetlength{\pgf@xa}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@ya}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xa<\pgf@ya%
+ \advance\pgfutil@tempdima by-\pgf@ya%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xa%
+ \fi%
+ \advance\pgfutil@tempdima by-.5\pgflinewidth%
+ \pgfsetshortenstart{0pt}%
+ \pgfsetshortenend{0pt}%
+ \pgfsetarrows{-}%
+ % solidus slants at 45 degrees and its length is
+ % the golden section of the diameter
+ \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpoint{-0.437\pgfutil@tempdima}{-0.437\pgfutil@tempdima}}}%
+ \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpoint{0.437\pgfutil@tempdima}{0.437\pgfutil@tempdima}}}%
+ \pgfusepath{stroke}%
+ }%
+}
+
+
+\def\pgf@lib@sh@newbox{\csname newbox\endcsname}% Get round outer.
+
+\def\pgf@lib@sh@toalpha#1{%
+ \ifcase#1\relax%
+ \or one\or two\or three\or four\or five\or six\or seven\or eight\or nine\or ten%
+ \or eleven\or twelve\or thirteen\or fourteen\or fifteen%
+ \or sixteen\or seventeen\or eighteen\or nineteen\or twenty%
+ \else%
+ twenty%
+ \fi%
+}
+
+
+\def\pgf@lib@sh@getalpha#1#2{\expandafter\edef\expandafter#1\expandafter{\pgf@lib@sh@toalpha{#2}}}
+
+\newbox\pgfnodeparttwobox
+\newbox\pgfnodepartthreebox
+\newbox\pgfnodepartfourbox
+
+\let\pgfnodepartonebox=\pgfnodeparttextbox
+\let\pgfnodepartsecondbox=\pgfnodeparttwobox
+\let\pgfnodepartthirdbox=\pgfnodepartthreebox
+\let\pgfnodepartfourthbox=\pgfnodepartfourbox
+
+\def\pgf@lib@sh@allocateboxes#1{%
+ \c@pgf@counta=#1\relax%
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>4\relax%
+ \pgfutil@ifundefined{pgfnodepart\pgf@lib@sh@toalpha{\c@pgf@counta}box}%
+ {%
+ \expandafter\pgf@lib@sh@newbox\csname pgfnodepart\pgf@lib@sh@toalpha{\c@pgf@counta}box\endcsname%
+ }%
+ {}%
+ \advance\c@pgf@counta by-1\relax%
+ \repeatpgfmathloop%
+}
+
+\def\pgf@lib@sh@rs@lefttext{left}
+\def\pgf@lib@sh@rs@righttext{right}
+\def\pgf@lib@sh@rs@centertext{center}
+\def\pgf@lib@sh@rs@bottomtext{bottom}
+\def\pgf@lib@sh@rs@toptext{top}
+\def\pgf@lib@sh@rs@basetext{base}
+\def\pgf@lib@sh@rs@nonetext{none}
+
+
+\newif\ifpgfrectanglesplithorizontal
+\newif\ifpgfrectanglesplitdrawsplits\pgfrectanglesplitdrawsplitstrue
+\newif\ifpgfrectanglesplitignoreemptyparts
+\newif\ifpgfrectanglesplitusecustomfill
+
+\let\pgf@lib@sh@rs@every@emptypart=\pgfutil@empty
+\let\pgf@lib@sh@rs@every@part=\pgfutil@empty
+\def\pgf@lib@sh@rs@list@fill{none}
+
+\pgfkeys{/pgf/.cd,
+ rectangle split parts/.initial=4,
+ rectangle split part align/.initial=center,
+ rectangle split horizontal/.is if=pgfrectanglesplithorizontal,
+ rectangle split ignore empty parts/.is if=pgfrectanglesplitignoreemptyparts,
+ rectangle split empty part width/.code={%
+ \pgfmathsetlength\pgf@x{#1}
+ \edef\pgf@lib@sh@rs@temp{\noexpand\vrule width\the\pgf@x height0ptdepth0pt\relax}%
+ \def\pgf@lib@sh@rs@@temp{\def\pgf@lib@sh@rs@every@emptypart}%
+ \expandafter\expandafter\expandafter\pgf@lib@sh@rs@@temp\expandafter\expandafter\expandafter{%
+ \expandafter\pgf@lib@sh@rs@every@emptypart\pgf@lib@sh@rs@temp}%
+ },%
+ rectangle split empty part width=1ex,
+ rectangle split empty part height/.code={%
+ \pgfmathsetlength\pgf@x{#1}
+ \edef\pgf@lib@sh@rs@temp{\noexpand\vrule width0ptheight\the\pgf@x depth0pt\relax}%
+ \def\pgf@lib@sh@rs@@temp{\def\pgf@lib@sh@rs@every@emptypart}%
+ \expandafter\expandafter\expandafter\pgf@lib@sh@rs@@temp\expandafter\expandafter\expandafter{%
+ \expandafter\pgf@lib@sh@rs@every@emptypart\pgf@lib@sh@rs@temp}%
+ },%
+ rectangle split empty part height=1ex,
+ rectangle split empty part depth/.code={%
+ \pgfmathsetlength\pgf@x{#1}
+ \edef\pgf@lib@sh@rs@temp{\noexpand\vrule width0ptheight0ptdepth\the\pgf@x\relax}%
+ \def\pgf@lib@sh@rs@@temp{\def\pgf@lib@sh@rs@every@emptypart}%
+ \expandafter\expandafter\expandafter\pgf@lib@sh@rs@@temp\expandafter\expandafter\expandafter{%
+ \expandafter\pgf@lib@sh@rs@every@emptypart\pgf@lib@sh@rs@temp}%
+ },%
+ rectangle split empty part depth=0ex,
+ rectangle split every empty part/.store in=\pgf@lib@sh@rs@every@emptypart,
+ rectangle split part fill/.code=\def\pgf@lib@sh@rs@list@fill{#1}\pgfrectanglesplitusecustomfilltrue,
+ rectangle split uses custom fill/.is if=pgfrectanglesplitusecustomfill,
+ rectangle split draw splits/.is if=pgfrectanglesplitdrawsplits,
+ rectangle split allocate boxes/.code=\pgf@lib@sh@allocateboxes{#1}
+}
+
+
+\def\pgf@lib@sh@rs@process@list#1#2{%
+ \c@pgf@counta=1\relax%
+ \c@pgf@countb=#2\relax%
+ \edef\pgf@lib@sh@rs@temp{#1}%
+ \expandafter\pgf@lib@sh@rs@@process@list\pgf@lib@sh@rs@temp,\pgf@stop,}
+
+\def\pgf@lib@sh@rs@@process@list{%
+ \pgfutil@ifnextchar x{\pgf@lib@sh@rs@@@process@list}%
+ {\pgf@lib@sh@rs@@@process@list}}
+
+\def\pgf@lib@sh@rs@@@process@list#1,{%
+ \ifx#1\pgf@stop%
+ \let\pgf@next\pgf@lib@sh@rs@@@@process@list%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\c@pgf@counta}%
+ \def\pgf@lib@sh@rs@lastalign{#1}%
+ \pgfutil@namedef{pgf@lib@sh@rs@\pgf@lib@sh@toalpha{\c@pgf@counta}@item}{#1}%
+ \let\pgf@next\pgf@lib@sh@rs@@process@list%
+ \advance\c@pgf@counta by1\relax%
+ \fi%
+ \pgf@next}
+
+\def\pgf@lib@sh@rs@@@@process@list{%
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>\c@pgf@countb%
+ \else%
+ \expandafter\edef\csname pgf@lib@sh@rs@\pgf@lib@sh@toalpha{\c@pgf@counta}@item\endcsname%
+ {\pgf@lib@sh@rs@lastalign}%
+ \advance\c@pgf@counta by1\relax%
+ \repeatpgfmathloop%
+}
+
+\pgf@lib@sh@allocateboxes{20}
+
+\pgfdeclareshape{rectangle split}{%
+ \savedmacro\rectanglesplitparameters{%
+ \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/rectangle split parts}}%
+ \edef\parts{\the\c@pgf@counta}%
+ \addtosavedmacro\parts%
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \edef\innerxsep{\the\pgf@x}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \edef\innerysep{\the\pgf@y}%
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \edef\outerxsep{\the\pgf@x}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\outerysep{\the\pgf@y}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ %
+ \pgf@x=0pt\relax% Widest box.
+ \pgf@y=0pt\relax% Tallest box.
+ %
+ \pgfutil@tempdima=0pt\relax% Maximum box height.
+ \pgfutil@tempdimb=0pt\relax% Maximum box depth.
+ %
+ % Get the dimensions of the boxes...
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\let\expandafter\pgf@lib@sh@box\expandafter=%
+ \csname pgfnodepart\pgf@lib@sh@rs@number box\endcsname%
+ \pgf@xa=\wd\pgf@lib@sh@box%
+ \pgf@ya=\ht\pgf@lib@sh@box%
+ \pgf@yb=\dp\pgf@lib@sh@box%
+ %
+ % Test to see if the box is empty...
+ %
+ \expandafter\def\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname{\relax}%
+ \ifdim\pgf@xa=0pt\relax%
+ \ifdim\pgf@ya=0pt\relax%
+ \ifdim\pgf@yb=0pt\relax%
+ %
+ % ...It is. So...
+ %
+ \ifpgfrectanglesplitignoreemptyparts%
+ %
+ % ...flag this if we are ignoring parts...
+ %
+ \expandafter\let\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname=\pgfutil@empty%
+ \else%
+ %
+ % ...otherwise insert the code for every empty part.
+ %
+ \setbox\pgf@lib@sh@box=\hbox{{\pgf@lib@sh@rs@every@emptypart}}%
+ \pgf@xa=\wd\pgf@lib@sh@box%
+ \pgf@ya=\ht\pgf@lib@sh@box%
+ \pgf@yb=\dp\pgf@lib@sh@box%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \expandafter\edef\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@number\endcsname{\the\pgf@xa}%
+ \expandafter\edef\csname pgf@lib@sh@rs@height@\pgf@lib@sh@rs@number\endcsname{\the\pgf@ya}%
+ \expandafter\edef\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@number\endcsname{\the\pgf@yb}%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname%
+ %
+ % ...saving the widest box...
+ %
+ \ifdim\pgf@xa>\pgf@x%
+ \pgf@x=\pgf@xa%
+ \fi%
+ %
+ % ...the maximum height and depth...
+ %
+ \ifdim\pgf@ya>\pgfutil@tempdima%
+ \pgfutil@tempdima=\pgf@ya%
+ \fi%
+ \ifdim\pgf@yb>\pgfutil@tempdimb%
+ \pgfutil@tempdimb=\pgf@yb%
+ \fi%
+ %
+ % ...and the tallest box.
+ %
+ \pgf@yc=\pgfutil@tempdima%
+ \advance\pgf@yc by\pgfutil@tempdimb%
+ \ifdim\pgf@yc>\pgf@y%
+ \pgf@y=\pgf@yc%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ \edef\pgf@lib@sh@rs@max@width{\the\pgf@x}%
+ \edef\pgf@lib@sh@rs@max@totalheight{\the\pgf@y}%
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/minimum width}}%
+ \advance\pgf@x by-\innerxsep\relax%
+ \advance\pgf@x by-\innerxsep\relax%
+ \pgf@xa=\pgf@x%
+ \advance\pgf@xa by-\pgf@lib@sh@rs@max@width\relax%
+ \ifdim\pgf@xa>0pt\relax%
+ \edef\pgf@lib@sh@rs@max@width{\the\pgf@x}%
+ \fi%
+ %
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
+ \advance\pgf@y by-\innerysep\relax%
+ \advance\pgf@y by-\innerysep\relax%
+ \pgf@ya=\pgf@y%
+ \advance\pgf@ya by-\pgf@lib@sh@rs@max@totalheight\relax%
+ \ifdim\pgf@ya>0pt\relax%
+ \edef\pgf@lib@sh@rs@max@totalheight{\the\pgf@y}%
+ \fi%
+ %
+ % Get the alignment of each node part box.
+ %
+ \pgf@lib@sh@rs@process@list{\pgfkeysvalueof{/pgf/rectangle split part align}}{\parts}%
+ %
+ % Are we splitting horizontally or vertically?
+ %
+ \ifpgfrectanglesplithorizontal%
+ %
+ % Calculate the origins of each node part box.
+ %
+ \pgf@x=0pt\relax%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\let\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname=\pgfutil@empty%
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \ifpgfrectanglesplitignoreemptyparts%
+ \expandafter\let\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname=%
+ \pgf@lib@sh@rs@lastanchor%
+ \fi%
+ \fi%
+ %
+ % Adjust for alignment.
+ %
+ \expandafter\ifx\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname%
+ \pgf@lib@sh@rs@bottomtext%
+ \pgf@y=\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@number\endcsname\relax%
+ \else%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname%
+ \pgf@lib@sh@rs@toptext%
+ \pgf@y=-\csname pgf@lib@sh@rs@height@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@y by\pgf@lib@sh@rs@max@totalheight\relax%
+ \else%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname%
+ \pgf@lib@sh@rs@basetext%
+ \pgf@y=\pgf@lib@sh@rs@max@totalheight\relax%
+ \advance\pgf@y by-\pgfutil@tempdima%
+ \advance\pgf@y by\pgfutil@tempdimb%
+ \divide\pgf@y by2\relax%
+ \else%
+ \pgf@y=\pgf@lib@sh@rs@max@totalheight\relax%
+ \advance\pgf@y by-\csname pgf@lib@sh@rs@height@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@y by\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@number\endcsname\relax%
+ \divide\pgf@y by2\relax%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % Re-adjust as the first box is at the origin.
+ %
+ \ifnum\pgfmathcounter=1\relax%
+ \edef\pgf@lib@sh@rs@yoffset{\the\pgf@y}%
+ \pgf@y=0pt\relax%
+ \pgfextract@process\pgf@lib@sh@rs@anchor@one{}%
+ \addtosavedmacro\pgf@lib@sh@rs@anchor@one%
+ \let\pgf@lib@sh@rs@lastanchor=\pgf@lib@sh@rs@anchor@one%
+ \let\pgf@lib@sh@rs@lastnumber=\pgf@lib@sh@rs@number%
+ \else
+ \advance\pgf@y by-\pgf@lib@sh@rs@yoffset\relax%
+ \advance\pgf@x by\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@lastnumber\endcsname\relax%
+ \advance\pgf@x by\innerxsep\relax%
+ \advance\pgf@x by\pgflinewidth%
+ \advance\pgf@x by\innerxsep\relax%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname{}%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@lastanchor\expandafter=%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \let\pgf@lib@sh@rs@lastnumber=\pgf@lib@sh@rs@number%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \fi%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Calculate some anchors.
+ %
+ \pgfextract@process\northeast{%
+ \pgf@lib@sh@rs@lastanchor%
+ \advance\pgf@x by\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@lastnumber\endcsname\relax%
+ \advance\pgf@x by\innerxsep\relax%
+ \advance\pgf@x by\outerxsep\relax%
+ \pgf@y=\pgf@lib@sh@rs@max@totalheight\relax%
+ \advance\pgf@y by-\pgf@lib@sh@rs@yoffset\relax%
+ \advance\pgf@y by\innerysep\relax%
+ \advance\pgf@y by\outerysep\relax%
+ }%
+ \addtosavedmacro\northeast%
+ \pgfextract@process\southwest{%
+ \pgf@lib@sh@rs@anchor@one%
+ \advance\pgf@x by-\innerxsep\relax%
+ \advance\pgf@x by-\outerxsep\relax%
+ \pgf@y=-\pgf@lib@sh@rs@yoffset\relax%
+ \advance\pgf@y by-\innerysep\relax%
+ \advance\pgf@y by-\outerysep\relax%
+ }%
+ \addtosavedmacro\southwest%
+ %
+ \pgfextract@process\centerpoint{%
+ \pgfpointadd{\southwest}{\northeast}%
+ \divide\pgf@x by2\relax%
+ \divide\pgf@y by2\relax%
+ }%
+ \addtosavedmacro\centerpoint%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \else%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \pgf@xa=\pgf@x%
+ \pgf@xb=\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@xa by0.5\pgf@xb%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @south\endcsname{%
+ \southwest%
+ \pgf@x=\pgf@xa%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @north\endcsname{%
+ \northeast%
+ \pgf@x=\pgf@xa%
+ }%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @north\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @south\endcsname%
+ \ifnum\pgfmathcounter=\parts%
+ \else%
+ \advance\pgf@xa by0.5\pgf@xb%
+ \advance\pgf@xa by\innerxsep\relax%
+ \advance\pgf@xa by.5\pgflinewidth%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@south\endcsname{%
+ \southwest%
+ \pgf@x=\pgf@xa%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@north\endcsname{%
+ \northeast%
+ \pgf@x=\pgf@xa%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split\endcsname{%
+ \centerpoint%
+ \pgf@x=\pgf@xa%
+ }%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@north\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@south\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split\endcsname%
+ \fi%
+ \fi%
+ \repeatpgfmathloop%
+ \else%
+ %
+ % Calculate the origins of each node part box.
+ %
+ \pgf@y=0pt\relax%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\let\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname=\pgfutil@empty%
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \ifpgfrectanglesplitignoreemptyparts%
+ \expandafter\let\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname=%
+ \pgf@lib@sh@rs@lastanchor%
+ \fi%
+ \fi%
+ %
+ % Adjust for alignment.
+ %
+ \expandafter\ifx\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname%
+ \pgf@lib@sh@rs@lefttext%
+ \pgf@x=0pt\relax%
+ \else%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname%
+ \pgf@lib@sh@rs@righttext%
+ \pgf@x=-\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@x by\pgf@lib@sh@rs@max@width\relax%
+ \else%
+ \pgf@x=-\csname pgf@lib@sh@rs@width@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@x by\pgf@lib@sh@rs@max@width\relax%
+ \divide\pgf@x by2\relax%
+ \fi%
+ \fi%
+ %
+ % Re-adjust as the first box is at the origin.
+ %
+ \ifnum\pgfmathcounter=1\relax%
+ \edef\pgf@lib@sh@rs@xoffset{\the\pgf@x}%
+ \pgf@x=0pt\relax%
+ \pgfextract@process\pgf@lib@sh@rs@anchor@one{}%
+ \addtosavedmacro\pgf@lib@sh@rs@anchor@one%
+ \let\pgf@lib@sh@rs@lastanchor=\pgf@lib@sh@rs@anchor@one%
+ \let\pgf@lib@sh@rs@lastnumber=\pgf@lib@sh@rs@number%
+ \else
+ \advance\pgf@x by-\pgf@lib@sh@rs@xoffset\relax%
+ \advance\pgf@y by-\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@lastnumber\endcsname\relax%
+ \advance\pgf@y by-\innerysep\relax%
+ \advance\pgf@y by-\pgflinewidth%
+ \advance\pgf@y by-\innerysep\relax%
+ \advance\pgf@y by-\csname pgf@lib@sh@rs@height@\pgf@lib@sh@rs@number\endcsname\relax%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname{}%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@lastanchor\expandafter=%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \let\pgf@lib@sh@rs@lastnumber=\pgf@lib@sh@rs@number%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \fi%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Calculate some anchors.
+ %
+ \pgfextract@process\northeast{%
+ \pgf@x=\pgf@lib@sh@rs@max@width\relax%
+ \advance\pgf@x by-\pgf@lib@sh@rs@xoffset\relax%
+ \advance\pgf@x by\innerxsep\relax%
+ \advance\pgf@x by\outerxsep\relax%
+ \pgf@y=\pgf@lib@sh@rs@height@one\relax%
+ \advance\pgf@y by\innerysep\relax%
+ \advance\pgf@y by\outerysep\relax%
+ \advance\pgf@y by.5\pgflinewidth%
+ }%
+ \addtosavedmacro\northeast%
+ \pgfextract@process\southwest{%
+ \pgf@lib@sh@rs@lastanchor%
+ \pgf@x=-\pgf@lib@sh@rs@xoffset\relax%
+ \advance\pgf@x by-\innerxsep\relax%
+ \advance\pgf@x by-\outerxsep\relax%
+ \advance\pgf@y by-\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@lastnumber\endcsname\relax%
+ \advance\pgf@y by-\innerysep\relax%
+ \advance\pgf@y by-\outerysep\relax%
+ \advance\pgf@y by-.5\pgflinewidth%
+ }%
+ \addtosavedmacro\southwest%
+ %
+ \pgfextract@process\centerpoint{%
+ \pgfpointadd{\southwest}{\northeast}%
+ \divide\pgf@x by2\relax%
+ \divide\pgf@y by2\relax%
+ }%
+ \addtosavedmacro\centerpoint%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \else%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \pgf@ya=\csname pgf@lib@sh@rs@height@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@y by0.5\pgf@ya%
+ \pgf@ya=\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@y by-0.5\pgf@ya%
+ \pgf@ya=\pgf@y%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @west\endcsname{%
+ \southwest%
+ \pgf@y=\pgf@ya%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @east\endcsname{%
+ \northeast%
+ \pgf@y=\pgf@ya%
+ }%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @east\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @west\endcsname%
+ \ifnum\pgfmathcounter=\parts%
+ \else%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number\endcsname%
+ \pgf@ya=\pgf@y%
+ \advance\pgf@ya by-\csname pgf@lib@sh@rs@depth@\pgf@lib@sh@rs@number\endcsname\relax%
+ \advance\pgf@ya by-\innerysep\relax%
+ \advance\pgf@ya by-.5\pgflinewidth%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@west\endcsname{%
+ \southwest%
+ \pgf@y=\pgf@ya%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@east\endcsname{%
+ \northeast%
+ \pgf@y=\pgf@ya%
+ }%
+ \expandafter\pgfextract@process\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split\endcsname{%
+ \centerpoint%
+ \pgf@y=\pgf@ya%
+ }%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@east\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@west\endcsname%
+ \expandafter\addtosavedmacro\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split\endcsname%
+ \fi%
+ \fi%
+ \repeatpgfmathloop%
+ \fi%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x=0.5\wd\pgfnodeparttextbox%
+ \pgf@y=0pt\relax%
+ }
+ \savedanchor\midpoint{%
+ \pgf@x=0.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }
+ \anchor{center}{%
+ \rectanglesplitparameters%
+ \centerpoint%
+ }%
+ \anchor{base}{\basepoint}
+ \anchor{base east}{%
+ \rectanglesplitparameters%
+ \northeast%
+ \pgf@y=0pt\relax%
+ }%
+ \anchor{base west}{%
+ \rectanglesplitparameters%
+ \southwest%
+ \pgf@y=0pt\relax%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \rectanglesplitparameters%
+ \northeast%
+ \pgf@xa=\pgf@x%
+ \midpoint%
+ \pgf@x=\pgf@xa%
+ }%
+ \anchor{mid west}{%
+ \rectanglesplitparameters%
+ \southwest%
+ \pgf@xa=\pgf@x%
+ \midpoint%
+ \pgf@x=\pgf@xa%
+ }%
+ \anchor{north}{%
+ \rectanglesplitparameters%
+ \centerpoint%
+ \pgf@xa=\pgf@x%
+ \northeast%
+ \pgf@x=\pgf@xa%
+ }
+ \anchor{south}{%
+ \rectanglesplitparameters%
+ \centerpoint%
+ \pgf@xa=\pgf@x%
+ \southwest%
+ \pgf@x=\pgf@xa%
+ }
+ \anchor{east}{%
+ \rectanglesplitparameters%
+ \centerpoint%
+ \pgf@ya=\pgf@y%
+ \northeast%
+ \pgf@y=\pgf@ya%
+ }
+ \anchor{west}{%
+ \rectanglesplitparameters%
+ \centerpoint%
+ \pgf@ya=\pgf@y%
+ \southwest%
+ \pgf@y=\pgf@ya%
+ }
+ \anchor{north east}{%
+ \rectanglesplitparameters%
+ \northeast%
+ }
+ \anchor{north west}{%
+ \rectanglesplitparameters%
+ \northeast%
+ \pgf@ya=\pgf@y%
+ \southwest%
+ \pgf@y=\pgf@ya%
+ }
+ \anchor{south west}{%
+ \rectanglesplitparameters%
+ \southwest%
+ }
+ \anchor{south east}{%
+ \rectanglesplitparameters%
+ \southwest%
+ \pgf@ya=\pgf@y%
+ \northeast%
+ \pgf@y=\pgf@ya%
+ }
+ \behindbackgroundpath{%
+ \ifpgfrectanglesplitusecustomfill%
+ \pgf@lib@sh@rs@process@list{\pgf@lib@sh@rs@list@fill}{\parts}%
+ {%
+ \ifpgfrectanglesplithorizontal%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@bottomleft\expandafter=%
+ \csname pgf@anchor@rectangle split@south west\endcsname%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ \ifnum\pgfmathcounter=\parts%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@topright\expandafter=%
+ \csname pgf@anchor@rectangle split@north east\endcsname%
+ \else%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@topright\expandafter=%
+ \csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@number\space split north\endcsname%
+ \fi%
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \else%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname\pgf@lib@sh@rs@nonetext%
+ \else%
+ \pgfextract@process\pgf@lib@sh@rs@fill@bottomleft{%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \advance\pgf@y by\outerysep\relax%
+ \ifnum\pgfmathcounter=1\relax%
+ \advance\pgf@x by\outerxsep\relax%
+ \fi%
+ }%
+ \pgfextract@process\pgf@lib@sh@rs@fill@topright{%
+ \pgf@lib@sh@rs@fill@topright%
+ \advance\pgf@y by-\outerysep\relax%
+ \ifnum\pgfmathcounter=\parts\relax%
+ \advance\pgf@x by-\outerxsep\relax%
+ \fi%
+ }%
+ \ifnum\pgfmathcounter>1\relax%
+ \begingroup\pgfsetcornersarced{\pgfpointorigin}%
+ \fi%
+ \pgfpathmoveto{%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@xa=\pgf@x%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@x=\pgf@xa%
+ }%
+ \pgfpathlineto{\pgf@lib@sh@rs@fill@bottomleft}%
+ \pgfpathlineto{%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@xa=\pgf@x%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@x=\pgf@xa%
+ }%
+ \ifnum\pgfmathcounter>1\relax%
+ \endgroup%
+ \fi%
+ \ifnum\pgfmathcounter<\parts%
+ \begingroup\pgfsetcornersarced{\pgfpointorigin}%
+ \fi%
+ \pgfpathlineto{\pgf@lib@sh@rs@fill@topright}%
+ \pgfpathclose%
+ \ifnum\pgfmathcounter<\parts%
+ \endgroup%
+ \fi%
+ \pgfsetfillcolor{\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname}%
+ \pgfusepath{fill}%
+ \fi%
+ \fi%
+ \pgfextract@process\pgf@lib@sh@rs@fill@bottomleft{%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@ya=\pgf@y%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@y=\pgf@ya%
+ \advance\pgf@y by-\outerysep%
+ }%
+ \repeatpgfmathloop%
+ \else%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@topright\expandafter=%
+ \csname pgf@anchor@rectangle split@north east\endcsname%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ \ifnum\pgfmathcounter=\parts%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@bottomleft\expandafter=%
+ \csname pgf@anchor@rectangle split@south west\endcsname%
+ \else%
+ \expandafter\let\expandafter\pgf@lib@sh@rs@fill@bottomleft\expandafter=%
+ \csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@number\space split west\endcsname%
+ \fi%
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \else%
+ \expandafter\ifx\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname\pgf@lib@sh@rs@nonetext%
+ \else%
+ \pgfextract@process\pgf@lib@sh@rs@fill@bottomleft{%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \advance\pgf@x by\outerxsep\relax%
+ \ifnum\parts=1\relax%
+ \advance\pgf@y by\outerysep\relax%
+ \else%
+ \ifnum\pgfmathcounter=\parts
+ \advance\pgf@y by\outerysep\relax%
+ \fi%
+ \fi%
+ }%
+ \pgfextract@process\pgf@lib@sh@rs@fill@topright{%
+ \pgf@lib@sh@rs@fill@topright%
+ \advance\pgf@x by-\outerxsep\relax%
+ \ifnum\parts=1\relax%
+ \advance\pgf@y by-\outerysep\relax%
+ \else%
+ \ifnum\pgfmathcounter=1\relax%
+ \advance\pgf@y by-\outerysep\relax%
+ \fi%
+ \fi%
+ }%
+ \pgfpathmoveto{\pgf@lib@sh@rs@fill@bottomleft}%
+ \ifnum\pgfmathcounter>1\relax%
+ \begingroup\pgfsetcornersarced{\pgfpointorigin}%
+ \fi%
+ \pgfpathlineto{%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@xa=\pgf@x%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@x=\pgf@xa%
+ }%
+ \pgfpathlineto{\pgf@lib@sh@rs@fill@topright}%
+ \ifnum\pgfmathcounter>1\relax%
+ \endgroup%%
+ \fi%
+ \ifnum\pgfmathcounter<\parts%
+ \begingroup\pgfsetcornersarced{\pgfpointorigin}%
+ \fi%
+ \pgfpathlineto{%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@xa=\pgf@x%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@x=\pgf@xa%
+ }%
+ \pgfpathclose%
+ \ifnum\pgfmathcounter<\parts%
+ \endgroup%
+ \fi%
+ \pgfsetfillcolor{\csname pgf@lib@sh@rs@\pgf@lib@sh@rs@number @item\endcsname}%
+ \pgfusepath{fill}%
+ \fi%
+ \fi%
+ \pgfextract@process\pgf@lib@sh@rs@fill@topright{%
+ \pgf@lib@sh@rs@fill@topright%
+ \pgf@xa=\pgf@x%
+ \pgf@lib@sh@rs@fill@bottomleft%
+ \pgf@x=\pgf@xa%
+ \advance\pgf@x by\outerxsep\relax%
+ }%
+ \repeatpgfmathloop%
+ \fi%
+ }%
+ \fi%
+ }%
+ \backgroundpath{%
+ \begingroup%
+ \pgfextract@process\southwest{%
+ \southwest%
+ \advance\pgf@x by\outerxsep\relax%
+ \advance\pgf@y by\outerysep\relax%
+ }%
+ \pgfextract@process\northeast{%
+ \northeast%
+ \advance\pgf@x by-\outerxsep\relax%
+ \advance\pgf@y by-\outerysep\relax%
+ }%
+ \pgfpathrectangle{\southwest}{\pgfpointdiff{\southwest}{\northeast}}%
+ \endgroup%
+ \ifpgfrectanglesplitdrawsplits%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter=\parts%
+ \else%
+ \pgf@lib@sh@getalpha\pgf@lib@sh@rs@number{\pgfmathcounter}%
+ %
+ \expandafter\ifx\csname pgf@lib@sh@rs@empty@\pgf@lib@sh@rs@number\endcsname\pgfutil@empty%
+ \else%
+ \pgfpathmoveto{%
+ \ifpgfrectanglesplithorizontal%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@north\endcsname%
+ \advance\pgf@y by-\outerysep\relax%
+ \else%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@east\endcsname%
+ \advance\pgf@x by-\outerxsep\relax%
+ \fi%
+ }%
+ \pgfpathlineto{%
+ \ifpgfrectanglesplithorizontal%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@south\endcsname%
+ \advance\pgf@y by\outerysep\relax%
+ \else%
+ \csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@number @split@west\endcsname%
+ \advance\pgf@x by\outerxsep\relax%
+ \fi%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ \fi%
+ }%
+ \anchorborder{%
+ \pgfutil@tempdima\pgf@x%
+ \pgfutil@tempdimb\pgf@y%
+ \rectanglesplitparameters%
+ \pgfpointdiff{\southwest}{\northeast}%
+ \pgf@x.5\pgf@x%
+ \pgf@y.5\pgf@y%
+ \edef\pgf@marshall{%
+ \noexpand\pgfpointborderrectangle{%
+ \noexpand\pgfqpoint{\the\pgfutil@tempdima}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}%
+ }%
+ }%
+ \pgf@marshall%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ % Hackery to install the correct number of node parts.
+ %
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@rectangle split\endcsname{%
+ \let\pgf@lib@sh@rs@temp=\pgfutil@empty%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter=\parts%
+ \expandafter\edef\csname pgf@sh@boxes@rectangle split\endcsname%
+ {\pgf@lib@sh@rs@temp\pgf@lib@sh@toalpha{\pgfmathcounter}}%
+ \else%
+ \edef\pgf@lib@sh@rs@temp{\pgf@lib@sh@rs@temp\pgf@lib@sh@toalpha{\pgfmathcounter},}%
+ \repeatpgfmathloop%
+ }%
+}
+
+\pgfutil@for\pgf@lib@sh@rs@temp:={one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty}\do{%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp}{\noexpand\pgf@lib@sh@rs@anchor@one}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space split\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split}%
+ {\noexpand\centerpoint}%
+ {\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space split north\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@north}%
+ {\noexpand\csname pgf@anchor@rectangle split@north\noexpand\endcsname}%
+ {\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@north\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space split south\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@south}%
+ {\noexpand\csname pgf@anchor@rectangle split@south\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@south\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space north\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @north}%
+ {\noexpand\csname pgf@anchor@rectangle split@north\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @north\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space south\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @south}%
+ {\noexpand\csname pgf@anchor@rectangle split@south\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @south\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space split east\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@east}%
+ {\noexpand\csname pgf@anchor@rectangle split@east\noexpand\endcsname}%
+ {\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@east\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space split west\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@west}%
+ {\noexpand\csname pgf@anchor@rectangle split@west\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @split@west\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space east\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @east}%
+ {\noexpand\csname pgf@anchor@rectangle split@east\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @east\noexpand\endcsname}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@rectangle split@\pgf@lib@sh@rs@temp\space west\endcsname{%
+ \noexpand\rectanglesplitparameters%
+ \noexpand\pgfutil@ifundefined{pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @west}%
+ {\noexpand\csname pgf@anchor@rectangle split@west\noexpand\endcsname}%
+ {\noexpand\csname pgf@lib@sh@rs@anchor@\pgf@lib@sh@rs@temp @west\noexpand\endcsname}%
+ }%
+}%
+
+
+\pgfutil@namelet{pgf@anchor@rectangle split@text east}{pgf@anchor@rectangle split@one east}
+\pgfutil@namelet{pgf@anchor@rectangle split@text west}{pgf@anchor@rectangle split@one west}
+\pgfutil@namelet{pgf@anchor@rectangle split@text split}{pgf@anchor@rectangle split@one split}
+\pgfutil@namelet{pgf@anchor@rectangle split@text split east}{pgf@anchor@rectangle split@one split east}
+\pgfutil@namelet{pgf@anchor@rectangle split@text split west}{pgf@anchor@rectangle split@one split west}
+
+\pgfutil@namelet{pgf@anchor@rectangle split@second}{pgf@anchor@rectangle split@two}
+\pgfutil@namelet{pgf@anchor@rectangle split@second east}{pgf@anchor@rectangle split@two east}
+\pgfutil@namelet{pgf@anchor@rectangle split@second west}{pgf@anchor@rectangle split@two west}
+\pgfutil@namelet{pgf@anchor@rectangle split@second split}{pgf@anchor@rectangle split@two split}
+\pgfutil@namelet{pgf@anchor@rectangle split@second split east}{pgf@anchor@rectangle split@two split east}
+\pgfutil@namelet{pgf@anchor@rectangle split@second split west}{pgf@anchor@rectangle split@two split west}
+
+\pgfutil@namelet{pgf@anchor@rectangle split@third}{pgf@anchor@rectangle split@three}
+\pgfutil@namelet{pgf@anchor@rectangle split@third east}{pgf@anchor@rectangle split@three east}
+\pgfutil@namelet{pgf@anchor@rectangle split@third west}{pgf@anchor@rectangle split@three west}
+\pgfutil@namelet{pgf@anchor@rectangle split@third split}{pgf@anchor@rectangle split@three split}
+\pgfutil@namelet{pgf@anchor@rectangle split@third split east}{pgf@anchor@rectangle split@three split east}
+\pgfutil@namelet{pgf@anchor@rectangle split@third split west}{pgf@anchor@rectangle split@three split west}
+
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth}{pgf@anchor@rectangle split@four}
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth east}{pgf@anchor@rectangle split@four east}
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth west}{pgf@anchor@rectangle split@four west}
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth split}{pgf@anchor@rectangle split@four split}
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth split east}{pgf@anchor@rectangle split@four split east}
+\pgfutil@namelet{pgf@anchor@rectangle split@fourth split west}{pgf@anchor@rectangle split@four split west}
+
+
+
+
+% Shape: ellipse split.
+%
+\pgfdeclareshape{ellipse split}{%
+ \nodeparts{text,lower}
+ \savedanchor\radii{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgf@y2.0\pgf@y%
+ \advance\pgf@y.5\pgflinewidth%
+ \pgf@xa.5\wd\pgfnodeparttextbox%
+ \pgf@xb.5\wd\pgfnodepartlowerbox%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@xb\pgf@x%
+ \pgf@ya\ht\pgfnodeparttextbox%
+ \advance\pgf@ya\dp\pgfnodeparttextbox%
+ \pgf@yb\ht\pgfnodepartlowerbox%
+ \advance\pgf@yb\dp\pgfnodepartlowerbox%
+ \advance\pgf@ya\pgf@y%
+ \advance\pgf@yb\pgf@y%
+ \ifdim\pgf@xa>\pgf@xb%
+ \pgf@x1.414213\pgf@xa%
+ \else%
+ \pgf@x1.414213\pgf@xb%
+ \fi%
+ \ifdim\pgf@ya>\pgf@yb%
+ \pgf@y1.414213\pgf@ya%
+ \else%
+ \pgf@y1.414213\pgf@yb%
+ \fi%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ }
+ \savedanchor\lower{%
+ \pgf@x-.5\wd\pgfnodepartlowerbox%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgf@y-2.0\pgf@y%
+ \advance\pgf@y-\pgflinewidth%
+ \advance\pgf@y-\dp\pgfnodeparttextbox%
+ \advance\pgf@y-\ht\pgfnodepartlowerbox%
+ }
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{-\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y-\dp\pgfnodeparttextbox%
+ \advance\pgf@y-.5\pgflinewidth%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{.5ex}%
+ }%
+ \anchor{center}{\centerpoint}
+ \anchor{lower}{\lower}
+ \anchor{mid}{\midpoint}
+ \anchor{mid east}{\radii\pgf@xa\pgf@x\midpoint\advance\pgf@x\pgf@xa}
+ \anchor{mid west}{\radii\pgf@xa\pgf@x\midpoint\advance\pgf@x-\pgf@xa}
+ \anchor{base}{\basepoint}
+ \anchor{base east}{\radii\pgf@xa\pgf@x\basepoint\advance\pgf@x\pgf@xa}
+ \anchor{base west}{\radii\pgf@xa\pgf@x\basepoint\advance\pgf@x-\pgf@xa}
+ \anchor{north}{\pgfpointadd{\centerpoint}{\radii\pgf@x0pt}}%
+ \anchor{south}{\pgfpointadd{\centerpoint}{\radii\pgf@x0pt\pgf@y-\pgf@y}}%
+ \anchor{east}{\pgfpointadd{\centerpoint}{\radii\pgf@y0pt}}%
+ \anchor{west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-\pgf@x\pgf@y0pt}}%
+ \anchor{north west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-0.707106\pgf@x\pgf@y0.707106\pgf@y}}%
+ \anchor{south west}{\pgfpointadd{\centerpoint}{\radii\pgf@x-0.707106\pgf@x\pgf@y-0.707106\pgf@y}}%
+ \anchor{north east}{\pgfpointadd{\centerpoint}{\radii\pgf@x0.707106\pgf@x\pgf@y0.707106\pgf@y}}%
+ \anchor{south east}{\pgfpointadd{\centerpoint}{\radii\pgf@x0.707106\pgf@x\pgf@y-0.707106\pgf@y}}%
+ \backgroundpath{%
+ \radii%
+ \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfutil@tempdima\pgf@x%
+ \pgfutil@tempdimb\pgf@y%
+ \pgfpathellipse{\centerpoint}{\pgfqpoint{\the\pgfutil@tempdima}{0pt}}{\pgfqpoint{0pt}{\the\pgfutil@tempdimb}}%
+ \pgfpathmoveto{\centerpoint\advance\pgf@x-\pgfutil@tempdima}%
+ \pgfpathlineto{\centerpoint\advance\pgf@x\pgfutil@tempdima}%
+ }
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \radii%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpointadd{\noexpand\pgfpointborderellipse{\noexpand\externalpoint}%
+ {\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}}{\noexpand\centerpoint}%
+ }%
+ \pgf@marshal%
+ }%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
index 152ee00c4fb..b419a8cb624 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryshapes.symbols.code.tex,v 1.13 2008/01/30 07:56:38 vibrovski Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex,v 1.3 2009/10/27 23:03:12 tantau Exp $
\pgfdeclareshape{forbidden sign}
{
@@ -1377,72 +1377,56 @@
% Internal macros for signal shape.
%
-\def\pgf@lib@shapes@signal@nowhere{nowhere}%
-\def\pgf@lib@shapes@signal@from{from}%
-\def\pgf@lib@shapes@signal@to{to}%
+\def\pgf@lib@sh@signal@nowhere{nowhere}%
+\def\pgf@lib@sh@signal@from{from}%
+\def\pgf@lib@sh@signal@to{to}%
-\let\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
-\let\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
-\let\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
-\let\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+\def\pgf@lib@sh@signal@parsedirection#1#2{%
+ %
+ \let\pgf@lib@sh@signal@direction=#2%
+ \edef\pgf@lib@sh@temp{#1}%
+ \expandafter\pgf@lib@sh@signal@@parsedirection\pgf@lib@sh@temp\pgf@stop}
-\def\pgf@lib@shapes@signal@parsedirection#1#2{%
- \let\pgf@lib@shapes@signal@direction#2%
+\def\pgf@lib@sh@signal@@parsedirection#1\pgf@stop{%
\pgfutil@in@{and}{#1}%
\ifpgfutil@in@%
- \pgf@lib@shapes@signal@@parsedirection#1\pgf@lib%
+ \pgf@lib@sh@signal@@@parsedirection#1\pgf@lib%
\else%
- \pgf@lib@shapes@signal@@parsedirection#1 and #1\pgf@lib%
+ \pgf@lib@sh@signal@@@parsedirection#1 and #1\pgf@lib%
\fi
}
-\def\pgf@lib@shapes@signal@@parsedirection#1 and #2\pgf@lib{%
+\def\pgf@lib@sh@signal@@@parsedirection#1 and #2\pgf@lib{%
\pgfutil@in@{nowhere}{#1}%
\ifpgfutil@in@
- \pgf@lib@shapes@signal@@donowhere%
\else%
- \pgf@lib@shapes@signal@@@parsedirection{#1}%
- \pgf@lib@shapes@signal@@@parsedirection{#2}%
+ \pgf@lib@sh@signal@@@@parsedirection{#1}%
+ \pgf@lib@sh@signal@@@@parsedirection{#2}%
\fi%
}
-\def\pgf@lib@shapes@signal@@@parsedirection#1{%
+\def\pgf@lib@sh@signal@@@@parsedirection#1{%
\pgfutil@in@{ #1 }{ east right }%
\ifpgfutil@in@%
- \let\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@direction%
- \let\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
- \let\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
+ \let\pgf@lib@sh@signal@east=\pgf@lib@sh@signal@direction%
+ \let\pgf@lib@sh@signal@north=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@south=\pgf@lib@sh@signal@nowhere%
\fi%
\pgfutil@in@{ #1 }{ left west }%
\ifpgfutil@in@%
- \let\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@direction%
- \let\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
- \let\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
+ \let\pgf@lib@sh@signal@west=\pgf@lib@sh@signal@direction%
+ \let\pgf@lib@sh@signal@north=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@south=\pgf@lib@sh@signal@nowhere%
\fi%
\pgfutil@in@{ #1 }{ above up north }%
\ifpgfutil@in@%
- \let\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@direction%
- \let\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
- \let\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+ \let\pgf@lib@sh@signal@north=\pgf@lib@sh@signal@direction%
+ \let\pgf@lib@sh@signal@east=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@west=\pgf@lib@sh@signal@nowhere%
\fi%
\pgfutil@in@{ #1 }{ below down south }%
\ifpgfutil@in@%
- \let\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@direction%
- \let\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
- \let\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
- \fi%
-}
-
-\def\pgf@lib@shapes@signal@@donowhere{%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@direction%
- \pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
- \fi%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@direction%
- \pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
- \fi%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@direction%
- \pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
- \fi%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@direction%
- \pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
+ \let\pgf@lib@sh@signal@south=\pgf@lib@sh@signal@direction%
+ \let\pgf@lib@sh@signal@east=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@west=\pgf@lib@sh@signal@nowhere%
\fi%
}
@@ -1451,23 +1435,21 @@
%
\pgfkeys{/pgf/.cd,
signal pointer angle/.initial=90,
- signal from/.code={\pgf@lib@shapes@signal@parsedirection{#1}{\pgf@lib@shapes@signal@from}},
- signal to/.code={\pgf@lib@shapes@signal@parsedirection{#1}{\pgf@lib@shapes@signal@to}}
-}
-
-
-\pgfkeys{/pgf/.cd,
- signal to=east,
- signal from=nowhere
+ signal to/.initial=east,
+ signal from/.initial=nowhere
}
-
-% Shape signal
-%
-%
\pgfdeclareshape{signal}{%
\savedmacro\installsignalparameters{%
%
+ \let\pgf@lib@sh@signal@north=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@south=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@east=\pgf@lib@sh@signal@nowhere%
+ \let\pgf@lib@sh@signal@west=\pgf@lib@sh@signal@nowhere%
+ %
+ \pgf@lib@sh@signal@parsedirection{\pgfkeysvalueof{/pgf/signal from}}{\pgf@lib@sh@signal@from}%
+ \pgf@lib@sh@signal@parsedirection{\pgfkeysvalueof{/pgf/signal to}}{\pgf@lib@sh@signal@to}%
+ %
% Define a centerpoint.
%
\pgfextract@process\centerpoint{%
@@ -1479,16 +1461,22 @@
% Get some useful trig. stuff
%
\pgfmathsetmacro\pointerangle{\pgfkeysvalueof{/pgf/signal pointer angle}}%
+ %
\pgfmathdivide@{\pointerangle}{2}%
- \let\halfpointerangle\pgfmathresult%
+ \let\halfpointerangle=\pgfmathresult%
+ %
\pgfmathcosec@{\halfpointerangle}%
- \let\cosechalfpointerangle\pgfmathresult%
+ \let\cosechalfpointerangle=\pgfmathresult%
+ %
\pgfmathdivide@{\halfpointerangle}{2}%
- \let\quarterpointerangle\pgfmathresult%
+ \let\quarterpointerangle=\pgfmathresult%
+ %
\pgfmathcosec@{\quarterpointerangle}%
- \let\cosecquarterpointerangle\pgfmathresult%
+ \let\cosecquarterpointerangle=\pgfmathresult%
+ %
\pgfmathsec@{\quarterpointerangle}%
- \let\secquarterpointerangle\pgfmathresult%
+ \let\secquarterpointerangle=\pgfmathresult%
+ %
\pgfmathsubtract@{90}{\quarterpointerangle}%
\let\complementquarterpointerangle\pgfmathresult%
%
@@ -1499,21 +1487,21 @@
\ifdim\pgf@x>\pgf@y%
\pgf@y\pgf@x%
\fi%
- \pgf@yc\pgf@y%
+ \pgf@yc=\pgf@y%
%
% Calculate the miter due to the line width, at the pointer apex...
%
- \pgf@x\cosechalfpointerangle\pgf@y%
+ \pgf@x=\cosechalfpointerangle\pgf@y%
\edef\pointerapexmiter{\the\pgf@x}%
%
% ...at a corner by a `to' pointer (i.e. sticks out)...
%
- \pgf@x\secquarterpointerangle\pgf@y%
+ \pgf@x=\secquarterpointerangle\pgf@y%
\edef\tocornermiter{\the\pgf@x}%
%
% ...at a corner by a `from' pointer (i.e. sticks in).
%
- \pgf@x\cosecquarterpointerangle\pgf@y
+ \pgf@x=\cosecquarterpointerangle\pgf@y
\edef\fromcornermiter{\the\pgf@x}%
%
% Get the (half) dimensions of the node.
@@ -1528,52 +1516,67 @@
%
\pgfmathsubtract@{90}{\halfpointerangle}%
\pgfmathtan@{\pgfmathresult}%
- \pgf@xb\pgfmathresult\pgf@ya%
+ \pgf@xb=\pgfmathresult\pgf@ya%
%
% ...and up.
%
- \pgf@yb\pgfmathresult\pgf@xa%
+ \pgf@yb=\pgfmathresult\pgf@xa%
%
% Adjust for minimum height.
%
- \pgfutil@tempdima2.0\pgf@ya%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
+ \pgfutil@tempdima=2.0\pgf@ya%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@nowhere%
\else%
- \advance\pgfutil@tempdima\pgf@yb%
+ \advance\pgfutil@tempdima by\pgf@yb%
\fi%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@nowhere%
\else%
- \advance\pgfutil@tempdima\pgf@yb%
+ \advance\pgfutil@tempdima by\pgf@yb%
\fi%
\pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
\ifdim\pgfutil@tempdima<\pgf@y%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdima\pgfmathresult\pgf@y%
- \pgf@xa\pgfmath@tonumber{\pgfutil@tempdima}\pgf@xa%
- \pgf@ya\pgfmath@tonumber{\pgfutil@tempdima}\pgf@ya%
- \pgf@xb\pgfmath@tonumber{\pgfutil@tempdima}\pgf@xb%
- \pgf@yb\pgfmath@tonumber{\pgfutil@tempdima}\pgf@yb%
+ \pgfutil@tempdima=\pgf@y%
+ %
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@nowhere%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@yb%
+ \fi%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@nowhere%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@yb%
+ \fi%
+ \pgf@ya=0.5\pgfutil@tempdima%
+ \pgfmathsubtract@{90}{\halfpointerangle}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgf@xb=\pgfmathresult\pgf@ya%
\fi%
%
% Adjust for minimum width.
%
- \pgfutil@tempdima2.0\pgf@xa%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
+ \pgfutil@tempdima=2.0\pgf@xa%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
\else%
- \advance\pgfutil@tempdima\pgf@xb%
+ \advance\pgfutil@tempdima by\pgf@xb%
\fi%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
\else%
- \advance\pgfutil@tempdima\pgf@xb%
+ \advance\pgfutil@tempdima by\pgf@xb%
\fi%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/minimum width}}%
\ifdim\pgfutil@tempdima<\pgf@x%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdima\pgfmathresult\pgf@x%
- \pgf@xa\pgfmath@tonumber{\pgfutil@tempdima}\pgf@xa%
- \pgf@ya\pgfmath@tonumber{\pgfutil@tempdima}\pgf@ya%
- \pgf@xb\pgfmath@tonumber{\pgfutil@tempdima}\pgf@xb%
- \pgf@yb\pgfmath@tonumber{\pgfutil@tempdima}\pgf@yb%
+ \pgfutil@tempdima=\pgf@x%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xb%
+ \fi%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xb%
+ \fi%
+ \pgf@xa=0.5\pgfutil@tempdima%
+ \pgfmathsubtract@{90}{\halfpointerangle}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgf@yb=\pgfmathresult\pgf@xa%
\fi%
%
% So, define the points for the background path.
@@ -1581,28 +1584,28 @@
\pgfextract@process\north{%
\centerpoint%
\advance\pgf@y\pgf@ya%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@to%
\advance\pgf@y\pgf@yb%
\fi%
}%
\pgfextract@process\south{%
\centerpoint%
\advance\pgf@y-\pgf@ya%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@to%
\advance\pgf@y-\pgf@yb%
\fi%
}%
\pgfextract@process\east{%
\centerpoint%
\advance\pgf@x\pgf@xa%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@to%
\advance\pgf@x\pgf@xb%
\fi%
}%
\pgfextract@process\west{%
\centerpoint%
\advance\pgf@x-\pgf@xa%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@to%
\advance\pgf@x-\pgf@xb%
\fi%
}%
@@ -1610,10 +1613,10 @@
\centerpoint%
\advance\pgf@y\pgf@ya%
\advance\pgf@x\pgf@xa%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\advance\pgf@y\pgf@yb%
\fi%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@from%
\advance\pgf@x\pgf@xb%
\fi%
}%
@@ -1621,10 +1624,10 @@
\centerpoint%
\advance\pgf@y-\pgf@ya%
\advance\pgf@x\pgf@xa%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\advance\pgf@y-\pgf@yb%
\fi%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@from%
\advance\pgf@x\pgf@xb%
\fi%
}%
@@ -1632,10 +1635,10 @@
\centerpoint%
\advance\pgf@y-\pgf@ya%
\advance\pgf@x-\pgf@xa%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\advance\pgf@y-\pgf@yb%
\fi%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@from%
\advance\pgf@x-\pgf@xb%
\fi%
}%
@@ -1643,10 +1646,10 @@
\centerpoint%
\advance\pgf@y\pgf@ya%
\advance\pgf@x-\pgf@xa%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\advance\pgf@y\pgf@yb%
\fi%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@from%
\advance\pgf@x-\pgf@xb%
\fi%
}%
@@ -1663,7 +1666,7 @@
%
\pgfextract@process\northmiter{%
\pgf@x0pt%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@nowhere%
\pgf@y\pgf@yc%
\else%
\pgf@y\pointerapexmiter\relax%
@@ -1671,7 +1674,7 @@
}%
\pgfextract@process\southmiter{%
\pgf@x0pt%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@nowhere%
\pgf@y-\pgf@yc%
\else%
\pgf@y-\pointerapexmiter\relax%
@@ -1679,7 +1682,7 @@
}%
\pgfextract@process\eastmiter{%
\pgf@y0pt%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
\pgf@x\pgf@yc%
\else%
\pgf@x\pointerapexmiter\relax%
@@ -1687,99 +1690,99 @@
}%
\pgfextract@process\westmiter{%
\pgf@y0pt%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
\pgf@x-\pgf@yc%
\else%
\pgf@x-\pointerapexmiter\relax%
\fi%
}%
\pgfextract@process\northeastmiter{%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
\pgf@x\pgf@yc
\pgf@y\pgf@yc%
\else
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@from%
\pgfqpointpolar{\quarterpointerangle}{\fromcornermiter}
\else%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@to%
\pgfqpointpolar{\complementquarterpointerangle}{\tocornermiter}%
\fi%
\fi%
\fi%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\pgfqpointpolar{\complementquarterpointerangle}{\fromcornermiter}%
\else%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@to%
\pgfqpointpolar{\quarterpointerangle}{\tocornermiter}%
\fi%
\fi%
}%
\pgfextract@process\southeastmiter{%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
\pgf@x\pgf@yc%
\pgf@y\pgf@yc%
\else
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@from%
\pgfqpointpolar{-\quarterpointerangle}{\fromcornermiter}
\else%
- \ifx\pgf@lib@shapes@signal@east\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@to%
\pgfqpointpolar{-\complementquarterpointerangle}{\tocornermiter}%
\fi%
\fi%
\fi%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\pgfqpointpolar{-\complementquarterpointerangle}{\fromcornermiter}
\else%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@to%
\pgfqpointpolar{-\quarterpointerangle}{\tocornermiter}%
\fi%
\fi%
}%
\pgfextract@process\southwestmiter{%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
\pgf@x-\pgf@yc
\pgf@y-\pgf@yc%
\else
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@from%
\pgfmathadd@{\quarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\fromcornermiter}
\else%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@to%
\pgfmathadd@{\complementquarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
\fi%
\fi%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\pgfmathadd@{\complementquarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\fromcornermiter}%
\else%
- \ifx\pgf@lib@shapes@signal@south\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@to%
\pgfmathadd@{\quarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
\fi%
}%
\pgfextract@process\northwestmiter{%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@nowhere%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
\pgf@x-\pgf@yc%
\pgf@y\pgf@yc%
\else
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@from%
\pgfmathsubtract@{180}{\quarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\fromcornermiter}
\else%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@to%
\pgfmathsubtract@{180}{\complementquarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
\fi%
\fi%
- \ifx\pgf@lib@shapes@signal@north\pgf@lib@shapes@signal@from%
+ \ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\pgfmathsubtract@{180}{\complementquarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\fromcornermiter}%
\else%
- \ifx\pgf@lib@shapes@signal@west\pgf@lib@shapes@signal@to%
+ \ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@to%
\pgfmathsubtract@{180}{\quarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
@@ -2051,7 +2054,6 @@
-
% Keys for shape tape
%
% /pgf/tape bend top : Type of bend for north side.
@@ -2510,4 +2512,60 @@
\fi%
\fi%
}%
-} \ No newline at end of file
+}
+
+
+
+
+% Keys for magnifying glass shape
+%
+% /pgf/magnifying glass handle angle : The angle of handle
+% /pgf/magnifying glass handle aspect : The length of the handle as a multiple
+% of the radius of the circle
+%
+
+\pgfkeys{/pgf/.cd,
+ magnifying glass handle angle/.initial=-45,
+ magnifying glass handle aspect/.initial=1.5
+}
+
+\pgfdeclareshape{magnifying glass}
+{
+ \inheritsavedanchors[from=circle] % this is nearly a circle
+ \inheritanchorborder[from=circle]
+ \inheritanchor[from=circle]{north}
+ \inheritanchor[from=circle]{north west}
+ \inheritanchor[from=circle]{north east}
+ \inheritanchor[from=circle]{center}
+ \inheritanchor[from=circle]{west}
+ \inheritanchor[from=circle]{east}
+ \inheritanchor[from=circle]{mid}
+ \inheritanchor[from=circle]{mid west}
+ \inheritanchor[from=circle]{mid east}
+ \inheritanchor[from=circle]{base}
+ \inheritanchor[from=circle]{base west}
+ \inheritanchor[from=circle]{base east}
+ \inheritanchor[from=circle]{south}
+ \inheritanchor[from=circle]{south west}
+ \inheritanchor[from=circle]{south east}
+ \inheritbackgroundpath[from=circle]
+ \foregroundpath{
+ \centerpoint%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgfutil@tempdima=\radius%
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xb<\pgf@yb%
+ \advance\pgfutil@tempdima by-\pgf@yb%
+ \else%
+ \advance\pgfutil@tempdima by-\pgf@xb%
+ \fi%
+ \pgfpathmoveto{\pgfpointadd{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpointpolar{\pgfkeysvalueof{/pgf/magnifying glass handle angle}}{\pgfutil@tempdima}}}
+ \pgfpathlineto{\pgfpointadd{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ {\pgfpointpolar{\pgfkeysvalueof{/pgf/magnifying glass handle angle}}{\pgfutil@tempdima+\pgfutil@tempdima*(\pgfkeysvalueof{/pgf/magnifying glass handle aspect})}}}
+ }
+}
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
index c901c3972f1..9c51dc46117 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
@@ -7,4 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\input pgfmathcalc.code.tex \ No newline at end of file
+\input pgfmathcalc.code.tex
+
+\ifx\pgfkeysloaded\undefined
+ \let\pgfkeysloaded=\relax
+\else
+ \expandafter\input pgfmathfloat.code.tex
+\fi
+
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
index 29a2be58693..c1f099ce160 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
@@ -13,8 +13,8 @@
\input pgfmathutil.code.tex
\input pgfmathparser.code.tex
-\input pgfmathoperations.code.tex
-\input pgfmathbase.code.tex
+\input pgfmathfunctions.code.tex
+%\input pgfmathbase.code.tex
% \pgfmathsetlength, \pgfmathaddtolength
%
@@ -85,7 +85,8 @@
\def\pgfmathsetcount#1#2{%
\expandafter\pgfmath@onquick#2\pgfmath@%
{%
- #1#2\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ #1#2\relax\pgfmath@%
}%
{%
\pgfmathparse{#2}%
@@ -105,7 +106,10 @@
\def\pgfmathaddtocount#1#2{%
\expandafter\pgfmath@onquick#2\pgfmath@%
{%
- \advance#1#2\relax%
+ \edef\pgfmath@addtocounttemp{\the#1}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ #1#2\relax\pgfmath@%
+ \advance#1\pgfmath@addtocounttemp\relax%
}%
{%
\edef\pgfmath@addtocounttemp{\the#1}%
@@ -240,14 +244,327 @@
% \pgfmath@onquick+0pt\pgfmath@{is quick}{is slow}
\def\pgfmath@onquick{%
- \afterassignment\pgfmath@afterquick%
- \let\pgfmath@next=%
+ \futurelet\pgfmath@next%
+ \pgfmath@@onquick}
+\def\pgfmath@@onquick#1\pgfmath@{%
+ \ifx\pgfmath@next+%
+ \let\pgfmath@next=\pgfmath@firstoftwo%
+ \else%
+ \let\pgfmath@next=\pgfmath@secondoftwo%
+ \fi%
+ \pgfmath@next%
+}
+
+% *** The following commands DO NOT WORK without the rest of PGF ***
+%
+% (a dumping ground for stuff that doesn't really belong anywhere else)
+
+% \pgfmathanglebetweenpoints
+%
+% Define \pgfmathresult as the angle between points #1 and #2
+% Should get the quadrants right as well.
+%
+\def\pgfmathanglebetweenpoints#1#2{%
+ \begingroup%
+ \pgf@process{\pgfpointdiff{#1}{#2}}%
+ %
+ % First approximate the angle of the external point...
+ %
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \ifdim\pgf@xa<0pt\relax%
+ \pgf@xa-\pgf@xa%
+ \fi%
+ \ifdim\pgf@ya<0pt\relax%
+ \pgf@ya-\pgf@ya%
+ \fi%
+ \ifdim\pgf@ya>\pgf@xa%
+ \pgf@x\pgf@xa%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgf@x\pgf@ya%
+ \pgf@y\pgf@xa%
+ \fi%
+ \ifdim\pgf@y=0pt\relax%
+ \pgf@x0pt%
+ \else%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
+ \pgf@x\pgfmathresult\pgf@x%
+ \fi%
+ \multiply\pgf@x1000\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\the\pgf@x\relax\pgfmath@%
+ \expandafter\pgf@x\csname pgfmath@atan@\the\c@pgf@counta\endcsname pt\relax%
+ \ifdim\pgfmath@ya>\pgfmath@xa\relax%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x90pt%
+ \fi%
+ \ifdim\pgf@xb<0pt%
+ \ifdim\pgf@yb>0pt%
+ \pgf@x-\pgf@x%
+ \fi%
+ \advance\pgf@x180pt\relax%
+ \else%
+ \ifdim\pgf@yb<0pt%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x360pt\relax%
+ \fi\fi%
+ \pgfmath@returnone\pgf@x%
+ \endgroup%
}
-\def\pgfmath@afterquick#1\pgfmath@{%
- \ifx\pgfmath@next+%
- \expandafter\pgfmath@firstoftwo%
- \else%
- \expandafter\pgfmath@secondoftwo%
- \fi%
-} \ No newline at end of file
+%
+% \pgfmathrotatepointaround
+%
+% Rotate point #1 about point #2 by #3 degrees.
+%
+\def\pgfmathrotatepointaround#1#2#3{%
+ \pgf@process{%
+ \pgf@process{#1}%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \pgf@process{#2}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgf@x=\pgf@xc%
+ \pgf@y=\pgf@yc%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ \pgfmathsetmacro\angle{#3}%
+ \pgfmathsin@{\angle}%
+ \let\sineangle\pgfmathresult%
+ \pgfmathcos@{\angle}%
+ \let\cosineangle\pgfmathresult%
+ \pgf@xa\cosineangle\pgf@x%
+ \advance\pgf@xa-\sineangle\pgf@y%
+ \pgf@ya\sineangle\pgf@x%
+ \advance\pgf@ya\cosineangle\pgf@y%
+ \pgf@x\pgf@xb%
+ \pgf@y\pgf@yb%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+}
+
+% \pgfmathanglebetweenlines
+%
+% Calculate the clockwise angle between a line from point #1
+% to point #2 and a line from #3 to point #4.
+%
+\def\pgfmathanglebetweenlines#1#2#3#4{%
+ \begingroup%
+ \pgfmathanglebetweenpoints{#1}{#2}%
+ \let\firstangle\pgfmathresult%
+ \pgfmathanglebetweenpoints{#3}{#4}%
+ \let\secondangle\pgfmathresult%
+ \ifdim\firstangle pt>\secondangle pt\relax%
+ \pgfmathadd@{\secondangle}{360}%
+ \let\secondangle\pgfmathresult%
+ \fi%
+ \pgfmathsubtract@{\secondangle}{\firstangle}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% \pgfmathpointreflectalongaxis
+%
+% Reflects point #2 around an axis centered on #2 at an angle #3.
+%
+\def\pgfmathreflectpointalongaxis#1#2#3{%
+ \pgf@process{%
+ \pgfmathanglebetweenpoints{#2}{#1}%
+ \pgfmath@tempdima\pgfmathresult pt\relax%
+ \pgfmathparse{#3}%
+ \advance\pgfmath@tempdima-\pgfmathresult pt\relax%
+ \pgfmath@tempdima-2.0\pgfmath@tempdima%
+ \pgfmathrotatepointaround{#1}{#2}{\pgfmath@tonumber{\pgfmath@tempdima}}%
+ }%
+}
+
+
+
+% \pgfmathpointintersectionoflineandarc
+%
+% A bit experimental at the moment:
+%
+% Locates the point where a line crosses an eliptical arc. If the line
+% does not cross the arc, a meaningless point will result.
+%
+% #1 the point of the line on the "convex" side of the arc.
+% #2 the point of the line on the "concave" side of the arc.
+% #3 the center of the eliptical arc.
+% #4 start angle of the arc.
+% #5 end angle of the arc.
+% #6 radii of the arc.
+%
+\def\pgfmathpointintersectionoflineandarc#1#2#3#4#5#6{%
+ \pgf@process{%
+ %
+ % Get the required angle.
+ %
+ \pgfmathanglebetweenpoints{#2}{#1}%
+ \let\x\pgfmathresult%
+ %
+ % Get the radii of the arc.
+ %
+ \pgfmath@in@{and }{#6}%
+ \ifpgfmath@in@%
+ \pgf@polar@#6\@@%
+ \else%
+ \pgf@polar@#6 and #6\@@%
+ \fi%
+ \edef\xarcradius{\the\pgf@x}%
+ \edef\yarcradius{\the\pgf@y}%
+ %
+ % Get the start and end angles of the arc...
+ %
+ \pgfmathsetmacro\s{#4}%
+ \pgfmathsetmacro\e{#5}%
+ %
+ % ...and also with rounding.
+ %
+ \pgfmathmod@{\s}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\ss\pgfmathresult%
+ \pgfmathmod@{\e}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\ee\pgfmathresult%
+ %
+ % Hackery for when arc straddles zero.
+ %
+ \ifdim\ee pt<\ss pt\relax%
+ \pgfmathadd@{\x}{180}%
+ \pgfmathmod@{\pgfmathresult}{360}%
+ \let\x\pgfmathresult%
+ \fi%
+ \def\m{360}% Measure of nearness.
+ \pgfmathadd@{\s}{\e}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\n\pgfmathresult% The best estimate (default to middle of arc).
+ \pgfmathloop%
+ \pgfmathadd@{\s}{\e}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\p\pgfmathresult%
+ \ifdim\p pt=\s pt\relax%
+ \else%
+ \pgfmathanglebetweenpoints{#2}{%
+ \pgfpointadd{#3}{%
+ \pgf@x\xarcradius\relax%
+ \pgfmathcos@{\p}%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y\yarcradius\relax%
+ \pgfmathsin@{\p}%
+ \pgf@y\pgfmathresult\pgf@y%
+ }%
+ }%
+ %
+ % Hackery for when arc straddles zero.
+ %
+ \ifdim\ee pt<\ss pt\relax%
+ \pgfmathadd@{\pgfmathresult}{180}%
+ \pgfmathmod@{\pgfmathresult}{360}%
+ \fi%
+ \let\q\pgfmathresult%
+ %
+ % More hackery...
+ %
+ \ifdim\x pt>335pt\relax%
+ \ifdim\q pt<45pt\relax%
+ \pgfmathadd@{\q}{360}%
+ \let\q\pgfmathresult%
+ \fi%
+ \fi%
+ \ifdim\x pt=\q pt% Found it!
+ \pgfmathbreakloop% Breaks after current iteration is complete.
+ \else
+ \ifdim\x pt<\q pt\relax%
+ \let\e\p%
+ \else%
+ \let\s\p%
+ \fi%
+ \fi%
+ \pgfmathsubtract@{\x}{\q}%
+ \pgfmathabs@{\pgfmathresult}%
+ %
+ % Save the estimate if it is better than any previous estimate.
+ %
+ \ifdim\pgfmathresult pt<\m pt\relax%
+ \let\m\pgfmathresult%
+ \let\n\p%
+ \fi%
+ \repeatpgfmathloop%
+ \pgfpointadd{#3}{\pgfpointpolar{\n}{\xarcradius and \yarcradius}}%
+ }%
+}
+
+% \pgfmathangleonellipse
+%
+% Find the angle corresponding to a point on the border of an ellispe.
+%
+% #1 - the point on the border.
+% #2 - the radii of the ellipse.
+%
+\def\pgfmathangleonellipse#1#2{%
+ \begingroup%
+ \pgfmath@in@{and }{#2}%
+ \ifpgfmath@in@%
+ \pgf@polar@#2\@@%
+ \else%
+ \pgf@polar@#2 and #2\@@%
+ \fi%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgf@process{#1}%
+ \ifdim\pgf@x=0pt\relax%
+ \pgfutil@tempdima1pt\relax%
+ \else%
+ \pgfutil@tempdima\pgf@x%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \fi%
+ \ifdim\pgf@y=0pt\relax%
+ \pgfutil@tempdima1pt\relax%
+ \else%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@y}}{\pgfmath@tonumber{\pgf@ya}}%
+ \pgfutil@tempdima\pgfmathresult\pgfutil@tempdima%
+ \pgfmathatan@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \fi%
+ %
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \ifdim\pgfutil@tempdima<0pt\relax%
+ \advance\pgfutil@tempdima360pt\relax%
+ \fi%
+ \ifdim\pgf@x<0pt\relax%
+ \ifdim\pgf@y=0pt\relax%
+ \pgfutil@tempdima180pt\relax%
+ \else%
+ \ifdim\pgf@y<0pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \else%
+ \advance\pgfutil@tempdima-180pt\relax%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgf@x=0pt\relax%
+ \ifdim\pgf@y<0pt\relax%
+ \pgfutil@tempdima270pt\relax%
+ \else%
+ \pgfutil@tempdima90pt\relax%
+ \fi%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \pgfutil@tempdima0pt\relax%
+ \fi%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfutil@tempdima%
+ \endgroup%
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
new file mode 100644
index 00000000000..722856f3628
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
@@ -0,0 +1,2376 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% 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.
+%
+% This file contains methods for basic floating point arithmetics, rounding
+% to arbitrary precision and number pretty printing.
+%
+% Version 1.0 2008/09/17
+
+\global\newif\ifpgfmathfloatcomparison
+\newif\ifpgfmathfloatroundhasperiod
+\newif\ifpgfmathprintnumberskipzeroperiod
+
+
+% used internally in grouped macros:
+\toksdef\pgfmathfloat@tmptoks=1
+\newif\ifpgfmathfloat@fixed@digits@after@period
+\newif\ifpgfmathfloatroundmayneedrenormalize
+\toksdef\pgfmathfloat@a@Mtok=0
+
+%% WARNING: avoid conflicting register names!
+\let\pgfmathfloat@a@S=\c@pgf@counta
+\let\pgfmathfloat@a@M=\pgf@xa
+\let\pgfmathfloat@a@E=\c@pgf@countb
+\let\pgfmathfloat@b@S=\c@pgf@countc
+\let\pgfmathfloat@b@M=\pgf@xb
+\let\pgfmathfloat@b@E=\c@pgf@countd
+
+% can be changed with options.
+\def\pgfmathfloat@round@precision{2}
+
+\gdef\pgfmathfloat@glob@TMP{}
+
+
+% Computes a normalised floating point representation for #1 of the
+% form
+% [FLAGS] MANTISSE EXPONENT
+% meaning
+% [+-]X.XXXXXXX*10^C
+% where
+% X.XXXXXX is a mantissa with first number != 0, C is an integer and
+% FLAGS contains the sign and some other special cases.
+%
+% This method does NOT use TeX Registers to represent the numbers! The
+% computation is COMPLETELY STRING BASED.
+% This allows numbers such at 10000000 or 5.23e-10 to be represented
+% properly, although TeX-registers would produce overflow/underflow
+% errors in these cases.
+%
+% It is to be used to compute logs, because log(X*10^Y) = log(X) + log(10)*Y
+%
+% Arguments:
+% #1: an arbitrary number which shall be parsed. Maybe a macro.
+% Examples:
+% [+-]XXXXX.XXXXXX
+% [+-]XXXXX.XXXXXXeXXXX
+% [+-]0.0000XXXXXX
+% [+-]0.0000XXXXXXeXXXX
+% [+-]inf
+% nan
+% Maybe a macro containing such a number.
+%
+% Return value:
+% \pgfmathresult will be \def'ed to
+% FLAGS MANTISSE 'e' EXPONENT
+% where
+% FLAGS is a number in [0-5] where
+% 0 == '0' (the number is +- 0.0),
+% 1 == '+',
+% 2 == '-',
+% 3 == 'not a number'
+% 4 == '+ infinity'
+% 5 == '- infinity'
+%
+% MANTISSE is a normalised number 1 <= M < 10. It always contains a
+% period and at least one digit after the period.
+%
+% EXPONENT is an integer value.
+%
+% Example:
+% \pgfmathfloatparsenumber{1}
+% -> \pgfmathresult = 11.0e0
+% \pgfmathfloatparsenumber{141.212}
+% -> \pgfmathresult = 11.41212e2
+\def\pgfmathfloatparsenumber#1{%
+ \begingroup
+ \edef\pgfmathresult{#1}%
+ \expandafter\pgfflt@impl\pgfmathresult\pgfflt@EOI
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.0}%
+ \fi
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% The same as \pgfmathfloatparsenumber, but does not perform sanity checking.
+% FIXME: there is no longer any difference here.
+\let\pgfmathfloatqparsenumber=\pgfmathfloatparsenumber
+
+% Takes a floating point number #1 as input and writes flags to count
+% register #2, mantissa to dimen register #3 and exponent to count
+% register #4.
+\def\pgfmathfloattoregisters#1#2#3#4{%
+ \expandafter\pgfmathfloat@decompose#1\relax{#2}{#3}{#4}%
+}
+
+% the same, but writes the mantissa into a token register.
+\def\pgfmathfloattoregisterstok#1#2#3#4{%
+ \expandafter\pgfmathfloat@decompose@tok#1\relax{#2}{#3}{#4}%
+}
+
+% Extracts the flags of #1 into the count register #2.
+\def\pgfmathfloatgetflags#1#2{%
+ \expandafter\pgfmathfloat@decompose@F#1\relax{#2}%
+}
+% Extracts the flags of #1 into the macro #2.
+\def\pgfmathfloatgetflagstomacro#1#2{%
+ \expandafter\pgfmathfloat@decompose@Fmacro#1\relax{#2}%
+}%
+
+% Extracts the mantissa of #1 into the dimen register #2.
+\def\pgfmathfloatgetmantissa#1#2{%
+ \expandafter\pgfmathfloat@decompose@M#1\relax{#2}%
+}
+\let\pgfmathfloatgetmantisse=\pgfmathfloatgetmantissa
+% Extracts the mantissa of #1 into the token register #2.
+\def\pgfmathfloatgetmantissatok#1#2{%
+ \expandafter\pgfmathfloat@decompose@Mtok#1\relax{#2}%
+}
+\let\pgfmathfloatgetmantissetok=\pgfmathfloatgetmantissatok
+% Extracts the exponent of #1 into the count register #2.
+\def\pgfmathfloatgetexponent#1#2{%
+ \expandafter\pgfmathfloat@decompose@E#1\relax{#2}%
+}
+
+
+% Assigns \pgfmathresult to be a float encoded as
+% <FLAGS><MANTISSE>e<EXPONENT>
+%
+% example:
+% \pgfmathfloatcreate{1}{2.0}{10}
+% \pgfmathfloat@to@FMeE@style\pgfmathresult
+% ->
+% \pgfmathresult is now '12.0e10' regardless of the internal float
+% format.
+\def\pgfmathfloat@to@FMeE@style#1{\expandafter\pgfmathfloat@to@FMeE@style@#1\relax\relax}%
+\def\pgfmathfloat@to@FMeE@style@#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@to@FMeE@style@@%
+ \else
+ \expandafter\pgfmathfloat@to@FMeE@style@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@to@FMeE@style@@#1Y#2e#3]\relax\relax{\def\pgfmathresult{#1#2e#3}}%
+\def\pgfmathfloat@to@FMeE@style@error#1\relax\relax{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{%
+ \noexpand\pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ }%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+
+
+% decomposes a lowlevel floating point representation into flags,
+% mantissa and exponent.
+%
+% #4: integer register for the flags.
+% #5: dimen registers for the mantissa.
+% #6: integer register for the exponent.
+%
+% \expandafter\pgfmathfloat@decompose\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@M\pgfmathfloat@a@E
+% -> the three temp registers contain flags, mantissa and exponent
+\def\pgfmathfloat@decompose#1#2{% sanitize!
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@%
+ \else
+ \expandafter\pgfmathfloat@decompose@error%
+ \fi
+ #1#2%
+}
+\def\pgfmathfloat@decompose@#1Y#2e#3]\relax#4#5#6{%
+ #4=#1\relax
+ #5=#2pt % keep space here.
+ #6=#3\relax%
+}
+
+% overloaded, #5 needs to be a token register for the mantissa.
+% @see also \pgfmathfloatvalueof which does also employ the load
+% level repr.
+% \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+% -> the three temp registers contain flags, mantissa and exponent
+\def\pgfmathfloat@decompose@tok#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@tok@%
+ \else
+ \expandafter\pgfmathfloat@decompose@tok@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@tok@#1Y#2e#3]\relax#4#5#6{%
+ #4=#1\relax
+ #5={#2}%
+ #6=#3\relax%
+}
+% overloaded, returns only ONE of the three components into #4:
+% \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S
+% -> \pgfmathfloat@a@S contains the flags field.
+\def\pgfmathfloat@decompose@F#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@F@%
+ \else
+ \expandafter\pgfmathfloat@decompose@F@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@Fmacro#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@Fmacro@%
+ \else
+ \expandafter\pgfmathfloat@decompose@F@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@M#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@M@%
+ \else
+ \expandafter\pgfmathfloat@decompose@M@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@E#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@E@%
+ \else
+ \expandafter\pgfmathfloat@decompose@E@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@Mtok#1#2{%
+ \ifx#2Y%
+ \expandafter\pgfmathfloat@decompose@Mtok@%
+ \else
+ \expandafter\pgfmathfloat@decompose@Mtok@error%
+ \fi
+ #1#2%
+}%
+\def\pgfmathfloat@decompose@F@#1Y#2e#3]\relax#4{#4=#1\relax}%
+\def\pgfmathfloat@decompose@Fmacro@#1Y#2e#3]\relax#4{\def#4{#1}}%
+\def\pgfmathfloat@decompose@M@#1Y#2e#3]\relax#4{#4=#2pt}%
+\def\pgfmathfloat@decompose@Mtok@#1Y#2e#3]\relax#4{#4={#2}}%
+\def\pgfmathfloat@decompose@E@#1Y#2e#3]\relax#4{#4=#3\relax}%
+
+\def\pgfmathfloat@decompose@error#1\relax#2#3#4{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{%
+ \noexpand#2=\the\pgfmathfloat@a@S\space
+ \noexpand#3=\the\pgfmathfloat@a@Mtok pt
+ \noexpand#4=\the\pgfmathfloat@a@E\space
+ }%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+\def\pgfmathfloat@decompose@tok@error#1\relax#2#3#4{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{%
+ \noexpand#2=\the\pgfmathfloat@a@S\space
+ \noexpand#3={\the\pgfmathfloat@a@Mtok}%
+ \noexpand#4=\the\pgfmathfloat@a@E\space
+ }%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+\def\pgfmathfloat@decompose@F@error#1\relax#2{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{\noexpand#2=\the\pgfmathfloat@a@S\space}%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+\def\pgfmathfloat@decompose@M@error#1\relax#2{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{\noexpand#2=\the\pgfmathfloat@a@Mtok pt }%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+\def\pgfmathfloat@decompose@Mtok@error#1\relax#2{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{\noexpand#2={\the\pgfmathfloat@a@Mtok}}%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+\def\pgfmathfloat@decompose@E@error#1\relax#2{%
+ \begingroup
+ \pgfmathfloatparsenumber@handleerror{wrong lowlevel format}{#1}{#1}%
+ \xdef\pgfmathfloat@decompose@TMP{\noexpand#2=\the\pgfmathfloat@a@E\space}%
+ \endgroup
+ \pgfmathfloat@decompose@TMP
+}%
+% Takes a floating point number #1 as input and writes flags to macro
+% #2, mantissa to macro #3 and exponent to macro #4.
+\def\pgfmathfloattomacro#1#2#3#4{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \xdef\pgfmathfloat@glob@TMP{%
+ \noexpand\def\noexpand#2{\the\pgfmathfloat@a@S}%
+ \noexpand\def\noexpand#3{\the\pgfmathfloat@a@Mtok}%
+ \noexpand\def\noexpand#4{\the\pgfmathfloat@a@E}%
+ }%
+ \endgroup
+ \pgfmathfloat@glob@TMP
+}
+
+
+% Defines \pgfmathresult as the floating point number encoded by
+% the flags #1, mantissa #2 and exponent #3.
+%
+% All arguments are characters and will be expanded using '\edef'.
+\def\pgfmathfloatcreate#1#2#3{%
+ \edef\pgfmathresult{#1Y#2e#3]}%
+}%
+% This is the character present in any low-level floating point
+% number. It is assumed to be the SECOND character of a float (after
+% the flags integer).
+\def\pgfmathfloat@POSTFLAGSCHAR{Y}
+
+
+
+% Converts a composed floating point representation to fixed point.
+%
+% Example:
+% \pgfmathfloattofixed{142e1}
+% -> \pgfmathresult = 42.0
+\def\pgfmathfloattofixed@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ \def\pgfmathresult{0.0}%
+ \or
+ \expandafter\pgfmathfloattofixed@impl\the\pgfmathfloat@a@Mtok\relax
+ \or
+ \expandafter\pgfmathfloattofixed@impl\the\pgfmathfloat@a@Mtok\relax
+ \pgfmathfloat@a@Mtok=\expandafter{\pgfmathresult}%
+ \edef\pgfmathresult{-\the\pgfmathfloat@a@Mtok}%
+ \or\def\pgfmathresult{nan}%
+ \or\def\pgfmathresult{inf}%
+ \or\def\pgfmathresult{-inf}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloattofixed=\pgfmathfloattofixed@
+
+% Converts a float to an integer (in integer format).
+%
+% @see \pgfmathfloatint
+\def\pgfmathfloattoint#1{%
+ \pgfmathfloattofixed{#1}%
+ \expandafter\pgfmathfloattoint@@\pgfmathresult\relax
+}%
+\def\pgfmathfloattoint@@#1.#2\relax{%
+ \def\pgfmathresult{#1}%
+}%
+
+% Converts a floating point number to scientific format 1.234e5.
+%
+% This operation is very fast.
+\def\pgfmathfloattosci@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ \def\pgfmathresult{0.0e0}%
+ \or
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok e\the\pgfmathfloat@a@E}%
+ \or
+ \edef\pgfmathresult{-\the\pgfmathfloat@a@Mtok e\the\pgfmathfloat@a@E}%
+ \or\def\pgfmathresult{nan}%
+ \or\def\pgfmathresult{inf}%
+ \or\def\pgfmathresult{-inf}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\let\pgfmathfloattosci=\pgfmathfloattosci@
+
+% Expands a floating point number to scientific format 1.234e5.
+%
+% This operation is very fast.
+\def\pgfmathfloatvalueof#1{\expandafter\pgfmathfloatvalueof@@#1\relax}%
+\def\pgfmathfloatvalueof@@#1Y#2e#3]\relax{%
+ \ifcase#1 %
+ 0.0e0%
+ \or
+ #2e#3%
+ \or
+ -#2e#3%
+ \or nan%
+ \or inf%
+ \or -inf%
+ \fi
+}%
+
+
+% Rounds a fixed point number #1 to \pgfmathfloat@round@precision digits precision and returns
+% the result into \pgfmathresult.
+%
+% Any trailing zeros after the period are discarded.
+% See \pgfmathroundtozerofill if you want trailing zeros and fixed
+% width.
+%
+% This method is PURELY text based and can work with arbirtrary
+% precision (well, limited to TeX's stack size and integer size).
+%
+% Examples:
+% \pgfmathroundto{1}
+% -> \pgfmathresult = '1'
+%
+% \pgfmathroundto{19999.9996}
+% -> \pgfmathresult = '20000'
+%
+% Arguments:
+% #1 may be either a number or a macro (\pgfmathresult is allowed) expanding to a number.
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set.
+\def\pgfmathroundto#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodfalse
+ \pgfmathroundto@impl{#1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+
+% Overloaded method.
+%
+% This variant always uses a FIXED number behind the period and fills
+% in zeros if necessary.
+% Examples:
+% \pgfmathroundtozerofill{1}
+% -> \pgfmathresult = '1.00'
+%
+% \pgfmathroundtozerofill{19999.9996}
+% -> \pgfmathresult = '20000.00'
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set.
+\def\pgfmathroundtozerofill#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodtrue
+ \pgfmathroundto@impl{#1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% see \pgfmathprintnumber@fixed@style for docs
+\def\pgfmathprintnumber@fixed@styleDEFAULT#1#2#3e#4\relax{%
+ \begingroup
+ \pgfkeysgetvalue{/pgf/number format/set decimal separator}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP
+ \pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK
+ \pgfkeysgetvalue{/pgf/number format/set thousands separator}\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP
+ \c@pgf@counta=#4\relax
+ \ifnum#2=0
+ \c@pgf@counta=0
+ \fi
+ \def\pgfmathresult{}%
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@period#1\pgfmathfloat@EOI
+ \else
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI%
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@period#1.#2\pgfmathfloat@EOI{%
+ \ifpgfmathprintnumberskipzeroperiod
+ \def\pgfmathfloat@loc@TMPb{#1}%
+ \ifx\pgfmathfloatparsenumber@tok@ZERO\pgfmathfloat@loc@TMPb
+ \else
+ \def\pgfmathfloat@loc@TMPc{-0}%
+ \ifx\pgfmathfloat@loc@TMPc\pgfmathfloat@loc@TMPb
+ \def\pgfmathresult{-}%
+ \else
+ \def\pgfmathfloat@loc@TMPc{+0}%
+ \ifx\pgfmathfloat@loc@TMPc\pgfmathfloat@loc@TMPb
+ \def\pgfmathresult{+}%
+ \else
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ \fi
+ \fi
+ \fi
+ \else
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ \fi
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}%
+ \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP #2}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+}%
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod{%
+ \ifx\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP\pgfutil@empty
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}%
+ \else
+ \ifnum\c@pgf@counta<0\relax
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}%
+ \else
+ \ifnum\c@pgf@counta<\pgfkeysvalueof{/pgf/number format/min exponent for 1000 sep}\relax
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}%
+ \else
+ \advance\c@pgf@counta by1 % counta:= total number of digits, N.
+ \c@pgf@countb=\c@pgf@counta
+ \divide\c@pgf@countb by3 % countb := N DIV 3
+ \c@pgf@countc=\c@pgf@countb
+ \multiply\c@pgf@countc by3
+ \advance\c@pgf@counta by-\c@pgf@countc% now counta := N MOD 3
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printsign
+ }%
+ \fi
+ \fi
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printsign#1{%
+ \def\pgfmathfloat@loc@TMPb{#1}%
+ \ifx\pgfmathfloat@loc@TMPb\pgfmathfloatparsenumber@tok@MINUS
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+ \let\pgfmathfloat@loc@TMPb=\pgfutil@empty
+ \else
+ \ifx\pgfmathfloat@loc@TMPb\pgfmathfloatparsenumber@tok@PLUS
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+ \let\pgfmathfloat@loc@TMPb=\pgfutil@empty
+ \else
+ \ifpgfmathprintnumber@showpositive
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult +}%
+ \fi
+ \fi
+ \fi
+ \ifnum\c@pgf@counta>0
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits\pgfmathfloat@loc@TMPb
+ }%
+ \else
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird\pgfmathfloat@loc@TMPb
+ }%
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits#1#2{%
+ \ifcase\c@pgf@counta
+ \or
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird#2%
+ }%
+ \or
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1#2}%
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird%
+ }%
+ \fi
+ \ifnum\c@pgf@countb>0\relax
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird#1#2#3{%
+ \ifnum\c@pgf@countb>0\relax
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1#2#3}%
+ \advance\c@pgf@countb by-1
+ \ifnum\c@pgf@countb>0\relax
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+ \fi
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird%
+ }%
+ \else
+ % in thise case, #1#2#3 are expected to be
+ % \pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ %--------------------------------------------------
+ % \def\pgfmathfloat@loc@TMPb{\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI}%
+ % \def\pgfmathfloat@loc@TMPc{#1#2#3}%
+ % \ifx\pgfmathfloat@loc@TMPc\pgfmathfloat@loc@TMPb
+ % \else
+ % \pgfmath@error{INTERNAL ERROR in fixed style - The input sequence did not terminate as expected; which indicates a wrong exponent argument provided to \string\pgfmathprintnumber@fixed@style}{}%
+ % \fi
+ %--------------------------------------------------
+ \let\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT=\relax
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall#1{%
+ \def\pgfmathfloat@loc@TMPb{#1}%
+ \let\pgfmathfloat@loc@TMPc=\pgfutil@empty
+ \ifx\pgfmathfloat@loc@TMPb\pgfmathfloatparsenumber@tok@MINUS
+ \else
+ \ifx\pgfmathfloat@loc@TMPb\pgfmathfloatparsenumber@tok@PLUS
+ \else
+ \ifpgfmathprintnumber@showpositive
+ \def\pgfmathfloat@loc@TMPc{+}%
+ \fi
+ \fi
+ \fi
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall@\pgfmathfloat@loc@TMPc#1%
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall@#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI{%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+}%
+
+% @deprecated. It has been replaced by \pgfmathprintnumber@fixed@styleDEFAULT
+% #1 maybe a macro
+\def\pgfmathprintnumber@fixed@stylePERIOD#1#2#3e#4\relax{%
+ \def\pgfmathresult{#1}%
+}
+
+% @deprecated. It has been replaced by \pgfmathprintnumber@fixed@styleDEFAULT
+% #1 maybe a macro
+\def\pgfmathprintnumber@fixed@styleCOMMA#1#2#3e#4\relax{%
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathprintnumber@fixed@styleCOMMA@impl#1\pgfmathfloat@EOI
+ \else
+ \def\pgfmathresult{#1}%
+ \fi
+}
+\def\pgfmathprintnumber@fixed@styleCOMMA@impl#1.#2\pgfmathfloat@EOI{\def\pgfmathresult{#1{,}#2}}
+
+% The default style to display fixed point numbers.
+%
+% It does not apply numerics, but it is responsable to typeset the
+% rounded number.
+% It can access the \ifpgfmathfloatroundhasperiod boolean.
+%
+% Arguments:
+% #1#2#3e#4\relax
+
+% Input:
+% #1 the fixed point number to be displayed (maybe a macro).
+% #2#3e#4: the (possibly unformatted) floating point representation
+% which belongs to #1. This format is returned (only!) by
+% \pgfmathfloat@to@FMeE@style.
+% It is used to determine sign and exponent.
+\let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT
+
+
+% Rounds a normalized floating point number to \pgfmathfloat@round@precision
+% digits precision and writes the result to \pgfmathresult.
+%
+% This method uses \pgfmathroundto for the mantissa.
+%
+% @see pgfmathfloatroundzerofill
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to
+% whether the final mantissa #5 has a period or not.
+\def\pgfmathfloatround#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodfalse
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatround@impl
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% Overload.
+%
+% This method uses a fixed width for the mantissa and fills in zeros
+% if necessary.
+%
+% This method uses \pgfmathroundtozerofill for the mantissa.
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to
+% whether the final mantissa #5 has a period or not.
+\def\pgfmathfloatroundzerofill#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodtrue
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatround@impl
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\newif\ifpgfmathfloatround@allow@empty@mantissa
+\def\pgfmathfloatround@mantissa@ONE{1.0}%
+
+% #1: sign
+% #2: mantissa
+% #3: exponent
+% #4: CODE to display if the mantissa is drawn.
+% This code will be shown just before the exponent.
+% Example: #4=\cdot
+% #5: CODE to display if the mantissa is NOT draw. (unused currently)
+% Might be used to display '10^1' instead of '1*10^1'.
+% #6: CODE to display the exponent.
+\def\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax#4#5#6{%
+ \pgfkeysgetvalue{/pgf/number format/@sci exponent mark}\pgfmathfloatrounddisplaystyle@e@mark
+ \ifcase#1\relax
+ \pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}%
+ \or\pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}%
+ \or\pgfmathprintnumber@fixed@style{-#2}#1#2e0\relax%
+ \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}%
+ \or
+ \pgfmathfloatrounddisplaystyle@shared@impl@@{\hbox{NaN}}{}%
+ \or
+ \ifpgfmathprintnumber@showpositive
+ \pgfmathfloatrounddisplaystyle@shared@impl@@{+\infty}{}%
+ \else
+ \pgfmathfloatrounddisplaystyle@shared@impl@@{\infty}{}%
+ \fi
+ \or
+ \pgfmathfloatrounddisplaystyle@shared@impl@@{-\infty}{}%
+ \fi
+}
+
+% #1: the part before the exponent code
+% #2: the part for the exponent code.
+\def\pgfmathfloatrounddisplaystyle@shared@impl@#1#2{%
+ {\toks0={#1}%
+ \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+}%
+% Same as \pgfmathfloatrounddisplaystyle@shared@impl@, but it also
+% inserts the '@dec sep mark' at the end.
+\def\pgfmathfloatrounddisplaystyle@shared@impl@@#1#2{%
+ {\toks0={#1}%
+ \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}%
+ \pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK
+ \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}%
+ \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+}
+
+\def\pgfmathfloatrounddisplaystyle@std#1#2e#3\relax{%
+ \pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{\cdot}{}{10^{#3}}%
+}
+\def\pgfmathfloatrounddisplaystyle@subscript#1#2e#3\relax{%
+ \pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}{_{#3}}%
+}
+\def\pgfmathfloatrounddisplaystyle@superscript#1#2e#3\relax{%
+ \pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}{^{#3}}%
+}
+\def\pgfmathfloatrounddisplaystyle@e#1#2e#3\relax{%
+ \ifnum#3<0\relax
+ {\count0=#3\relax
+ \multiply\count0 by-1
+ \xdef\pgfmathfloat@glob@TMP{e{-}\the\count0}%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+ \else
+ \def\pgfmathresult{e{+}#3}%
+ \fi
+ \def\pgfmathfloat@loc@TMPb{\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}}%
+ \expandafter\pgfmathfloat@loc@TMPb\expandafter{\pgfmathresult}%
+}
+\def\pgfmathfloatrounddisplaystyle@E#1#2e#3\relax{%
+ \ifnum#3<0\relax
+ {\count0=#3\relax
+ \multiply\count0 by-1
+ \xdef\pgfmathfloat@glob@TMP{E{-}\the\count0}%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@glob@TMP
+ \else
+ \def\pgfmathresult{E{+}#3}%
+ \fi
+ \def\pgfmathfloat@loc@TMPb{\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}}%
+ \expandafter\pgfmathfloat@loc@TMPb\expandafter{\pgfmathresult}%
+}
+
+\def\pgfmathfloatrounddisplaystyle@generic#1#2e#3\relax{%
+ \begingroup
+ \pgfkeysvalueof {/pgf/number format/sci generic/@/.@cmd}{#3}{#1}{#2}\pgfeov
+ \pgfkeysgetvalue{/pgf/number format/sci generic/mantissa sep}\pgfmathdisplay@aftermantissa
+ \pgfkeysgetvalue{/pgf/number format/sci generic/empty mantissa sep}\pgfmathdisplay@nomantissa
+ \pgfkeysgetvalue{/pgf/number format/sci generic/exponent}\pgfmathdisplay@e
+ \toks0=\expandafter{\pgfmathdisplay@aftermantissa}%
+ \toks1=\expandafter{\pgfmathdisplay@nomantissa}%
+ \toks2=\expandafter{\pgfmathdisplay@e}%
+ \xdef\pgfmathfloat@glob@TMP{\noexpand\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\noexpand\relax{\the\toks0}{\the\toks1}{\the\toks2}}%
+ \endgroup
+ \pgfmathfloat@glob@TMP
+}
+
+% A macro which takes the argument '<SIGN><MANTISSE>e<EXPONENT>' and
+% expands to the final TeX-representation for that floating point
+% number.
+%
+% PRECONDITION:
+% the floating point number has already been rounded properly and
+% the mantissa has been rounded correcty.
+%
+% The argument needs to be in the format returned by
+% \pgfmathfloat@to@FMeE@style and terminated by '\relax'.
+\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std
+\newif\ifpgfmathfloat@usezerofill@sci
+\newif\ifpgfmathfloat@usezerofill@fixed
+\newif\ifpgfmathprintnumber@assumemathmode
+\newif\ifpgfmathprintnumber@showpositive
+\newif\ifpgfmathprintnumber@frac@warn
+\newif\ifpgfmathprintnumber@frac@whole
+
+\long\def\pgfmathfloatfrac@verbatim#1#2{#1/#2}%
+
+\pgfkeys{%
+ /pgf/number format/.is family,
+ /pgf/number format,
+ fixed/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED},
+ sci/.code= \pgfmath@set@number@printer{pgfmathprintnumber@SCI},
+ std/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@STD}\pgfmathprintnumber@STD@setparam{#1}},
+ std/.default=,%
+ int detect/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@DETECT},
+ int trunc/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@TRUNC},
+ frac/.code= \pgfmath@set@number@printer{pgfmathprintnumber@frac},%
+ frac TeX/.initial=\frac,
+ frac whole format/.code={\def\pgfmathresult{#1}},
+ frac denom/.initial=,
+ frac whole/.is if=pgfmathprintnumber@frac@whole,
+ frac whole=true,
+ frac shift/.initial=4,
+ frac warning/.is if=pgfmathprintnumber@frac@warn,
+ frac warning=true,
+ assume math mode/.is if=pgfmathprintnumber@assumemathmode,
+ assume math mode/.default=true,
+ fixed zerofill/.is if= pgfmathfloat@usezerofill@fixed,
+ fixed zerofill/.default=true,
+ sci zerofill/.is if= pgfmathfloat@usezerofill@sci,
+ sci zerofill/.default=true,
+ zerofill/.style= {/pgf/number format/fixed zerofill=#1,/pgf/number format/sci zerofill=#1},
+ zerofill/.default= true,
+ precision/.store in= \pgfmathfloat@round@precision,
+ sci precision/.code={%
+ \edef\pgfmathfloat@loc@TMPa{#1}%
+ \ifx\pgfmathfloat@loc@TMPa\pgfutil@empty
+ \def\pgfmathprintnumber@sci@precision{\pgfmathfloat@round@precision}%
+ \else
+ \let\pgfmathprintnumber@sci@precision=\pgfmathfloat@loc@TMPa
+ \fi
+ },%
+ sci precision/.default=,
+ sci precision=,
+ fixed default/.code= {\let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT},
+ set decimal separator/.initial=,
+ dec sep/.style={/pgf/number format/set decimal separator=#1},
+ @dec sep mark/.initial=,
+ @sci exponent mark/.initial=,
+ set thousands separator/.initial=,
+ 1000 sep/.style={/pgf/number format/set thousands separator=#1},
+ min exponent for 1000 sep/.initial=0,
+ use period/.style= {/pgf/number format/set decimal separator={.},/pgf/number format/set thousands separator={{{,}}}},
+ use comma/.style= {/pgf/number format/set decimal separator={{{,}}},/pgf/number format/set thousands separator={.}},
+ showpos/.is if=pgfmathprintnumber@showpositive,
+ showpos/.default=true,
+ print sign/.is if=pgfmathprintnumber@showpositive,
+ print sign/.default=true,
+ skip 0./.is if=pgfmathprintnumberskipzeroperiod,
+ skip 0./.default=true,
+ skip 0.= false,
+ use period,
+ sci 10^e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std},
+ sci 10e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std},
+ sci e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@e},
+ sci E/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@E},
+ sci subscript/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@subscript},
+ sci superscript/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@superscript},
+ sci generic/.code= {%
+ \let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@generic
+ \pgfkeysdefargs{/pgf/number format/sci generic/@}%
+ {##1##2##3}%
+ {\pgfqkeys{/pgf/number format/sci generic}{#1}}%
+ },
+ sci generic/mantissa sep/.initial=,%
+ sci generic/empty mantissa sep/.initial=,%
+ sci generic/mantisse sep/.style={/pgf/number format/sci generic/mantissa sep={#1}},%
+ sci generic/empty mantisse sep/.style={/pgf/number format/sci generic/empty mantissa sep={#1}},%
+ sci generic/exponent/.initial=,%
+ sci generic/.value required,
+ verbatim/.code={%
+ \pgfqkeys{/pgf/number format}{%
+ sci generic={mantissa sep=,exponent={e##1}},
+ 1000 sep=,
+ skip 0.=false,
+ print sign=false,
+ dec sep=.,
+ assume math mode,
+ frac TeX=\pgfmathfloatfrac@verbatim,
+ frac whole format/.code={\def\pgfmathresult{##1 }},
+ @dec sep mark=,
+ @sci exponent mark=,
+ }%
+ },
+% sci may skip mantissa/.is if=pgfmathfloatround@allow@empty@mantissa,
+% sci may skip mantissa/.default=true,
+}
+
+
+
+\def\pgfmathprintnumber@STD#1{%
+ % parse the input:
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathprintnumber@STD@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@STD@setparam#1{%
+ \edef\pgfmathfloat@loc@TMPb{#1}%
+ \ifx\pgfmathfloat@loc@TMPb\pgfutil@empty
+ % DEFAULT for lower and upper bound.
+ \def\pgfmathprintnumber@STD@getlowerbound{%
+ \c@pgf@counta=\pgfmathfloat@round@precision\relax
+ \divide\c@pgf@counta by-2\relax
+ }%
+ \def\pgfmathprintnumber@STD@upperbound{4}%
+ \else
+ \expandafter\pgfutil@in@\expandafter:\expandafter{\pgfmathfloat@loc@TMPb}%
+ \ifpgfutil@in@
+ % we have -4:5 or something like that.
+ % parse both values:
+ \def\pgfmathfloat@loc@TMPa##1:##2\relax{%
+ \edef\pgfmathprintnumber@STD@getlowerbound{%
+ \noexpand\c@pgf@counta=##1\space
+ }%
+ \edef\pgfmathprintnumber@STD@upperbound{##2}%
+ }%
+ \expandafter\pgfmathfloat@loc@TMPa\pgfmathfloat@loc@TMPb\relax
+ \else
+ % we have just the lower bound:
+ \def\pgfmathprintnumber@STD@upperbound{4}%
+ \edef\pgfmathprintnumber@STD@getlowerbound{%
+ \noexpand\c@pgf@counta=\pgfmathfloat@loc@TMPb\space
+ }%
+ \fi
+ \fi
+}%
+
+\def\pgfmathprintnumber@STD@issci#1#2e#3\relax{%
+ \expandafter\ifnum#1<3
+ \expandafter\ifnum#3>\pgfmathprintnumber@STD@upperbound\relax
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax%
+ \else
+ \begingroup
+ \pgfmathprintnumber@STD@getlowerbound
+ \ifnum#3<\c@pgf@counta
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax%
+ \else
+ \pgfmathprintnumber@FIXED@issci#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \fi
+ \else% nan or inf:
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+}
+
+\def\pgfmathprintnumber@frac#1{%
+ % parse the input:
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloatgetfrac{\pgfmathresult}%
+ \expandafter\pgfmathprintnumber@frac@formatresult\pgfmathresult
+}
+\def\pgfmathprintnumber@frac@issci#1#2e#3\relax{%
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \pgfmathfloatgetfrac{\pgfmathresult}%
+ \expandafter\pgfmathprintnumber@frac@formatresult\pgfmathresult
+}
+\def\pgfmathprintnumber@frac@formatresult#1#2#3{%
+ \begingroup
+ \pgfkeysgetvalue{/pgf/number format/frac TeX}\pgfmathresult
+ \toks0=\expandafter{\pgfmathresult}%
+ \def\pgfmathfloat@loc@TMPa{#1}%
+ \ifx\pgfmathfloat@loc@TMPa\pgfutil@empty
+ \ifpgfmathprintnumber@showpositive
+ \def\pgfmathfloat@loc@TMPa{+}%
+ \fi
+ \else
+ \ifx\pgfmathfloat@loc@TMPa-%
+ \else
+ \ifx\pgfmathfloat@loc@TMPa+%
+ \else
+ \ifpgfmathprintnumber@showpositive
+ \edef\pgfmathfloat@loc@TMPa{+\pgfmathfloat@loc@TMPa}%
+ \fi
+ \def\pgfmathfloat@loc@TMPb{\pgfkeysvalueof{/pgf/number format/frac whole format/.@cmd}}%
+ \expandafter\pgfmathfloat@loc@TMPb\pgfmathfloat@loc@TMPa\pgfeov
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \fi
+ \fi
+ \fi
+ \toks1=\expandafter{\pgfmathfloat@loc@TMPa}%
+ \edef\pgfmathresult{%
+ \the\toks1 \ifnum#2=0 \else\the\toks0 {#2}{#3}\fi%
+ }%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% Defines \pgfmathresult to contain three sets of braces containing
+% the sign (optionally containing any components >1), the numerator and the denominator for #1.
+%
+% \pgfmathfloatgetfrac{0.5} -> \pgfmathresult contains {}{1}{2}
+% \pgfmathfloatgetfrac{-0.5} -> \pgfmathresult contains {-}{1}{2}
+% \pgfmathfloatgetfrac{1.5} -> \pgfmathresult contains {1}{1}{2}
+%
+% special cases:
+% \pgfmathfloatgetfrac{0} -> \pgfmathresult contains {0}{0}{1}
+% \pgfmathfloatgetfrac{1} -> \pgfmathresult contains {1}{0}{1}
+%
+% The numerator and denominator is always a number (not empty)
+\def\pgfmathfloatgetfrac#1{%
+ \pgfutil@ifundefined{pgfmathfloatmultiply@}{%
+ \PackageError{tikz}{Sorry, the number format 'frac' requires '\string\usetikzlibrary{fpu}' (and, optionally, \string\usepackage{fp}) in order to work correctly}{}%
+ \edef\pgfmathresult{{#1}{0}{1}}%
+ }{%
+ \pgfmathfloatgetfrac@{#1}%
+ }%
+}%
+\def\pgfmathfloatgetfrac@#1{%
+ \begingroup
+ \edef\pgfmathfloat@arg{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathfloat@arg\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \def\pgfmathfloat@loc@TMPa{0}%
+ \ifcase\pgfmathfloat@a@S
+ % #1 = 0:
+ \def\pgfmathresult{{0}{0}{1}}%
+ \or% #1 > 0
+ \pgfmathfloat@a@S=1
+ \def\pgfmathfloat@loc@TMPa{1}%
+ \or% #1 < 0
+ \pgfmathfloat@a@S=-1
+ \def\pgfmathfloat@loc@TMPa{1}%
+ \or
+ \edef\pgfmathresult{{}{NaN}{1}}%
+ \or
+ \edef\pgfmathresult{{}{\infty}{1}}%
+ \or
+ \edef\pgfmathresult{{-}{\infty}{1}}%
+ \fi
+ \if1\pgfmathfloat@loc@TMPa
+ \ifnum\pgfmathfloat@a@E<0
+ \def\pgfmathfloat@wholenumber{}%
+ \else
+ \pgfmathfloatcreate{1}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \pgfmathfloattofixed\pgfmathresult%
+ \def\pgfmathfloat@loc@TMPa##1.##2\relax{%
+ \def\pgfmathfloat@wholenumber{##1}%
+ \pgfmathfloatparsenumber{0.##2}%
+ }%
+ \expandafter\pgfmathfloat@loc@TMPa\pgfmathresult\relax
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \fi
+ %
+ \def\pgfmathfloat@loc@TMPa##1.##2\relax{%
+ \def\pgfmathfloat@mantissa@first{##1}%
+ \def\pgfmathfloat@mantissa@ltone{0.##2}%
+ }%
+ \expandafter\pgfmathfloat@loc@TMPa\the\pgfmathfloat@a@Mtok\relax
+ %
+ \def\pgfmathfloat@loc@@to@int##1.##2\relax##3{%
+ ##3=##1
+ \ifdim0.##2pt>0.5pt
+ \advance##3 by1
+ \fi
+ }%
+ %
+ % alias registers names:
+ \let\pgfmathresultnumerator=\pgfmathfloat@b@S
+ \let\pgfmathresultdenom=\pgfmathfloat@b@E
+ %
+ \pgfkeysgetvalue{/pgf/number format/frac denom}\pgfmath@target@denominator
+ \ifx\pgfmath@target@denominator\pgfutil@empty
+ %
+ \pgfmathfloat@a@E=-\pgfmathfloat@a@E
+ \ifdim\pgfmathfloat@mantissa@ltone pt=0pt
+ \def\pgfmathfloat@factor{1}%
+ \edef\pgfmathfloat@scaled@numerator{\the\pgfmathfloat@a@Mtok}%
+ \else
+ % FIXME : this here is numerically instable.
+ %
+ % The errors of 1/r are magnified by 10^k which
+ % doesn't work.
+ \pgfutil@ifundefined{FPdiv}{%
+ \pgfmathfloatparsenumber{\pgfmathfloat@mantissa@ltone}%
+ \pgfmathfloatreciprocal@{\pgfmathresult}%
+ }{%
+ % \usepackage{fp}.
+ % yields higher absolute precision.
+ \FPmessagesfalse%
+ \FPdebugfalse%
+ \FPdiv\pgfmathresult{1}{\pgfmathfloat@mantissa@ltone}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ }%
+ \let\pgfmathfloat@inv=\pgfmathresult
+ \pgfmathfloatcreate{1}{1.0}{\pgfkeysvalueof{/pgf/number format/frac shift}}%
+ \let\pgfmathfloat@scalebaseten=\pgfmathresult
+ \pgfmathfloatmultiply@{\pgfmathfloat@inv}{\pgfmathfloat@scalebaseten}%
+ \let\pgfmathfloat@factor=\pgfmathresult
+ %
+ \expandafter\pgfmathfloatparsenumber\expandafter{\the\pgfmathfloat@a@Mtok}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloatmultiply@{\pgfmathfloat@factor}{\pgfmathfloat@loc@TMPa}%
+ \pgfmathfloattofixed\pgfmathresult
+ \let\pgfmathfloat@scaled@numerator=\pgfmathresult
+ %
+ \pgfmathfloattofixed\pgfmathfloat@factor
+ \expandafter\pgfmathfloat@loc@@to@int\pgfmathresult\relax{\pgfmathfloat@b@S}%
+ \edef\pgfmathfloat@factor{\the\pgfmathfloat@b@S}%
+ \fi
+ %
+ %
+ \pgfmathresultdenom=\pgfmathfloat@factor\relax
+ \pgfmathfloat@multiply@ten@to@the@E\pgfmathresultdenom
+ %
+ \expandafter\pgfmathfloat@loc@@to@int\pgfmathfloat@scaled@numerator\relax{\pgfmathresultnumerator}%
+ %\message{scale = \pgfmathfloat@factor; Z = \the\pgfmathresultnumerator\space ( von \pgfmathfloat@scaled@numerator), N = \the\pgfmathresultdenom.}%
+ %
+ \pgfmathgreatestcommondivisor{\pgfmathresultnumerator}{\pgfmathresultdenom}%
+ \divide\pgfmathresultnumerator by\pgfmathresult\relax
+ \divide\pgfmathresultdenom by\pgfmathresult\relax
+ \ifpgfmathprintnumber@frac@warn
+ \ifnum\pgfmathresultdenom>1000
+ \pgfutil@ifundefined{FPdiv}{%
+ \pgfmathfloattosci@\pgfmathfloat@arg
+ \immediate\write16{! Package pgf /pgf/number format/frac warning=true: /pgf/number format/frac of `\pgfmathresult' = \the\pgfmathresultnumerator\space / \the\pgfmathresultdenom\space might be large due to instabilities. Try \string\usepackage{fp} to improve accuracy.}%
+ }{}%
+ \fi
+ \fi
+ \else
+ % use target denominator:
+ \pgfmathresultdenom=\pgfmath@target@denominator\relax
+ \pgfmathfloatcreate{1}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \pgfmathfloattofixed\pgfmathresult
+ \pgf@xa=\pgfmathresult pt
+ \multiply\pgf@xa by\pgfmathresultdenom
+ \edef\pgfmathfloat@scaled@numerator{\pgf@sys@tonumber\pgf@xa}%
+ \expandafter\pgfmathfloat@loc@@to@int\pgfmathfloat@scaled@numerator\relax{\pgfmathresultnumerator}%
+ \fi
+ \ifpgfmathprintnumber@frac@whole
+ \else
+ \ifx\pgfmathfloat@wholenumber\pgfutil@empty
+ \else
+ \count0=\pgfmathfloat@wholenumber\relax
+ \multiply\count0 by\pgfmathresultdenom
+ \advance\pgfmathresultnumerator by\count0
+ \def\pgfmathfloat@wholenumber{}%
+ \fi
+ \fi
+ \ifnum\pgfmathfloat@a@S<0
+ \edef\pgfmathresult{{-\pgfmathfloat@wholenumber}{\the\pgfmathresultnumerator}{\the\pgfmathresultdenom}}%
+ \else
+ \edef\pgfmathresult{{\pgfmathfloat@wholenumber}{\the\pgfmathresultnumerator}{\the\pgfmathresultdenom}}%
+ \fi
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfmathfloat@gobble@until@relax#1\relax{}
+
+% computes the greatest common divisor of two integer numbers (in
+% integer arithmetics).
+\def\pgfmathgreatestcommondivisor#1#2{%
+ \begingroup
+ \count0=#1\relax
+ \count1=#2\relax
+ \ifnum\count0=0
+ \edef\pgfmathresult{\the\count1}%
+ \else
+ \pgfmathgreatestcommondivisor@loop
+ \edef\pgfmathresult{\the\count0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\def\pgfmathgreatestcommondivisor@loop{%
+ \ifnum\count1=0
+ \else
+ \ifnum\count0>\count1
+ \advance\count0 by-\count1
+ \else
+ \advance\count1 by-\count0
+ \fi
+ \expandafter\pgfmathgreatestcommondivisor@loop
+ \fi
+}%
+
+% multiplies a TeX register by 10^E where E is stored in the register
+% \pgfmathfloat@a@E (and it should be positive!)%
+%
+% #1 a TeX register
+\def\pgfmathfloat@multiply@ten@to@the@E#1{%
+ \ifnum\pgfmathfloat@a@E>0
+ \multiply#1 by10
+ \advance\pgfmathfloat@a@E by-1
+ \def\pgfmathfloat@multiply@ten@to@the@E@next{\pgfmathfloat@multiply@ten@to@the@E{#1}}%
+ \else
+ \let\pgfmathfloat@multiply@ten@to@the@E@next=\relax%
+ \fi
+ \pgfmathfloat@multiply@ten@to@the@E@next
+}%
+
+\def\pgfmathprintnumber@INT@TRUNC#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathprintnumber@INT@TRUNC@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@INT@TRUNC@impl#1.#2\relax#3#4e#5\relax{%
+ \pgfmathfloatroundhasperiodfalse
+ \pgfmathprintnumber@fixed@style{#1}#3#4e#5\relax%
+}
+\def\pgfmathprintnumber@INT@TRUNC@issci#1#2e#3\relax{%
+ \ifnum#1<3\relax
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \expandafter\pgfmathprintnumber@INT@TRUNC@impl\pgfmathresult\relax#1#2e#3\relax
+ \else
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+}
+
+% Invokes '#2' if '#1' is actually an integer or '#3' if not.
+%
+% As a side--effect, \pgfretval will be set to the integer value if it
+% actually *is* an integer. Otherwise, \pgfretval will contain the
+% parsed floating point number.
+%
+% #1 a number constant (not necessarily a parsed float).
+\def\pgfmathifisint#1#2#3{%
+ \gdef\pgfmathfloatisint@@{0}%
+ \begingroup
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfretval\pgfmathresult
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathfloatisint@\pgfmathresult\relax
+ \pgfmath@smuggleone\pgfretval
+ \endgroup
+ \if1\pgfmathfloatisint@@ #2\else #3\fi
+}%
+\def\pgfmathfloatisint@#1#2e#3\relax{%
+ \ifnum#1<3\relax
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \def\pgfmathfloat@round@precision{6}%
+ \expandafter\pgfmathroundto\expandafter{\pgfmathresult}%
+ \ifpgfmathfloatroundhasperiod
+ \else
+ \let\pgfretval\pgfmathresult%
+ \gdef\pgfmathfloatisint@@{1}%
+ \fi
+ \fi
+}
+
+\def\pgfmathprintnumber@INT@DETECT#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathprintnumber@INT@DETECT@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@INT@DETECT@issci#1#2e#3\relax{%
+ \begingroup
+ \ifnum#1<3\relax
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \let\pgfmathfloat@round@precision@=\pgfmathfloat@round@precision
+ \def\pgfmathfloat@round@precision{6}%
+ \expandafter\pgfmathroundto\expandafter{\pgfmathresult}%
+ \let\pgfmathfloat@round@precision=\pgfmathfloat@round@precision@
+ \ifpgfmathfloatroundhasperiod
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax
+ \else
+ \expandafter\pgfmathprintnumber@fixed@style\expandafter{\pgfmathresult}#1#2e#3\relax
+ \fi
+ \else
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\def\pgfmathprintnumber@FIXED#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathprintnumber@FIXED@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@FIXED@issci#1#2e#3\relax{%
+ \begingroup
+ \ifnum#1<3
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \ifpgfmathfloat@usezerofill@fixed
+ \expandafter\pgfmathroundtozerofill\expandafter{\pgfmathresult}%
+ \else
+ \expandafter\pgfmathroundto\expandafter{\pgfmathresult}%
+ \fi
+ \ifpgfmathfloatroundmayneedrenormalize
+ \pgfmathfloat@a@E=#3\relax
+ \advance\pgfmathfloat@a@E by1
+ \edef\pgfmathfloat@loc@TMPb{\noexpand\pgfmathprintnumber@fixed@style{\pgfmathresult}#1#2e\the\pgfmathfloat@a@E}%
+ \pgfmathfloat@loc@TMPb\relax%
+ \else
+ \expandafter\pgfmathprintnumber@fixed@style\expandafter{\pgfmathresult}#1#2e#3\relax%
+ \fi
+ \else% nan or inf:
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+
+\def\pgfmathprintnumber@SCI#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathprintnumber@SCI@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@SCI@issci#1#2e#3\relax{%
+ \begingroup
+ \pgfmathfloatcreate{#1}{#2}{#3}%
+ \edef\pgfmathfloat@round@precision{\pgfmathprintnumber@sci@precision}%
+ \ifpgfmathfloat@usezerofill@sci
+ \pgfmathfloatroundzerofill{\pgfmathresult}%
+ \else
+ \pgfmathfloatround{\pgfmathresult}%
+ \fi
+ \pgfmathfloat@to@FMeE@style\pgfmathresult
+ \expandafter\pgfmathfloatrounddisplaystyle\pgfmathresult\relax
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% Prints argument #1 using the current pretty printer environment (all
+% variables in /pgf/number format).
+%
+% You may specify optional arguments with \pgfmathprintnumber[...].
+\def\pgfmathprintnumber{%
+ % \protect allows to supply \pgfmathprintnumber inside of latex
+ % captions. The \csname yields \relax in case protect is undefined.
+ \pgf@texdist@protect\pgfmathprintnumber@protected
+}%
+\def\pgfmathprintnumber@protected{%
+ \pgfutil@ifnextchar[%
+ {\pgfmathprintnumber@OPT}%
+ {\pgfmathprintnumber@noopt}%
+}
+
+\def\pgfmathprintnumber@noopt#1{%
+ \pgfmathprintnumber@{#1}%
+ \ifpgfmathprintnumber@assumemathmode
+ \pgfmathresult
+ \else
+ \pgfutilensuremath{\pgfmathresult}%
+ \fi
+}%
+\def\pgfmathprintnumber@OPT[#1]#2{%
+ \begingroup
+ \pgfqkeys{/pgf/number format}{#1}%
+ \pgfmathprintnumber@{#2}%
+ \ifpgfmathprintnumber@assumemathmode
+ \pgfmathresult
+ \else
+ \pgfutilensuremath{\pgfmathresult}%
+ \fi
+ \endgroup
+}%
+
+% As \pgfmathprintnumber, but it produces its output into the second
+% argument.
+\def\pgfmathprintnumberto{%
+ \pgfutil@ifnextchar[%
+ {\pgfmathprintnumberto@OPT}%
+ {\pgfmathprintnumberto@noopt}%
+}
+
+\def\pgfmathprintnumberto@noopt#1#2{%
+ \begingroup
+ \pgfmathprintnumber@{#1}%
+ \ifpgfmathprintnumber@assumemathmode
+ \global\let\pgfmathfloat@glob@TMP=\pgfmathresult
+ \else
+ \toks0=\expandafter{\pgfmathresult}%
+ \xdef\pgfmathfloat@glob@TMP{\noexpand\pgfutilensuremath{\the\toks0 }}%
+ \fi
+ \endgroup
+ \let#2=\pgfmathfloat@glob@TMP
+}%
+\def\pgfmathprintnumberto@OPT[#1]#2#3{%
+ \begingroup
+ \pgfqkeys{/pgf/number format}{#1}%
+ \pgfmathprintnumber@{#2}%
+ \ifpgfmathprintnumber@assumemathmode
+ \global\let\pgfmathfloat@glob@TMP=\pgfmathresult
+ \else
+ \toks0=\expandafter{\pgfmathresult}%
+ \xdef\pgfmathfloat@glob@TMP{\noexpand\pgfutilensuremath{\the\toks0 }}%
+ \fi
+ \endgroup
+ \let#3=\pgfmathfloat@glob@TMP
+}%
+
+
+% Changes the current number pretty printer to #1.
+%
+% #1 is the macro base name for the pretty print routine, without the
+% leading '\'.
+\def\pgfmath@set@number@printer#1{%
+ \expandafter\let\expandafter\pgfmathprintnumber@\csname #1\endcsname
+ \expandafter\let\expandafter\pgfmathprintnumber@issci\csname #1@issci\endcsname
+}
+
+\pgfkeys{/pgf/number format/std}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% IMPL
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% equals only itsself when compared with \ifx:
+\def\pgfmathfloat@EOI{\pgfmathfloat@EOI}%
+
+% Re-use counters internally.
+%
+% They are always grouped and only used inside of the rounding
+% routines.
+\let\c@pgfmathroundto@prec=\pgfmathfloat@b@S% ATTENTION: DOUBLE-USED REGISTERS!
+\let\c@pgfmathroundto@offsetbehindperiod=\pgfmathfloat@b@E
+\newcount\c@pgfmathroundto@lastzeros
+
+\newif\ifpgfmathround@impl@PREPERIOD@is@negative@zero
+
+% PRECONDITION:
+% \ifpgfmathfloatroundhasperiod=\iftrue holds outside of the
+% current TeX group.
+%
+% POSTCONDITION:
+% \ifpgfmathfloatroundhasperiod will be set correctly AFTER the
+% current TeX group.
+% \ifpgfmathfloatroundmayneedrenormalize will be set globally
+\def\pgfmathroundto@impl#1{%
+ \edef\pgfmathround@input{#1}%
+ \global\pgfmathfloatroundmayneedrenormalizefalse
+ \pgfmathfloat@tmptoks={}%
+ \let\pgfmathround@next=\pgfutil@empty
+ \let\pgfmathround@cur=\pgfutil@empty
+ \let\pgfmathresult=\pgfutil@empty
+ \expandafter\c@pgfmathroundto@prec\pgfmathfloat@round@precision\relax
+ \c@pgfmathroundto@lastzeros=0
+ \c@pgfmathroundto@offsetbehindperiod=-1 % means: no period found so far
+ \pgfmathround@impl@PREPERIOD@is@negative@zerotrue
+ \expandafter\pgfmathroundto@impl@ITERATE@NODOT@firstcall\pgfmathround@input\pgfmathfloat@EOI
+}
+
+% \pgfmathroundto implementation in WORDS:
+%
+% coarse idea:
+% 1. collect all digits/sign BEFORE the first period in REVERSE order
+% 2. then, collect UP TO \prec digits after the period in REVERSE order
+% Steps 1. and 2. lead to the digit [sign] sequence
+% "x_{-p} x_{-p+1} ... x_{-2} x_{-1} '.' x_0 ... x_r"
+% where 'r' is the total number of digits. The integer 'p' denotes the
+% ACTUALLY collected number of digits behind the period.
+%
+% Let 'k' be the desired precision.
+%
+% Please note that pgfmathroundto rounds the mantissa, that means |abs(x)|.
+%
+% There are exactly TWO cases:
+% 1. The case with p<=k and x_{-p-1} = end of input.
+% 2. The case with p=k and x_{-p-1} is a further, next character.
+%
+% Then, for case 1.):
+% discard any unused zeros at the tail of our number (possibly
+% including the period)
+%
+% and in case 2.)
+% if NEXT DIGIT < 5:
+% do exactly the same as in case 1.) above and discard any
+% following digits.
+% else
+% let q := -p
+% while(x_q = 9 and q<=r )
+% if q>=0
+% set x_q = '0'
+% else
+% discard digit x_q='9'
+% fi
+% ++q
+% if q=0
+% discard the period
+% fi
+% end while
+% if q = r+1
+% insert a '1'
+% else
+% set x_q = x_q + 1
+% fi
+% fi
+%
+% All these loops have been implemented in spaghetti-code below.
+% Sorry, I fear its hard to understand. In principle, everything is
+% realised using more or less finite state machines (with some number
+% counting logic).
+%
+% Some comments:
+% - The token register \pgfmathfloat@tmptoks is used to accumulate the REVERSED input number.
+% - \pgfmathfloat@EOI always denotes 'END OF INPUT'.
+% - in the second stage, we need to reverse \pgfmathfloat@tmptoks.
+% This is -again- done with \pgfmathfloat@tmptoks.
+
+\def\pgfmathroundto@impl@discard@period#1.#2\pgfmathfloat@EOI{%
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \def\pgfmathresult{#1}%
+}
+
+\def\pgfmathroundto@impl@gobble@rest@and@start#1\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl@start
+}
+\def\pgfmathroundto@impl@gobble@and@start\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl@start
+}
+\def\pgfmathroundto@impl@gobble\pgfmathfloat@EOI{}%
+\def\pgfmathroundto@impl@gobble@rest#1\pgfmathfloat@EOI{}%
+
+% This method will be invoked as soon as the first step, the reverse
+% collection of up to PREC digits after the period, has finished.
+\def\pgfmathroundto@impl@start{%
+ \ifx\pgfmathround@next\pgfutil@empty
+ \ifnum\c@pgfmathroundto@offsetbehindperiod<0
+ % no period found.
+ \ifpgfmathfloat@fixed@digits@after@period
+ \ifnum\c@pgfmathroundto@prec=0\relax
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \edef\pgfmathresult{\pgfmathround@input}%
+ \else
+ \pgfmathfloat@tmptoks=\expandafter{\pgfmathround@input.}%
+ \c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \pgfmathroundto@impl@append@zeros
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \fi
+ \else
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \edef\pgfmathresult{\pgfmathround@input}%
+ \fi
+ \else
+ %\ifnum\c@pgfmathroundto@offsetbehindperiod>\c@pgfmathroundto@prec
+ % \pgfmath@error{Internal logic error in pgfmathroundto at [I] - should not have happened!?}{}%
+ %\fi
+ \pgfmathroundto@impl@finish@with@truncation
+ \fi
+ \else
+ %\ifnum\c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ %\else
+ % \pgfmath@error{Internal logic error in pgfmathroundto at [II] - should not have happened!? I have offsetbehindperiod=\the\c@pgfmathroundto@offsetbehindperiod and prec = \the\c@pgfmathroundto@prec}{}%
+ %\fi
+ \expandafter\ifnum\pgfmathround@next<5\relax
+ \pgfmathroundto@impl@finish@with@truncation
+ \else
+ \multiply\c@pgfmathroundto@offsetbehindperiod by-1
+ \expandafter\pgfmathroundto@impl@ADD@ONE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+}
+
+% takes the current input and decides whether trailing zeros shall be
+% discarded or more zeros need to be filled in.
+\def\pgfmathroundto@impl@finish@with@truncation{%
+ \ifpgfmathfloat@fixed@digits@after@period
+ \expandafter\pgfmathroundto@impl@REVERSE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \ifnum\c@pgfmathroundto@lastzeros=\c@pgfmathroundto@offsetbehindperiod
+ \ifpgfmathround@impl@PREPERIOD@is@negative@zero
+ % write '0.0000' instead of '-0.0000':
+ \expandafter\pgfmathroundto@impl@discard@minus\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+ \ifnum\c@pgfmathroundto@prec=0\relax
+ \expandafter\pgfmathroundto@impl@discard@period\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \else
+ \advance\c@pgfmathroundto@prec by-\c@pgfmathroundto@offsetbehindperiod
+ \c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \pgfmathroundto@impl@append@zeros
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \fi
+ \else
+ \pgfmathroundto@impl@discard@suffix@zeros
+ \fi
+}
+
+\def\pgfmathroundto@impl@discard@minus-#1\pgfmathfloat@EOI{\pgfmathfloat@tmptoks={#1}}%
+
+% appends \c@pgfmathroundto@offsetbehindperiod zeros at the end of \pgfmathfloat@tmptoks.
+\def\pgfmathroundto@impl@append@zeros{%
+ \ifnum\c@pgfmathroundto@offsetbehindperiod>0
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \advance\c@pgfmathroundto@offsetbehindperiod by-1
+ \pgfmathroundto@impl@append@zeros
+ \fi
+}
+
+\def\pgfmathroundto@impl@ADD@ONE{%
+ \pgfmathfloat@tmptoks={}% no longer needed because its old value will be read from input
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+\def\pgfmathroundto@impl@ADD@ONE@ITERATE{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble
+ }{%
+ \pgfutil@ifnextchar.{%
+ \ifnum\c@pgfmathroundto@prec=0
+ % silently discard period in special case precision=0
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@NEXT@COLLECT}%
+ \fi
+ \pgfmathround@nextcmd
+ }{%
+ \pgfutil@ifnextchar+{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble@rest
+ }{%
+ \pgfutil@ifnextchar-{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{-1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble@rest
+ }{%
+ \pgfmathroundto@impl@ADD@ONE@NEXT
+ }%
+ }%
+ }%
+ }%
+}
+
+\def\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot.{%
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+
+\def\pgfmathroundto@impl@ADD@ONE@NEXT@COLLECT#1{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+\def\pgfmathroundto@impl@ADD@ONE@NEXT#1{%
+ \ifnum#1=9
+ \ifnum\c@pgfmathroundto@offsetbehindperiod<0
+ \ifpgfmathfloat@fixed@digits@after@period
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter0\the\pgfmathfloat@tmptoks}%
+ \else
+ % silently DROP digit
+ \fi
+ \else
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter0\the\pgfmathfloat@tmptoks}%
+ \fi
+ \advance\c@pgfmathroundto@offsetbehindperiod by1
+ \ifnum\c@pgfmathroundto@offsetbehindperiod=0
+ \ifpgfmathfloat@fixed@digits@after@period
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot}%
+ \fi
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE}%
+ \fi
+ \else
+ % re-use this counter:
+ \c@pgfmathroundto@lastzeros=#1
+ \advance\c@pgfmathroundto@lastzeros by1
+ \edef\pgfmathresult{\the\c@pgfmathroundto@lastzeros\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks=\expandafter{\pgfmathresult}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@REVERSE@ITERATE}%
+ \fi
+ \pgfmathround@nextcmd
+}
+
+
+\def\pgfmathroundto@impl@discard@suffix@zeros{%
+ \ifnum\c@pgfmathroundto@lastzeros=\c@pgfmathroundto@offsetbehindperiod
+ \ifpgfmathround@impl@PREPERIOD@is@negative@zero
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \def\pgfmathresult{0}% write '0' instead of '-0'
+ \else
+ \expandafter\pgfmathroundto@impl@discard@period\pgfmathround@input\pgfmathfloat@EOI
+ \fi
+ \else
+ \ifnum\c@pgfmathroundto@lastzeros=0
+ \expandafter\pgfmathroundto@impl@REVERSE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \else
+ \expandafter\pgfmathroundto@impl@discard@suffix@zeros@ITERATE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+}
+
+% PRECONDITION:
+% \c@pgfmathroundto@lastzeros > 0
+\def\pgfmathroundto@impl@discard@suffix@zeros@ITERATE#1{%
+ \advance\c@pgfmathroundto@lastzeros by-1
+ \ifnum\c@pgfmathroundto@lastzeros=0
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@REVERSE}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@discard@suffix@zeros@ITERATE}%
+ \fi
+ \pgfmathround@nextcmd
+}
+
+% Usage:
+% \pgfmathroundto@impl@REVERSE#1\pgfmathfloat@EOI
+% -> writes #1 reversed into \pgfmathfloat@tmptoks
+\def\pgfmathroundto@impl@REVERSE{%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathroundto@impl@REVERSE@ITERATE
+}
+
+\def\pgfmathroundto@impl@REVERSE@ITERATE{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble
+ }{%
+ \pgfmathroundto@impl@REVERSE@NEXT
+ }%
+}
+
+\def\pgfmathroundto@impl@REVERSE@NEXT#1{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@REVERSE@ITERATE
+}
+
+\def\pgfmathroundto@impl@BEGIN@DOT.{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter.\the\pgfmathfloat@tmptoks}%
+ \c@pgfmathroundto@offsetbehindperiod=0
+ \pgfmathroundto@impl@ITERATE@DOT
+}
+\def\pgfmathroundto@impl@ITERATE@DOT{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ % finished.
+ \pgfmathroundto@impl@gobble@and@start
+ }{%
+ \pgfmathroundto@impl@NEXT@DOT
+ }%
+}
+\def\pgfmathroundto@impl@NEXT@DOT#1{%
+ \ifnum\c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \def\pgfmathround@next{#1}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@gobble@rest@and@start}%
+ \else
+ \advance\c@pgfmathroundto@offsetbehindperiod by1
+ \ifnum#1=0
+ \advance\c@pgfmathroundto@lastzeros by1
+ \else
+ \c@pgfmathroundto@lastzeros=0
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@DOT}%
+ \fi
+ \pgfmathround@nextcmd
+}%
+
+% in contrast to pgfmathroundto@impl@ITERATE@NODOT, this method here
+% checks also for signs
+\def\pgfmathroundto@impl@ITERATE@NODOT@firstcall#1{%
+ \def\pgfmathround@cur{#1}%
+ \ifx\pgfmathround@cur\pgfmathfloat@EOI
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@start}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@PERIOD
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@BEGIN@DOT.}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@MINUS
+ \else
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@NODOT}%
+ \fi
+ \fi
+ \pgfmathround@nextcmd
+}
+
+\def\pgfmathroundto@impl@ITERATE@NODOT#1{%
+ \def\pgfmathround@cur{#1}%
+ \ifx\pgfmathround@cur\pgfmathfloat@EOI
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@start}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@PERIOD
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@BEGIN@DOT.}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@ZERO
+ \else
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@NODOT}%
+ \fi
+ \fi
+ \pgfmathround@nextcmd
+}
+
+%--------------------------------------------
+% END of pgfmathroundto implementation.
+%--------------------------------------------
+
+
+% flags, mantissa and exponent has already been stored into
+% \pgfmathfloat@a@* [using ...@Mtok]
+%
+% PRECONDITION:
+% \ifpgfmathfloatroundhasperiod = \iftrue outside of the current
+% group
+%
+% POSTCONDITION:
+% \ifpgfmathfloatroundhasperiod will be set after the current TeX
+% group.
+\def\pgfmathfloatround@impl{%
+ \expandafter\pgfmathroundto@impl\expandafter{\the\pgfmathfloat@a@Mtok}%
+ \ifpgfmathfloatroundmayneedrenormalize
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathfloatround@impl@renormalize\pgfmathresult\pgfmathfloat@EOI%
+ \else
+ \expandafter\pgfmathfloatround@impl@renormalize\pgfmathresult.\pgfmathfloat@EOI%
+ \fi
+ \advance\pgfmathfloat@a@E by1
+ \fi
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\pgfmathresult}{\the\pgfmathfloat@a@E}%
+}
+
+\def\pgfmathfloatround@impl@renormalize#1#2.#3\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl{#1.#2#3}%
+}
+
+
+
+
+
+% ATTENTION: this thing REQUIRES a period in the mantissa!
+% collects everything into \pgfmathresult
+\def\pgfmathfloattofixed@impl#1.#2\relax{%
+ \ifnum\pgfmathfloat@a@E<0
+ \ifcase-\pgfmathfloat@a@E
+ \or%e-1
+ \pgfmathfloat@a@Mtok={0.}%
+ \or%e-2
+ \pgfmathfloat@a@Mtok={0.0}%
+ \or%e-3
+ \pgfmathfloat@a@Mtok={0.00}%
+ \or%e-4
+ \pgfmathfloat@a@Mtok={0.000}%
+ \or%e-5
+ \pgfmathfloat@a@Mtok={0.0000}%
+ \or%e-6
+ \pgfmathfloat@a@Mtok={0.00000}%
+ \or%e-7
+ \pgfmathfloat@a@Mtok={0.000000}%
+ \or%e-8
+ \pgfmathfloat@a@Mtok={0.0000000}%
+ \or%e-9
+ \pgfmathfloat@a@Mtok={0.00000000}%
+ \or%e-10
+ \pgfmathfloat@a@Mtok={0.000000000}%
+ \else%<= -11
+ \pgfmathfloat@a@Mtok={0.0000000000}%
+ \advance\pgfmathfloat@a@E by10
+ \pgfutil@loop
+ \ifnum\pgfmathfloat@a@E<-1
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok 0}%
+ \advance\pgfmathfloat@a@E by1
+ \pgfutil@repeat
+ \fi
+ \def\pgfmathfloat@loc@TMPb{#2}%
+ \def\pgfmathfloat@loc@TMPc{0}%
+ \ifx\pgfmathfloat@loc@TMPb\pgfmathfloat@loc@TMPc
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok #1}%
+ \else
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok #1#2}%
+ \fi
+ \else
+ %--------------------------------------------------
+ % \ifnum\pgfmathfloat@a@E=0%
+ % \edef\pgfmathresult{#1.#2}%
+ % \else
+ % \pgfmathfloat@a@Mtok={#1}%
+ % \pgfmathfloattofixed@impl@collectmantissa#2\count\pgfmathfloat@a@E
+ % \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}%
+ % \fi
+ %--------------------------------------------------
+ \pgfmathfloat@a@Mtok{#1}%
+ \pgfmathfloattofixed@impl@pos#2000000000\pgfmathfloat@EOI
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}%
+ \fi
+}
+
+% FIXME: this implementation here is very fast, but it introduces trailing zeros. Is that acceptable?
+\def\pgfmathfloattofixed@impl@pos#1#2#3#4#5#6#7#8#9\pgfmathfloat@EOI{%
+ \ifcase\pgfmathfloat@a@E
+ % e+0
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok .#1#2#3#4#5#6#7#8#9}%
+ \or%e+1
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1.#2#3#4#5#6#7#8#9}%
+ \or%e+2
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2.#3#4#5#6#7#8#9}%
+ \or%e+3
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3.#4#5#6#7#8#9}%
+ \or%e+4
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4.#5#6#7#8#9}%
+ \or%e+5
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5.#6#7#8#9}%
+ \or%e+6
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5#6.#7#8#9}%
+ \or%e+7
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5#6#7.#8#9}%
+ \or%e+8
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5#6#7#8.#9}%
+ \else%>=9
+ \pgfmathfloat@a@Mtok\expandafter{\the\pgfmathfloat@a@Mtok #1#2#3#4#5#6#7#8}%
+ \advance\pgfmathfloat@a@E by-8
+ \pgfmathfloattofixed@impl@collectmantissa#9\count\pgfmathfloat@a@E
+ \fi
+}%
+
+\def\pgfmathfloattofixed@impl@collectmantissa#1#2\count#3{%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok #1}%
+ \advance\pgfmathfloat@a@E by-1%
+ \def\pgfmathfloat@loc@TMPb{#2}%
+ \ifx\pgfmathfloat@loc@TMPb\pgfutil@empty
+ \pgfutil@loop
+ \ifnum\pgfmathfloat@a@E>0%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok 0}%
+ \advance\pgfmathfloat@a@E by-1%
+ \pgfutil@repeat
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok .0}%
+ \else
+ \ifnum\pgfmathfloat@a@E=0
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok .#2}%
+ \else
+ \pgfmathfloattofixed@impl@collectmantissa#2\count#3%
+ \fi
+ \fi
+}
+
+
+% ============================================
+%
+%
+% \pgfmathfloatparsenumber implementation
+%
+%
+% ============================================
+
+% accepted parser tokens:
+\def\pgfmathfloatparsenumber@tok@ZERO{0}
+\def\pgfmathfloatparsenumber@tok@PLUS{+}
+\def\pgfmathfloatparsenumber@tok@MINUS{-}
+\def\pgfmathfloatparsenumber@tok@PERIOD{.}
+
+\newif\ifpgfmathfloatparsenumberpendingperiod
+
+\def\pgfflt@EOI{p@EOI}%
+\def\pgfflt@EOI@unexpanded{\pgfflt@EOI}%
+
+% Starts a finite-start-machine parser to read a number.
+%
+% The machine's state is represented by the macro which is currently
+% processed; state transitions are realised using \csname...#1\endcsname
+% constructions.
+%
+% It assigns \pgfmathfloat@a@S, \pgfmathfloat@a@Mtok, \pgfmathfloat@a@E.
+\def\pgfflt@impl#1{%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \pgfmathfloat@tmptoks={}% this register is used to collect PENDING ZEROS
+ \pgfmathfloat@a@E=0
+ % start parsing: check for sign:
+ \expandafter\ifx\csname pgfflt@#1\endcsname\relax
+ \pgfmathfloat@a@S=1
+ \expandafter\pgfflt@init\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgfflt@#1\endcsname
+ \fi
+}
+% State transitions:
+\expandafter\def\csname pgfflt@+\endcsname{%
+ \pgfmathfloat@a@S=1 %
+ \pgfflt@init}%
+\expandafter\def\csname pgfflt@-\endcsname{%
+ \pgfmathfloat@a@S=2 %
+ \pgfflt@init}%
+\expandafter\def\csname pgfflt@\pgfflt@EOI\endcsname{%
+ \pgfmathfloatparsenumber@handleerror{empty number}{}{}}%
+
+\pgfkeys{
+ /pgf/fpu/handlers/empty number/.style 2 args={%
+ /pgf/fpu/handlers/invalid number={#1}{#2}%
+ },
+ /pgf/fpu/empty number is zero/.style={%
+ /pgf/fpu/handlers/empty number/.code 2 args={%
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ }%
+ },%
+ /pgf/fpu/handlers/invalid number/.code 2 args={%
+ \pgfmath@error{Could not parse input '#1' as a floating point number, sorry. The unreadable part was near '#2'.}{}%
+ },
+ /pgf/fpu/handlers/wrong lowlevel format/.code 2 args={%
+ \pgfmath@error{Sorry, an internal routine of the floating point unit got an ill-formatted floating point number `#1'. The unreadable part was near '#2'.}{}%
+ \let\pgfmathresult=\pgfutil@empty
+ },
+}
+
+% #1 the error handler
+% #2 the number which was invalid.
+% #3 the part which produced the error
+%
+% POSTCONDITION: the three registers
+% \pgfmathfloat@a@S
+% \pgfmathfloat@a@Mtok
+% \pgfmathfloat@a@E
+% will contain the number which results from the error handler.
+\def\pgfmathfloatparsenumber@handleerror#1#2#3{%
+ \let\pgfmathresult=\pgfutil@empty
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \pgfkeys{/pgf/fpu/handlers/#1={#2}{#3}}%
+ \ifx\pgfmathresult\pgfutil@empty
+ \pgfmathfloat@a@S=3
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0
+ \else
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathresult\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \fi
+}
+\def\pgfflt@error#1\pgfflt@EOI{%
+ \begingroup
+ \pgfmathfloat@a@Mtok={#1}%
+ \xdef\pgfmathfloat@glob@TMP{%
+ \noexpand\pgfmathfloatparsenumber@handleerror
+ {invalid number}{\pgfmathresult}{\the\pgfmathfloat@a@Mtok}}%
+ \endgroup
+ \pgfmathfloat@glob@TMP
+}%
+
+
+
+% FROM: checksign.
+%
+\def\pgfflt@init#1{%
+ \expandafter\ifx\csname pgffltA@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltA@#1\endcsname
+ \fi}
+% state transitions:
+\expandafter\def\csname pgffltA@0\endcsname{\pgfflt@leadingzero}% FIXME: inline optimization!
+\expandafter\def\csname pgffltA@1\endcsname{\pgfflt@nonzerodigit1}%
+\expandafter\def\csname pgffltA@2\endcsname{\pgfflt@nonzerodigit2}%
+\expandafter\def\csname pgffltA@3\endcsname{\pgfflt@nonzerodigit3}%
+\expandafter\def\csname pgffltA@4\endcsname{\pgfflt@nonzerodigit4}%
+\expandafter\def\csname pgffltA@5\endcsname{\pgfflt@nonzerodigit5}%
+\expandafter\def\csname pgffltA@6\endcsname{\pgfflt@nonzerodigit6}%
+\expandafter\def\csname pgffltA@7\endcsname{\pgfflt@nonzerodigit7}%
+\expandafter\def\csname pgffltA@8\endcsname{\pgfflt@nonzerodigit8}%
+\expandafter\def\csname pgffltA@9\endcsname{\pgfflt@nonzerodigit9}%
+\def\pgfflt@nonzerodigit#1{%
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloatparsenumberpendingperiodtrue
+ \pgfflt@positiveexp}%
+\expandafter\def\csname pgffltA@n\endcsname{\pgfflt@readnan}% FIXME: inlining?
+\expandafter\def\csname pgffltA@N\endcsname{\pgfflt@readnan}% FIXME: inlining?
+\expandafter\def\csname pgffltA@i\endcsname{\pgfflt@readinf}% FIXME: inlining?
+\expandafter\def\csname pgffltA@I\endcsname{\pgfflt@readinf}% FIXME: inlining?
+\expandafter\def\csname pgffltA@.\endcsname{% read '.9' like '0.9'
+ \pgfmathfloat@a@E=-1
+ \pgfflt@leadingzero@foundperiod}%
+
+\def\pgfflt@finish#1\pgfflt@EOI{}
+
+\def\pgfflt@readnan #1#2{%
+ \def\pgfflt@readnan@ok{1}%
+ \if#1a\else\if#1A\else\def\pgfflt@readnan@ok{0}\fi\fi
+ \if#2n\else\if#2N\else\def\pgfflt@readnan@ok{0}\fi\fi
+ \if\pgfflt@readnan@ok1%
+ \pgfmathfloat@a@S=3\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \expandafter\pgfflt@finish
+ \else
+ \def\pgfflt@readnan@{\pgfflt@error #1#2}%
+ \expandafter\pgfflt@readnan@
+ \fi
+}
+\def\pgfflt@readinf #1#2{%
+ \def\pgfflt@readinf@ok{1}%
+ \if#1n\else\if#1N\else\def\pgfflt@readinf@ok{0}\fi\fi
+ \if#2f\else\if#2F\else\def\pgfflt@readinf@ok{0}\fi\fi
+ \if\pgfflt@readinf@ok1%
+ \ifnum\pgfmathfloat@a@S=1 %
+ \pgfmathfloat@a@S=4 %
+ \pgfmathfloat@a@Mtok={0.0}%
+ \else
+ \pgfmathfloat@a@S=5 %
+ \pgfmathfloat@a@Mtok={0.0}%
+ \fi
+ \pgfmathfloat@a@E=0 %
+ \expandafter\pgfflt@finish
+ \else
+ \def\pgfflt@readinf@{\pgfflt@error #1#2}%
+ \expandafter\pgfflt@readinf@
+ \fi
+}
+\def\pgfflt@leadingzero#1{%
+ \expandafter\ifx\csname pgffltB@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltB@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltB@0\endcsname{\pgfflt@leadingzero}%
+\expandafter\def\csname pgffltB@1\endcsname{\pgfmathfloat@a@Mtok={1}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@2\endcsname{\pgfmathfloat@a@Mtok={2}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@3\endcsname{\pgfmathfloat@a@Mtok={3}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@4\endcsname{\pgfmathfloat@a@Mtok={4}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@5\endcsname{\pgfmathfloat@a@Mtok={5}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@6\endcsname{\pgfmathfloat@a@Mtok={6}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@7\endcsname{\pgfmathfloat@a@Mtok={7}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@8\endcsname{\pgfmathfloat@a@Mtok={8}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@9\endcsname{\pgfmathfloat@a@Mtok={9}\pgfmathfloatparsenumberpendingperiodtrue \pgfflt@positiveexp}
+\expandafter\def\csname pgffltB@\pgfmathfloat@POSTFLAGSCHAR\endcsname{\pgfmathfloat@a@Mtok={0}\pgfflt@readlowlevelfloat}%
+\expandafter\def\csname pgffltB@.\endcsname{%
+ \pgfmathfloat@a@E=-1
+ \pgfflt@leadingzero@foundperiod}%
+\expandafter\def\csname pgffltB@e\endcsname{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfflt@readexponent}%
+\let\pgffltB@E=\pgffltB@e
+\expandafter\def\csname pgffltB@\pgfflt@EOI\endcsname{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0}%
+
+\def\pgfflt@leadingzero@foundperiod#1{%
+ \expandafter\ifx\csname pgffltC@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltC@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltC@0\endcsname{%
+ \advance\pgfmathfloat@a@E by-1
+ \pgfflt@leadingzero@foundperiod}%
+\expandafter\def\csname pgffltC@1\endcsname{\pgfmathfloat@a@Mtok={1}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@2\endcsname{\pgfmathfloat@a@Mtok={2}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@3\endcsname{\pgfmathfloat@a@Mtok={3}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@4\endcsname{\pgfmathfloat@a@Mtok={4}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@5\endcsname{\pgfmathfloat@a@Mtok={5}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@6\endcsname{\pgfmathfloat@a@Mtok={6}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@7\endcsname{\pgfmathfloat@a@Mtok={7}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@8\endcsname{\pgfmathfloat@a@Mtok={8}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@9\endcsname{\pgfmathfloat@a@Mtok={9}\pgfmathfloatparsenumberpendingperiodtrue\pgfflt@finish@number@after@period}%
+\expandafter\def\csname pgffltC@e\endcsname{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfflt@readexponent}%
+\let\pgffltC@E=\pgffltC@e
+\expandafter\def\csname pgffltC@\pgfflt@EOI\endcsname{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0}%
+
+
+\def\pgfflt@positiveexp#1{%
+ \expandafter\ifx\csname pgffltD@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltD@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltD@0\endcsname{%
+ \advance\pgfmathfloat@a@E by1
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfflt@pendingzeros@positiveexp}%
+\expandafter\def\csname pgffltD@1\endcsname{\pgffltD@nonzerodigit1}%
+\expandafter\def\csname pgffltD@2\endcsname{\pgffltD@nonzerodigit2}%
+\expandafter\def\csname pgffltD@3\endcsname{\pgffltD@nonzerodigit3}%
+\expandafter\def\csname pgffltD@4\endcsname{\pgffltD@nonzerodigit4}%
+\expandafter\def\csname pgffltD@5\endcsname{\pgffltD@nonzerodigit5}%
+\expandafter\def\csname pgffltD@6\endcsname{\pgffltD@nonzerodigit6}%
+\expandafter\def\csname pgffltD@7\endcsname{\pgffltD@nonzerodigit7}%
+\expandafter\def\csname pgffltD@8\endcsname{\pgffltD@nonzerodigit8}%
+\expandafter\def\csname pgffltD@9\endcsname{\pgffltD@nonzerodigit9}%
+\expandafter\def\csname pgffltD@\pgfmathfloat@POSTFLAGSCHAR\endcsname{\pgfflt@readlowlevelfloat}%
+\expandafter\def\csname pgffltD@.\endcsname{\pgfflt@finish@number@after@period}% FIXME : inlining?
+\expandafter\def\csname pgffltD@e\endcsname{\pgfflt@readexponent}% FIXME : inlining?
+\let\pgffltD@E=\pgffltD@e
+\expandafter\def\csname pgffltD@\pgfflt@EOI\endcsname{}% NOP
+\def\pgffltD@nonzerodigit#1{%
+ \advance\pgfmathfloat@a@E by1
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfflt@positiveexp}%
+
+% Read a low-level floating point.
+% Since we are in the second state, \pgfmathfloat@a@Mtok contains the
+% FLAGS. The post-flags-char has also been read.
+\def\pgfflt@readlowlevelfloat#1e#2]\pgfflt@EOI{%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \pgfmathfloat@a@S=\the\pgfmathfloat@a@Mtok\relax
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloat@a@E=#2
+}%
+
+\def\pgfflt@readexponent#1\pgfflt@EOI{%
+ \afterassignment\pgfflt@readexponent@
+ \pgfmathfloat@b@E=#1 \pgfflt@EOI% the white space is important, otherwise \pgfflt@EOI will be expanded.
+}
+\def\pgfflt@readexponent@#1{%
+ \advance\pgfmathfloat@a@E by\pgfmathfloat@b@E\relax
+ %
+ % sanity checking:
+ \def\pgfmathfloat@loc@TMPb{#1}%
+ \ifx\pgfmathfloat@loc@TMPb\pgfflt@EOI@unexpanded
+ \else
+ \def\pgfmathfloat@loc@TMPb{\pgfflt@error#1}%
+ \expandafter\pgfmathfloat@loc@TMPb
+ \fi
+}
+
+\def\pgfflt@pendingzeros@positiveexp#1{%
+ \expandafter\ifx\csname pgffltE@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltE@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltE@0\endcsname{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \advance\pgfmathfloat@a@E by1
+ \pgfflt@pendingzeros@positiveexp}%
+\expandafter\def\csname pgffltE@1\endcsname{\pgffltE@nonzerodigit1}%
+\expandafter\def\csname pgffltE@2\endcsname{\pgffltE@nonzerodigit2}%
+\expandafter\def\csname pgffltE@3\endcsname{\pgffltE@nonzerodigit3}%
+\expandafter\def\csname pgffltE@4\endcsname{\pgffltE@nonzerodigit4}%
+\expandafter\def\csname pgffltE@5\endcsname{\pgffltE@nonzerodigit5}%
+\expandafter\def\csname pgffltE@6\endcsname{\pgffltE@nonzerodigit6}%
+\expandafter\def\csname pgffltE@7\endcsname{\pgffltE@nonzerodigit7}%
+\expandafter\def\csname pgffltE@8\endcsname{\pgffltE@nonzerodigit8}%
+\expandafter\def\csname pgffltE@9\endcsname{\pgffltE@nonzerodigit9}%
+\expandafter\def\csname pgffltE@.\endcsname{\pgfflt@finish@number@after@period}% FIXME : inlining?
+\def\pgffltE@e{\pgfflt@readexponent}% FIXME : inlining?
+\let\pgffltE@E=\pgffltE@e
+\expandafter\def\csname pgffltE@\pgfflt@EOI\endcsname{}% NOP
+\def\pgffltE@nonzerodigit#1{%
+ \advance\pgfmathfloat@a@E by1
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfflt@positiveexp}%
+
+\def\pgfflt@finish@number@after@period#1{%
+ \expandafter\ifx\csname pgffltF@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltF@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltF@0\endcsname{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfflt@pendingzeros}%
+\expandafter\def\csname pgffltF@1\endcsname{\pgffltF@nonzerodigit1}%
+\expandafter\def\csname pgffltF@2\endcsname{\pgffltF@nonzerodigit2}%
+\expandafter\def\csname pgffltF@3\endcsname{\pgffltF@nonzerodigit3}%
+\expandafter\def\csname pgffltF@4\endcsname{\pgffltF@nonzerodigit4}%
+\expandafter\def\csname pgffltF@5\endcsname{\pgffltF@nonzerodigit5}%
+\expandafter\def\csname pgffltF@6\endcsname{\pgffltF@nonzerodigit6}%
+\expandafter\def\csname pgffltF@7\endcsname{\pgffltF@nonzerodigit7}%
+\expandafter\def\csname pgffltF@8\endcsname{\pgffltF@nonzerodigit8}%
+\expandafter\def\csname pgffltF@9\endcsname{\pgffltF@nonzerodigit9}%
+\def\pgffltF@e{\pgfflt@readexponent}%
+\let\pgffltF@E=\pgffltF@e
+\expandafter\def\csname pgffltF@\pgfflt@EOI\endcsname{}% NOP
+\def\pgffltF@nonzerodigit#1{%
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfflt@finish@number@after@period}%
+
+
+\def\pgfflt@pendingzeros#1{%
+ \expandafter\ifx\csname pgffltG@#1\endcsname\relax
+ \expandafter\pgfflt@error\expandafter#1%
+ \else
+ \expandafter\expandafter\csname pgffltG@#1\endcsname
+ \fi}
+% State transitions:
+\expandafter\def\csname pgffltG@0\endcsname{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfflt@pendingzeros}%
+\expandafter\def\csname pgffltG@1\endcsname{\pgffltG@nonzerodigit1}%
+\expandafter\def\csname pgffltG@2\endcsname{\pgffltG@nonzerodigit2}%
+\expandafter\def\csname pgffltG@3\endcsname{\pgffltG@nonzerodigit3}%
+\expandafter\def\csname pgffltG@4\endcsname{\pgffltG@nonzerodigit4}%
+\expandafter\def\csname pgffltG@5\endcsname{\pgffltG@nonzerodigit5}%
+\expandafter\def\csname pgffltG@6\endcsname{\pgffltG@nonzerodigit6}%
+\expandafter\def\csname pgffltG@7\endcsname{\pgffltG@nonzerodigit7}%
+\expandafter\def\csname pgffltG@8\endcsname{\pgffltG@nonzerodigit8}%
+\expandafter\def\csname pgffltG@9\endcsname{\pgffltG@nonzerodigit9}%
+\def\pgffltG@e{\pgfflt@readexponent}% FIXME: inlining?
+\let\pgffltG@E=\pgffltG@e
+\expandafter\def\csname pgffltG@\pgfflt@EOI\endcsname{}% NOP
+\def\pgffltG@nonzerodigit#1{%
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfflt@finish@number@after@period}%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathbase.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
index cd34d3a8db0..a4e510d4dc8 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathbase.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
@@ -9,7 +9,46 @@
%
% This file provides basic macros for converting between bases.
%
-% Version 1.414213 29/9/2007
+% Version 1.4142135 8/11/2008
+
+% Base conversion operations for the parser.
+%
+\pgfmathdeclarefunction{bin}{1}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=#1\relax\pgfmath@%
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\the\c@pgfmath@counta}{10}{2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+\pgfmathdeclarefunction{hex}{1}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=#1\relax\pgfmath@%
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\the\c@pgfmath@counta}{10}{16}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+\pgfmathdeclarefunction{Hex}{1}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=#1\relax\pgfmath@%
+ \expandafter\pgfmathbasetoBase\expandafter\pgfmathresult\expandafter{\the\c@pgfmath@counta}{10}{16}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+\pgfmathdeclarefunction{oct}{1}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=#1\relax\pgfmath@%
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\the\c@pgfmath@counta}{10}{8}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% Additional macros:
% \pgfmathbasetodec
%
@@ -30,14 +69,14 @@
\pgfmath@checknumber{#2}%
\pgfmath@checkbase{#3}%
\def\pgfmath@base{#3}%
- \def\pgfmath@macro{#1}%
- \c@pgfmath@counta1\relax%
- \def\pgfmath@reversed{}%
- \expandafter\pgfmathbasetodec@#2\pgfmathbasetodec}
+ \def\pgfmath@base@macro{#1}%
+ \c@pgfmath@counta=1\relax%
+ \let\pgfmath@reversed=\pgfmath@empty%
+ \expandafter\pgfmathbasetodec@#2\pgfmath@base@stop}
\def\pgfmathbasetodec@#1{%
- \ifx\pgfmathbasetodec#1%
- \c@pgfmath@countb0%
+ \ifx#1\pgfmath@base@stop%
+ \c@pgfmath@countb=0%
\divide\c@pgfmath@counta by\pgfmath@base\relax%
\expandafter\pgfmathbasetodec@@%
\else%
@@ -50,32 +89,33 @@
\def\pgfmathbasetodec@@@#1{%
\ifx\pgfmathbasetodec#1\relax%
- \expandafter\edef\pgfmath@macro{\the\c@pgfmath@countb}%
- \let\pgfmath@next\pgfmathbasetodec@@@@%
+ \expandafter\edef\pgfmath@base@macro{\the\c@pgfmath@countb}%
+ \let\pgfmath@next=\pgfmathbasetodec@@@@%
\else%
\chardef\pgfmath@charnum`#1\relax%
- \c@pgfmath@countc\pgfmath@charnum%
+ \c@pgfmath@countc=\pgfmath@charnum\relax%
\ifnum\c@pgfmath@countc>96\relax%
- \advance\c@pgfmath@countc-87\relax%
+ \advance\c@pgfmath@countc by-87\relax%
\else
\ifnum\c@pgfmath@countc>64\relax%
- \advance\c@pgfmath@countc-55\relax%
+ \advance\c@pgfmath@countc by-55\relax%
\else
- \advance\c@pgfmath@countc-48\relax%
- \fi\fi%
+ \advance\c@pgfmath@countc by-48\relax%
+ \fi%
+ \fi%
\ifnum\c@pgfmath@countc<\pgfmath@base\relax%
- \multiply\c@pgfmath@countc\c@pgfmath@counta\relax%
- \advance\c@pgfmath@countb\c@pgfmath@countc%
+ \multiply\c@pgfmath@countc by\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by\c@pgfmath@countc%
\divide\c@pgfmath@counta by\pgfmath@base\relax%
\let\pgfmath@next\pgfmathbasetodec@@@%
\else
\pgfmath@error{Digit `#1' invalid for base \pgfmath@base}%
- \let\pgfmath@next\relax%
+ \let\pgfmath@next=\relax%
\fi%
\fi%
\pgfmath@next}
\def\pgfmathbasetodec@@@@{%
- \expandafter\pgfmath@ensurenumberlength\expandafter{\pgfmath@macro}%
+ \expandafter\pgfmath@ensurenumberlength\expandafter{\pgfmath@base@macro}%
}
% \pgfmathdectobase
@@ -97,16 +137,16 @@
\def\pgfmathdectobase#1#2#3{%
\pgfmath@checknumber{#2}%
\pgfmath@checkbase{#3}%
- \c@pgfmath@counta#2\relax%
- \def#1{}%
+ \c@pgfmath@counta=#2\relax%
+ \let#1=\pgfmath@empty%
\pgfmathloop
\ifnum\c@pgfmath@counta>0\relax%
- \c@pgfmath@countb\c@pgfmath@counta%
- \divide\c@pgfmath@countb#3\relax%
- \multiply\c@pgfmath@countb-#3\relax%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
+ \c@pgfmath@countb=\c@pgfmath@counta%
+ \divide\c@pgfmath@countb by#3\relax%
+ \multiply\c@pgfmath@countb by-#3\relax%
+ \advance\c@pgfmath@countb by\c@pgfmath@counta%
\edef#1{\csname pgfmath@lowercase digit@\the\c@pgfmath@countb\endcsname#1}%
- \divide\c@pgfmath@counta#3\relax%
+ \divide\c@pgfmath@counta by#3\relax%
\repeatpgfmathloop%
\pgfmath@ensurenumberlength{#1}}
@@ -129,35 +169,35 @@
\def\pgfmathdectoBase#1#2#3{%
\pgfmath@checkbase{#3}%
\pgfmath@checknumber{#2}%
- \c@pgfmath@counta#2\relax%
- \def#1{}%
+ \c@pgfmath@counta=#2\relax%
+ \let#1=\pgfmath@empty%
\pgfmathloop
\ifnum\c@pgfmath@counta>0\relax%
- \c@pgfmath@countb\c@pgfmath@counta%
- \divide\c@pgfmath@countb#3\relax%
- \multiply\c@pgfmath@countb-#3\relax%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
+ \c@pgfmath@countb=\c@pgfmath@counta%
+ \divide\c@pgfmath@countb by#3\relax%
+ \multiply\c@pgfmath@countb by-#3\relax%
+ \advance\c@pgfmath@countb by\c@pgfmath@counta%
\edef#1{\csname pgfmath@uppercase digit@\the\c@pgfmath@countb\endcsname#1}%
- \divide\c@pgfmath@counta#3\relax%
+ \divide\c@pgfmath@counta by#3\relax%
\repeatpgfmathloop%
\pgfmath@ensurenumberlength{#1}}
-\def\pgfmath@createdigits{%
- \def\pgfmath@digitstyle{lowercase digit}%
- \c@pgfmath@counta0\relax%
- \pgfmath@createdigits@0123456789abcdefghijklmnopqrstuvwxyz\pgfmath@createdigits%
- \def\pgfmath@digitstyle{uppercase digit}%
- \c@pgfmath@counta0\relax%
- \pgfmath@createdigits@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\pgfmath@createdigits}
+\def\pgfmath@base@digits@create{%
+ \def\pgfmath@base@digit@style{lowercase digit}%
+ \c@pgfmath@counta=0\relax%
+ \pgfmath@base@digits@create@0123456789abcdefghijklmnopqrstuvwxyz\pgfmath@base@digits@create%
+ \def\pgfmath@base@digit@style{uppercase digit}%
+ \c@pgfmath@counta=0\relax%
+ \pgfmath@base@digits@create@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\pgfmath@base@digits@create}
-\def\pgfmath@createdigits@#1{%
- \ifx\pgfmath@createdigits#1\relax%
+\def\pgfmath@base@digits@create@#1{%
+ \ifx\pgfmath@base@digits@create#1\relax%
\else%
- \expandafter\pgfmath@def\expandafter{\pgfmath@digitstyle}{\the\c@pgfmath@counta}{#1}%
- \advance\c@pgfmath@counta1\relax%
- \expandafter\pgfmath@createdigits@%
+ \expandafter\pgfmath@def\expandafter{\pgfmath@base@digit@style}{\the\c@pgfmath@counta}{#1}%
+ \advance\c@pgfmath@counta by1\relax%
+ \expandafter\pgfmath@base@digits@create@%
\fi}
-\pgfmath@createdigits
+\pgfmath@base@digits@create
% \pgfmathbasetobase
%
@@ -177,8 +217,8 @@
% \mynumber <- 721
%
\def\pgfmathbasetobase#1#2#3#4{%
- \pgfmathbasetodec{\pgfmath@temp}{#2}{#3}%
- \pgfmathdectobase{#1}{\pgfmath@temp}{#4}
+ \pgfmathbasetodec{\pgfmath@base@temp}{#2}{#3}%
+ \pgfmathdectobase{#1}{\pgfmath@base@temp}{#4}%
}
% \pgfmathbasetobase
@@ -199,8 +239,8 @@
% \mynumber <- 142
%
\def\pgfmathbasetoBase#1#2#3#4{%
- \pgfmathbasetodec{\pgfmath@temp}{#2}{#3}%
- \pgfmathdectoBase{#1}{\pgfmath@temp}{#4}
+ \pgfmathbasetodec{\pgfmath@base@temp}{#2}{#3}%
+ \pgfmathdectoBase{#1}{\pgfmath@base@temp}{#4}%
}
\def\pgfmath@checkbase#1{%
@@ -209,7 +249,8 @@
\else%
\ifnum#1>36\relax%
\pgfmath@error{Cannot process numbers in base `#1'.}%
- \fi\fi}
+ \fi%
+ \fi}
\def\pgfmath@checknumber#1{%
\expandafter\pgfmath@checknumber@#1\pgfmath@}
@@ -236,27 +277,27 @@
% \foo <- 000007FF
%
\def\pgfmath@ensurenumberlength#1{%
- \def\pgfmath@tempa{#1}%
+ \def\pgfmath@base@tempa{#1}%
\expandafter\c@pgfmath@counta\pgfmath@basenumberlength\relax%
\expandafter\pgfmath@ensurenumberlength@#1\pgfmath@ensurenumberlength}
\def\pgfmath@ensurenumberlength@#1{%
\ifx\pgfmath@ensurenumberlength#1\relax%
\expandafter\pgfmath@ensurenumberlength@@%
\else%
- \advance\c@pgfmath@counta-1\relax%
+ \advance\c@pgfmath@counta by-1\relax%
\expandafter\pgfmath@ensurenumberlength@
\fi}
\def\pgfmath@ensurenumberlength@@{%
- \edef\pgfmath@tempb{\pgfmath@tempa}%
+ \edef\pgfmath@base@tempb{\pgfmath@base@tempa}%
\pgfmath@ensurenumberlength@@@}
\def\pgfmath@ensurenumberlength@@@{%
\ifnum\c@pgfmath@counta>0\relax%
- \advance\c@pgfmath@counta-1\relax%
- \edef\pgfmath@tempb{0\pgfmath@tempb}%
+ \advance\c@pgfmath@counta by-1\relax%
+ \edef\pgfmath@base@tempb{0\pgfmath@base@tempb}%
\expandafter\pgfmath@ensurenumberlength@@@%
\fi%
- \expandafter\edef\pgfmath@tempa{\pgfmath@tempb}}
+ \expandafter\edef\pgfmath@base@tempa{\pgfmath@base@tempb}}
\def\pgfmathsetbasenumberlength#1{\def\pgfmath@basenumberlength{#1}}
-\pgfmathsetbasenumberlength{1}% \ No newline at end of file
+\pgfmathsetbasenumberlength{1}%
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex
new file mode 100644
index 00000000000..ca741fa7adc
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex
@@ -0,0 +1,713 @@
+% Copyright 2007 by Mark Wibrow
+%
+% 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.
+
+% This file defines the mathematical functions and operators.
+%
+% Version 1.4142135 25/8/2008
+
+% add function.
+%
+\pgfmathdeclarefunction{add}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@y=#2pt\relax%
+ \advance\pgfmath@x by\pgfmath@y%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+
+% subtract function.
+%
+\pgfmathdeclarefunction{subtract}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@y=#2pt\relax%
+ \advance\pgfmath@x by-\pgfmath@y%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% neg function.
+%
+\pgfmathdeclarefunction{neg}{1}{%
+ \begingroup%
+ \pgfmath@x=-#1pt\relax%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+% change the precedence for neg.
+% Otherwise, unary minus and exponentiation won't have the correct precedence
+% (test '-2^2')
+\def\pgfmath@operation@neg@precedence{500}
+
+% multiply function.
+%
+\pgfmathdeclarefunction{multiply}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@y=#2pt\relax%
+ \pgfmath@x=\pgfmath@tonumber{\pgfmath@y}\pgfmath@x%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% divide function.
+%
+\newif\ifpgfmath@divide@period
+
+\pgfmathdeclarefunction{divide}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@y=#2pt\relax%
+ \let\pgfmath@sign=\pgfmath@empty%
+ \ifdim0pt=\pgfmath@y%
+ \pgfmath@error{You've asked me to divide `#1' by `#2', %
+ but I cannot divide any number by `#2'}%
+ \fi%
+ \afterassignment\pgfmath@xa%
+ \c@pgfmath@counta\the\pgfmath@y\relax%
+ \ifdim0pt=\pgfmath@xa%
+ \divide\pgfmath@x by\c@pgfmath@counta%
+ \else%
+ \ifdim0pt>\pgfmath@x%
+ \def\pgfmath@sign{-}%
+ \pgfmath@x=-\pgfmath@x%
+ \fi%
+ \ifdim0pt>\pgfmath@y%
+ \expandafter\def\expandafter\pgfmath@sign\expandafter{\pgfmath@sign-}%
+ \pgfmath@y=-\pgfmath@y%
+ \fi%
+ \ifdim1pt>\pgfmath@y%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgfmath@y}}%
+ \pgfmath@x=\pgfmath@sign\pgfmathresult\pgfmath@x%
+ \else%
+ \def\pgfmathresult{0}%
+ \pgfmath@divide@periodtrue%
+ \c@pgfmath@counta=0\relax%
+ \pgfmathdivide@@%
+ \pgfmath@x=\pgfmath@sign\pgfmathresult pt\relax%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+\def\pgfmath@small@number{0.00002}
+
+\def\pgfmathdivide@@{%
+ \let\pgfmath@next=\relax%
+ \ifdim\pgfmath@small@number pt<\pgfmath@x%
+ \ifdim\pgfmath@small@number pt<\pgfmath@y%
+ \ifdim\pgfmath@y>\pgfmath@x%
+ \ifpgfmath@divide@period%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult.}%
+ \pgfmath@divide@periodfalse%
+ \fi%
+ \pgfmathdivide@dimenbyten\pgfmath@y%
+ \ifdim\pgfmath@y>\pgfmath@x%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult0}%
+ \fi%
+ \else%
+ \c@pgfmath@counta=\pgfmath@x%
+ \c@pgfmath@countb=\pgfmath@y%
+ \divide\c@pgfmath@counta by\c@pgfmath@countb%
+ \pgfmath@ya=\c@pgfmath@counta\pgfmath@y%
+ \advance\pgfmath@x by-\pgfmath@ya%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgfmathresult
+ \expandafter\expandafter\expandafter{\expandafter\pgfmathresult\the\c@pgfmath@counta}%
+ \fi%
+ \let\pgfmath@next=\pgfmathdivide@@%
+ \fi%
+ \fi%
+ \pgfmath@next%
+}
+
+\def\pgfmathdivide@dimenbyten#1{%
+ \edef\pgfmath@temp{\pgfmath@tonumber{#1}}%
+ \expandafter\pgfmathdivide@@dimenbyten\pgfmath@temp\@@#1\@@}
+\def\pgfmathdivide@@dimenbyten#1.#2\@@#3\@@{%
+ \pgfmath@tempcnta=#1\relax%
+ \divide\pgfmath@tempcnta by10\relax%
+ \pgfmath@tempcntb=\pgfmath@tempcnta%
+ \multiply\pgfmath@tempcnta by-10\relax%
+ \advance\pgfmath@tempcnta by#1\relax%
+ #3=\the\pgfmath@tempcntb.\the\pgfmath@tempcnta#2pt\relax%
+}
+
+
+% reciprocal function.
+%
+\pgfmathdeclarefunction{reciprocal}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x=0pt\relax%
+ \pgfmath@error{You asked me to calculate `1/#1', but I cannot divide any number by zero}{}%
+ \fi%
+ \edef\pgfmath@reciprocaltemp{\pgfmath@tonumber{\pgfmath@x}}%
+ \expandafter\pgfmathreciprocal@@\pgfmath@reciprocaltemp0000000\pgfmath@}
+\def\pgfmathreciprocal@@#1.#2#3#4#5#6#7\pgfmath@{%
+ \c@pgfmath@counta#2#3#4#5#6\relax%
+ % If the number is an integer, use TeX arithmatic.
+ \ifnum\c@pgfmath@counta=0\relax%
+ \pgfmath@x1pt\relax%
+ \divide\pgfmath@x#1\relax%
+ \else%
+ \ifnum#1>100\relax%
+ \c@pgfmath@counta#1#2#3#4\relax%
+ \c@pgfmath@countb1000000000\relax%
+ \divide\c@pgfmath@countb\c@pgfmath@counta%
+ \c@pgfmath@counta\c@pgfmath@countb%
+ \divide\c@pgfmath@counta10000\relax%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \multiply\c@pgfmath@counta-10000\relax%
+ \advance\c@pgfmath@countb\c@pgfmath@counta%
+ \pgfmath@y\c@pgfmath@countb pt\relax%
+ \divide\pgfmath@y1000000\relax%
+ \advance\pgfmath@x\pgfmath@y%
+ \else%
+ \c@pgfmath@counta#1#2#3#4#5#6\relax%
+ \c@pgfmath@countb1000000000\relax%
+ \divide\c@pgfmath@countb\c@pgfmath@counta%
+ \c@pgfmath@counta\c@pgfmath@countb%
+ \divide\c@pgfmath@counta10000\relax%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \multiply\c@pgfmath@counta-10000\relax%
+ \advance\c@pgfmath@countb\c@pgfmath@counta%
+ \pgfmath@y\c@pgfmath@countb pt\relax%
+ \pgfmath@y.1\pgfmath@y% Yes! This way is more accurate. Go figure...
+ \pgfmath@y.1\pgfmath@y%
+ \pgfmath@y.1\pgfmath@y%
+ \pgfmath@y.1\pgfmath@y%
+ \advance\pgfmath@x\pgfmath@y%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% div function.
+%
+\pgfmathdeclarefunction{div}{2}{%
+ \begingroup%
+ \pgfmathdivide@{#1}{#2}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathceil@{\pgfmathresult}%
+ \else%
+ \pgfmathfloor@{\pgfmathresult}%
+ \fi%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=\pgfmathresult\relax\pgfmath@%
+ \edef\pgfmathresult{\the\c@pgfmath@counta}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% mod function.
+%
+\pgfmathdeclarefunction{mod}{2}{%
+ \begingroup%
+ \pgfmath@xa#1pt%
+ \pgfmath@xb#2pt%
+ \pgfmath@x\pgfmath@xa%
+ \c@pgfmath@counta\pgfmath@xa%
+ \c@pgfmath@countb\pgfmath@xb%
+ \divide\c@pgfmath@counta\c@pgfmath@countb%
+ \multiply\pgfmath@xb\c@pgfmath@counta%
+ \advance\pgfmath@x-\pgfmath@xb%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% Mod function (never negative).
+%
+\pgfmathdeclarefunction{Mod}{2}{%
+ \begingroup%
+ \pgfmathmod@{#1}{#2}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \advance\pgfmath@x by#2pt\relax%
+ \fi%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% abs function.
+%
+\pgfmathdeclarefunction{abs}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \pgfmath@x-\pgfmath@x%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% e constant.
+%
+\pgfmathdeclarefunction{e}{0}{\def\pgfmathresult{2.718281828}}
+
+% ln function.
+%
+% This is based on an algorithm due to Rouben Rostamian and
+% uses coefficients contributed by Alain Matthes.
+%
+\pgfmathdeclarefunction{ln}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x>0pt\else%
+ \pgfmath@error{I cannot calculate the logarithm of `#1'}{}%
+ \fi%
+ \c@pgfmath@counta=0\relax%
+ \ifdim\pgfmath@x>2pt\relax%
+ \ifdim\pgfmath@x<128pt\relax%
+ \ifdim\pgfmath@x<8pt\relax%
+ \ifdim\pgfmath@x<4pt\relax%
+ \divide\pgfmath@x by2\relax%
+ \c@pgfmath@counta=1\relax%
+ \else%
+ \divide\pgfmath@x by4\relax%
+ \c@pgfmath@counta=2\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<32pt\relax%
+ \ifdim\pgfmath@x<16pt\relax%
+ \divide\pgfmath@x by8\relax%
+ \c@pgfmath@counta=3\relax%
+ \else%
+ \divide\pgfmath@x by16\relax%
+ \c@pgfmath@counta=4\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<64pt\relax%
+ \divide\pgfmath@x by32\relax%
+ \c@pgfmath@counta=5\relax%
+ \else%
+ \divide\pgfmath@x by64\relax%
+ \c@pgfmath@counta=6\relax%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<2048pt\relax%
+ \ifdim\pgfmath@x<512pt\relax%
+ \ifdim\pgfmath@x<256pt\relax%
+ \divide\pgfmath@x by128\relax%
+ \c@pgfmath@counta=7\relax%
+ \else%
+ \divide\pgfmath@x by256\relax%
+ \c@pgfmath@counta=8\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<1024pt\relax%
+ \divide\pgfmath@x by512\relax%
+ \c@pgfmath@counta=9\relax%
+ \else%
+ \divide\pgfmath@x by1024\relax%
+ \c@pgfmath@counta=10\relax%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<8192pt\relax%
+ \ifdim\pgfmath@x<4096pt\relax%
+ \divide\pgfmath@x by2048\relax%
+ \c@pgfmath@counta=11\relax%
+ \else%
+ \divide\pgfmath@x by4096\relax%
+ \c@pgfmath@counta =12\relax%
+ \fi%
+ \else%
+ \divide\pgfmath@x by8192\relax%
+ \c@pgfmath@counta=13\relax%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x<1pt\relax%
+ \ifdim\pgfmath@x>0.0078125pt\relax% 2^-7
+ \ifdim\pgfmath@x>0.125pt\relax% 2^-3
+ \ifdim\pgfmath@x>0.5pt\relax% 2^-1
+ \multiply\pgfmath@x by2\relax%
+ \c@pgfmath@counta=-1\relax%
+ \else%
+ \multiply\pgfmath@x by4\relax%
+ \c@pgfmath@counta=-2\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x>0.03125pt\relax% 2^-5
+ \ifdim\pgfmath@x>0.0625pt\relax%
+ \multiply\pgfmath@x by8\relax%
+ \c@pgfmath@counta=-3\relax%
+ \else%
+ \multiply\pgfmath@x by16\relax%
+ \c@pgfmath@counta=-4\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x>0.015625pt\relax% 2^-6
+ \multiply\pgfmath@x by32\relax%
+ \c@pgfmath@counta=-5\relax%
+ \else%
+ \multiply\pgfmath@x by64\relax%
+ \c@pgfmath@counta=-6\relax%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x>0.000244140625pt\relax% 2^-11
+ \ifdim\pgfmath@x>0.001953125pt\relax% 2^-9
+ \ifdim\pgfmath@x>0.00390625pt\relax% 2^-8
+ \multiply\pgfmath@x by128\relax%
+ \c@pgfmath@counta=-7\relax%
+ \else%
+ \multiply\pgfmath@x by256\relax%
+ \c@pgfmath@counta=-8\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x>0.0009765625pt\relax% 2^-10
+ \multiply\pgfmath@x by512\relax%
+ \c@pgfmath@counta=-9\relax%
+ \else%
+ \multiply\pgfmath@x by1024\relax%
+ \c@pgfmath@counta=-10\relax%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgfmath@x>0.0001220703125pt\relax% 2^13
+ \ifdim\pgfmath@x>0.0002441406256pt\relax% 2^12
+ \multiply\pgfmath@x by2048\relax%
+ \c@pgfmath@counta=-11\relax%
+ \else%
+ \multiply\pgfmath@x by4096\relax%
+ \c@pgfmath@counta=-12\relax%
+ \fi%
+ \else%
+ \multiply\pgfmath@x by8192\relax%
+ \c@pgfmath@counta=-13\relax%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % Use A+(B+(C+(D+(E+F*x)*x)*x)*x)*x
+ %
+ % where:
+ % A = -2.787927935
+ % B = 5.047861502
+ % C = -3.489886985
+ % D = 1.589480044
+ % E = -.4025153233
+ % F = 0.04300521312
+ %
+ \edef\pgfmath@temp{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@x=0.04300521312\pgfmath@x%
+ \advance\pgfmath@x by-.4025153233pt\relax%
+ \pgfmath@x=\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x by1.589480044pt\relax%
+ \pgfmath@x=\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x by-3.489886985pt\relax%
+ \pgfmath@x=\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x by5.047861502pt\relax%
+ \pgfmath@x=\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x by-2.787927935pt\relax%
+ \advance\pgfmath@x by\c@pgfmath@counta pt\relax%
+ \pgfmath@x=0.6931471806\pgfmath@x%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% log2 function.
+%
+\pgfmathdeclarefunction{log2}{1}{%
+ \begingroup%
+ \pgfmathln@{#1}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmath@x=1.442695041\pgfmath@x% 1/ln(2).
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% log10 function
+%
+\pgfmathdeclarefunction{log10}{1}{%
+ \begingroup%
+ \pgfmathln@{#1}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmath@x=0.43429441\pgfmath@x% 1/ln(10).
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% exp function.
+%
+\pgfmathdeclarefunction{exp}{1}{%
+ \begingroup%
+ \pgfmath@xc=#1pt\relax%
+ \ifdim\pgfmath@xc<-9pt%
+ \pgfmath@x=1sp\relax%
+ \else%
+ \ifdim\pgfmath@xc<0pt%
+ \pgfmath@xc=-\pgfmath@xc%
+ \fi%
+ \pgfmath@x=1pt\relax%
+ \pgfmath@xa=1pt\relax%
+ \pgfmath@xb=\pgfmath@x%
+ \pgfmathloop%
+ \divide\pgfmath@xa by\pgfmathcounter%
+ \pgfmath@xa=\pgfmath@tonumber\pgfmath@xc\pgfmath@xa%
+ \advance\pgfmath@x by\pgfmath@xa%
+ \ifdim\pgfmath@x=\pgfmath@xb%
+ \else%
+ \pgfmath@xb=\pgfmath@x%
+ \repeatpgfmathloop%
+ \ifdim#1pt<0pt%
+ \pgfmathreciprocal@{\pgfmath@tonumber\pgfmath@x}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% sqrt function.
+%
+\pgfmathdeclarefunction{sqrt}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \pgfmath@error{I cannot calculate the square-root of the negative number `#1'}{}%
+ \else%
+ \ifdim\pgfmath@x<10pt\relax%
+ \def\pgfmath@zeros{0}%
+ \def\pgfmath@targetiterations{1}%
+ \else%
+ \ifdim\pgfmath@x<100pt\relax%
+ \def\pgfmath@zeros{}%
+ \def\pgfmath@targetiterations{1}%
+ \else%
+ \ifdim\pgfmath@x<1000pt\relax%
+ \def\pgfmath@zeros{0}%
+ \def\pgfmath@targetiterations{2}%
+ \else%
+ \ifdim\pgfmath@x<10000pt\relax%
+ \def\pgfmath@zeros{}%
+ \def\pgfmath@targetiterations{2}%
+ \else%
+ \def\pgfmath@zeros{0}%
+ \def\pgfmath@targetiterations{3}%
+ \fi\fi\fi\fi\fi%
+ \edef\pgfmath@temp{\pgfmath@zeros\pgfmath@tonumber{\pgfmath@x}}%
+ \expandafter\pgfmath@sqrt@\pgfmath@temp\pgfmath@%
+}
+\def\pgfmath@sqrt@#1.#2\pgfmath@{\pgfmath@@sqrt@#1#2\pgfmath@empty\pgfmath@empty\pgfmath@}
+
+\def\pgfmath@@sqrt@#1#2{%
+ \c@pgfmath@countb=#1#2\relax%
+ \ifnum\c@pgfmath@countb>35\relax%
+ \ifnum\c@pgfmath@countb>63\relax%
+ \ifnum\c@pgfmath@countb>80\relax%
+ \c@pgfmath@counta=9\relax%
+ \else%
+ \c@pgfmath@counta=8\relax%
+ \fi%
+ \else%
+ \ifnum\c@pgfmath@countb>48\relax%
+ \c@pgfmath@counta=7\relax%
+ \else%
+ \c@pgfmath@counta=6\relax%
+ \fi%
+ \fi%
+ \else%
+ \ifnum\c@pgfmath@countb>15\relax%
+ \ifnum\c@pgfmath@countb>24\relax%
+ \c@pgfmath@counta5\relax%
+ \else%
+ \c@pgfmath@counta=4\relax%
+ \fi%
+ \else%
+ \ifnum\c@pgfmath@countb>3\relax%
+ \ifnum\c@pgfmath@countb>8\relax%
+ \c@pgfmath@counta=3\relax%
+ \else%
+ \c@pgfmath@counta=2\relax%
+ \fi%
+ \else%
+ \ifnum\c@pgfmath@countb>0\relax%
+ \c@pgfmath@counta=1\relax%
+ \else%
+ \c@pgfmath@counta=0\relax%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \edef\pgfmath@root{\the\c@pgfmath@counta}%
+ \edef\pgfmath@rootspecial{\the\c@pgfmath@counta}%
+ \multiply\c@pgfmath@counta by-\c@pgfmath@counta\relax%
+ \advance\c@pgfmath@counta by#1#2\relax%
+ \edef\pgfmath@remainder{\the\c@pgfmath@counta}%
+ \pgfmath@@@sqrt@%
+}
+
+\def\pgfmath@@@sqrt@#1#2{%
+ \ifx\pgfmath@empty#1%
+ \edef\pgfmath@remainder{\pgfmath@remainder00}%
+ \def\pgfmath@tokens{\pgfmath@empty\pgfmath@empty}%
+ \else%
+ \ifx\pgfmath@empty#2%
+ \edef\pgfmath@remainder{\pgfmath@remainder#10}%
+ \def\pgfmath@tokens{\pgfmath@empty\pgfmath@empty}%
+ \else%
+ \edef\pgfmath@remainder{\pgfmath@remainder#1#2}%
+ \def\pgfmath@tokens{}%
+ \fi\fi%
+ \c@pgfmath@counta=\pgfmath@rootspecial\relax%
+ \multiply\c@pgfmath@counta by20\relax%
+ \c@pgfmath@countb=\c@pgfmath@counta%
+ \multiply\c@pgfmath@countb by6\relax%
+ \advance\c@pgfmath@countb by36\relax%
+ \c@pgfmath@countc=\c@pgfmath@counta%
+ \multiply\c@pgfmath@countc by2\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \advance\c@pgfmath@countb by-\c@pgfmath@countc%
+ \advance\c@pgfmath@countb by-20\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \advance\c@pgfmath@countb by-\c@pgfmath@countc%
+ \advance\c@pgfmath@countb by-12\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \advance\c@pgfmath@countb by-\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by-3\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \def\pgfmath@digit{0}%
+ \else%
+ \def\pgfmath@digit{1}%
+ \fi%
+ \else%
+ \advance\c@pgfmath@countb by\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by5\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \def\pgfmath@digit{2}%
+ \else%
+ \def\pgfmath@digit{3}%
+ \fi%
+ \fi%
+ \else%
+ \advance\c@pgfmath@countb by\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by9\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \def\pgfmath@digit{4}%
+ \else%
+ \def\pgfmath@digit{5}%
+ \fi%
+ \fi%
+ \else%
+ \advance\c@pgfmath@countb by\c@pgfmath@countc%
+ \advance\c@pgfmath@countb by28\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \advance\c@pgfmath@countb by-\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by-15\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \def\pgfmath@digit{6}%
+ \else%
+ \def\pgfmath@digit{7}%
+ \fi%
+ \else%
+ \advance\c@pgfmath@countb by\c@pgfmath@counta%
+ \advance\c@pgfmath@countb by17\relax%
+ \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
+ \def\pgfmath@digit{8}%
+ \else%
+ \def\pgfmath@digit{9}%
+ \fi%
+ \fi%
+ \fi%
+ \edef\pgfmath@rootspecial{\pgfmath@rootspecial\pgfmath@digit}%
+ \advance\c@pgfmath@counta by\pgfmath@digit\relax%
+ \multiply\c@pgfmath@counta by-\pgfmath@digit\relax%
+ \advance\c@pgfmath@counta by\pgfmath@remainder\relax%
+ \edef\pgfmath@remainder{\the\c@pgfmath@counta}%
+ \c@pgfmath@counta=\pgfmath@targetiterations\relax%
+ \advance\c@pgfmath@counta by-1\relax%
+ \edef\pgfmath@targetiterations{\the\c@pgfmath@counta}%
+ \ifnum\c@pgfmath@counta=0\relax%
+ \edef\pgfmath@root{\pgfmath@root.\pgfmath@digit}%
+ \else%
+ \edef\pgfmath@root{\pgfmath@root\pgfmath@digit}%
+ \fi%
+ \ifnum\c@pgfmath@counta=-4\relax% -n+1 digits of precision.
+ \let\pgfmath@next\pgfmath@sqrt@end%
+ \else%
+ \let\pgfmath@next\pgfmath@@@sqrt@%
+ \fi%
+ \expandafter\pgfmath@next\pgfmath@tokens%
+}
+
+\def\pgfmath@sqrt@end#1\pgfmath@{%
+ \edef\pgfmathresult{\pgfmath@root}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
+
+% \pgfmathpow
+%
+% Calculates #1 ^ #2
+%
+\pgfmathdeclarefunction{pow}{2}{%
+ \begingroup%
+ \pgfmath@xa=#1pt%
+ \pgfmath@xb=#2pt%
+ \afterassignment\pgfmath@x%
+ \expandafter\c@pgfmath@counta\the\pgfmath@xb\relax%
+ \ifnum\c@pgfmath@counta<0\relax%
+ \c@pgfmath@counta=-\c@pgfmath@counta%
+ \pgfmathreciprocal@{#1}%
+ \pgfmath@xa=\pgfmathresult pt\relax%
+ \fi
+ \ifdim\pgfmath@x=0pt\relax%
+ \pgfmath@x=1pt\relax%
+ \pgfmathloop%
+ \ifnum\c@pgfmath@counta>0\relax%
+ \ifodd\c@pgfmath@counta%
+ \pgfmath@x=\pgfmath@tonumber{\pgfmath@x}\pgfmath@xa%
+ \fi
+ \ifnum\c@pgfmath@counta>1\relax%
+ \pgfmath@xa=\pgfmath@tonumber{\pgfmath@xa}\pgfmath@xa%
+ \fi%
+ \divide\c@pgfmath@counta by2\relax%
+ \repeatpgfmathloop%
+ \else%
+ \pgfmathln@{#1}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmath@x=\pgfmath@tonumber{\pgfmath@xb}\pgfmath@x%
+ \pgfmathexp@{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \fi%
+ \pgfmath@returnone\pgf@x%
+ \endgroup%
+}
+
+% factorial function.
+%
+\pgfmathdeclarefunction{factorial}{1}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \c@pgfmath@counta=#1\relax\pgfmath@%
+ \pgfmath@x=1pt\relax%
+ \pgfmathloop%
+ \ifnum\c@pgfmath@counta<2\relax%
+ \else%
+ \multiply\pgfmath@x by\c@pgfmath@counta%
+ \advance\c@pgfmath@counta by-1\relax%
+ \repeatpgfmathloop%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
new file mode 100644
index 00000000000..a493b6c6b62
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
@@ -0,0 +1,240 @@
+% Copyright 2007 by Mark Wibrow
+%
+% 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.
+
+% Declare a function for the parser.
+%
+% #1 - the name of the function.
+% #2 - arity (or ... for variable arguments).
+% #3 - the code for the function.
+%
+% Use \pgfmathdeclarefunction* to force a redefinition if the function exists already.
+\def\pgfmathdeclarefunction{\pgfmath@ifnextchar*\pgfmathdeclarefunction@force\pgfmathdeclarefunction@check}
+\def\pgfmathdeclarefunction@check#1#2#3{%
+ \expandafter\ifx\csname pgfmath@function@#1\endcsname\relax%
+ \pgfmath@declarefunction{#1}{#2}{#3}%
+ \else%
+ \pgfmath@error{The function `#1' already exists}{}%
+ \fi%
+}
+\def\pgfmathdeclarefunction@force*{\pgfmath@declarefunction}%
+
+\def\pgfmathredeclarefunction#1#2{%
+ \expandafter\ifx\csname pgfmath@function@#1\endcsname\relax%
+ \pgfmath@error{The function `#1' does not exist}{}%
+ \else%
+ \pgfmath@namedef{pgfmath#1@}{#2}%
+ \fi%
+}
+
+\def\pgfmath@declarefunction#1#2{%
+ \pgfmath@namedef{pgfmath@function@#1}{#1}%
+ \pgfmath@namedef{pgfmath@operation@#1@type}{function}%
+ \pgfmath@namedef{pgfmath@operation@#1@arity}{#2}%
+ \pgfmath@namedef{pgfmath@operation@#1@infix}{#1}%
+ \pgfmath@namedef{pgfmath@operation@#1@precedence}{1000}%
+ \expandafter\ifx\csname pgfmath@operation@#1@arity\endcsname\pgfmath@dots%
+ \pgfmath@namedef{pgfmath@operation@#1@arity}{1}%
+ \else%
+ \ifnum\csname pgfmath@operation@#1@arity\endcsname>9\relax%
+ \pgfmath@namedef{pgfmath@operation@#1@arity}{1}%
+ \fi%
+ \fi%
+ \edef\pgfmath@marshal{%
+ \noexpand\pgfmath@@declarefunction%
+ {\expandafter\noexpand\csname pgfmath#1\endcsname}%
+ {\expandafter\noexpand\csname pgfmath#1@\endcsname}%
+ {\csname pgfmath@operation@#1@arity\endcsname}%
+ }%
+ \pgfmath@marshal%
+}
+
+% #1 - \pgfmath<name>.
+% #2 - \pgfmath<name>@.
+% #3 - arity.
+% #4 - code for function <name>.
+%
+\def\pgfmath@@declarefunction#1#2#3#4{% Function of arity 0 - 9.
+ \ifcase#3\relax%
+ \def#1{#2}%
+ \def#2{#4}%
+ \or
+ \def#1##1{\pgfmathparse{##1}\expandafter#2\expandafter{\pgfmathresult}}%
+ \def#2##1{#4}%
+ \else%
+ \pgfmath@toks={}%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>#3\relax%
+ \else%
+ \expandafter\pgfmath@addto@toks\expandafter{\pgfmath@char@hash}%
+ \expandafter\pgfmath@addto@toks\expandafter{\pgfmathcounter}%
+ \repeatpgfmathloop%
+ \edef\pgfmath@head{\noexpand\def\noexpand#1\the\pgfmath@toks}%
+ \edef\pgfmath@@head{\noexpand\def\noexpand#2\the\pgfmath@toks}%
+ \pgfmath@toks={}%
+ \def\pgfmath@arguments{}%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>#3\relax%
+ \else%
+ \pgfmath@addto@toks{\pgfmathparse}%
+ \expandafter\expandafter\expandafter\pgfmath@addto@toks%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter%
+ {\expandafter\pgfmath@char@hash\pgfmathcounter}}%
+ \pgfmath@addto@toks{\let}%
+ \expandafter\pgfmath@addto@toks\expandafter{%
+ \csname pgfmath@argument@\pgfmathcounter\endcsname=\pgfmathresult}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgfmath@arguments\expandafter\expandafter\expandafter{\expandafter%
+ \pgfmath@arguments\expandafter{\csname pgfmath@argument@\pgfmathcounter\endcsname}}%
+ \repeatpgfmathloop%
+ \expandafter\pgfmath@addto@toks\expandafter{\expandafter#2\pgfmath@arguments}%
+ \edef\pgfmath@body{{\the\pgfmath@toks}}%
+ \expandafter\pgfmath@head\pgfmath@body%
+ \pgfmath@@head{#4}%
+ \fi%
+}
+
+\def\pgfmath@addto@toks#1{%
+ \edef\pgfmath@toks@expanded{\the\pgfmath@toks}%
+ \expandafter\pgfmath@toks\expandafter{\pgfmath@toks@expanded#1}}
+
+% Key for declaring local functions.
+%
+\pgfkeys{%
+ /pgf/declare function/.code={%
+ \pgfmath@local@functions#1@=@;%
+ }
+}
+
+\def\pgfmath@local@gobbleone#1{}
+\def\pgfmath@local@at{@}%
+
+\def\pgfmath@local@functions{%
+ \pgfutil@ifnextchar x{\pgfmath@local@@functions}{\pgfmath@local@@functions}%
+}
+
+\def\pgfmath@local@@functions#1=#2;{%
+ \def\pgfmath@local@temp{#1}%
+ \ifx\pgfmath@local@temp\pgfmath@local@at%
+ \let\pgfmath@local@next=\relax%
+ \else%
+ \pgfmath@local@function#1=#2;%
+ \let\pgfmath@local@next=\pgfmath@local@functions%
+ \fi%
+ \pgfmath@local@next%
+}
+
+\def\pgfmath@local@function{%
+ \let\pgfmath@local@name=\pgfutil@empty%
+ \let\pgfmath@local@args=\pgfutil@empty%
+ \let\pgfmath@local@body=\pgfutil@empty%
+ \pgfmath@local@@function}
+
+\def\pgfmath@local@@function#1{%
+ \if#1=%
+ \let\pgfmath@local@next=\pgfmath@local@function@body%
+ \else%
+ \if#1(%
+ \let\pgfmath@local@next=\pgfmath@local@function@args%
+ \else%
+ \expandafter\def\expandafter\pgfmath@local@name\expandafter{\pgfmath@local@name#1}%
+ \let\pgfmath@local@next=\pgfmath@local@@function%
+ \fi%
+ \fi%
+ \pgfmath@local@next%
+}
+
+\def\pgfmath@local@function@args#1){%
+ \def\pgfmath@local@args{#1}%
+ \pgfmath@local@@function}
+
+\def\pgfmath@local@function@body#1;{%
+ \def\pgfmath@local@body{#1}%
+ \begingroup%
+ \c@pgf@counta=0\relax%
+ \ifx\pgfmath@local@args\pgfmath@empty%
+ \expandafter\pgfmath@toks\expandafter=\expandafter{\pgfmath@local@body}%
+ \else%
+ \pgfmath@toks={}%
+ \expandafter\pgfmath@local@function@@body\pgfmath@local@args,,%
+ \fi%
+ \xdef\pgfmath@local@temp{%
+ \noexpand\pgfmathdeclarefunction{\pgfmath@local@name}{\the\c@pgf@counta}%
+ {\noexpand\pgfmathparse{\the\pgfmath@toks}}%
+ }%
+ \endgroup%
+ \pgfmath@local@temp%
+}
+
+\def\pgfmath@local@function@@body#1,{%
+ \def\pgfmath@local@test{#1}%
+ \ifx\pgfmath@local@test\pgfutil@empty%
+ \let\pgfmath@local@next=\relax%
+ \else%
+ \edef\pgfmath@local@var@string{@\expandafter\pgfmath@local@gobbleone\string#1}%
+ \advance\c@pgf@counta by1\relax%
+ \expandafter\expandafter\expandafter\pgfmath@toks\expandafter\expandafter\expandafter=%
+ \expandafter\expandafter\expandafter{\expandafter\pgfmath@char@hash\the\c@pgf@counta}%
+ \edef#1{\the\pgfmath@toks}%
+ \pgfmath@toks={}%
+ \expandafter\pgfmath@local@function@@@body\pgfmath@local@body @%
+ \edef\pgfmath@local@body{\the\pgfmath@toks}%
+ \let\pgfmath@local@next=\pgfmath@local@function@@body%
+ \fi%
+ \pgfmath@local@next%
+}
+
+\def\pgfmath@local@function@@@body{%
+ \pgfutil@ifnextchar\bgroup{\pgfmath@local@function@@@body@bgroup}%
+ {\pgfmath@local@function@@@body@nobgroup}}%
+
+\def\pgfmath@local@function@@@body@bgroup#1{%
+ \begingroup%
+ \pgfmath@toks={}%
+ \pgfmath@local@function@@@body#1 @%
+ \xdef\pgfmath@local@temp{{\the\pgfmath@toks}}%
+ \endgroup%
+ \expandafter\pgfmath@addto@toks\expandafter{\pgfmath@local@temp}%
+ \pgfmath@local@function@@@body%
+}
+
+\def\pgfmath@local@function@@@body@nobgroup#1{%
+ \ifx#1@%
+ \let\pgfmath@local@next=\relax%
+ \else%
+ \let\pgfmath@local@next=\pgfmath@local@function@@@body%
+ \edef\pgfmath@local@var@@string{@\expandafter\pgfmath@local@gobbleone\string#1}%
+ \ifx\pgfmath@local@var@@string\pgfmath@local@var@string%
+ \expandafter\pgfmath@addto@toks\expandafter{#1}%
+ \else%
+ \edef\pgfmath@local@temp{\the\pgfmath@toks}%
+ \pgfmath@toks={#1}%
+ \edef\pgfmath@local@@temp{\the\pgfmath@toks}%
+ \expandafter\pgfmath@toks\expandafter=\expandafter{\pgfmath@local@temp}%
+ \expandafter\pgfmath@addto@toks\expandafter{\pgfmath@local@@temp}%
+ \fi%
+ \fi%
+ \pgfmath@local@next%
+}
+
+% Allows to define 'x' as some \TeX command '#2'.
+\def\pgfmathdeclarepseudoconstant#1#2{%
+ \pgfmathdeclarefunction*{#1}{0}{#2}%
+}%
+% Redefines a pseudo constant '#1'.
+\def\pgfmathredeclarepseudoconstant#1#2{%
+ \pgfmathredeclarefunction{#1}{#2}%
+}%
+
+\input pgfmathfunctions.basic.code.tex
+\input pgfmathfunctions.trigonometric.code.tex
+\input pgfmathfunctions.random.code.tex
+\input pgfmathfunctions.comparison.code.tex
+\input pgfmathfunctions.base.code.tex
+\input pgfmathfunctions.round.code.tex
+\input pgfmathfunctions.misc.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex
new file mode 100644
index 00000000000..54a8d64220e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex
@@ -0,0 +1,179 @@
+% Copyright 2007 by Mark Wibrow
+%
+% 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.
+
+% This file defines the mathematical functions and operators.
+%
+% Version 1.4142135 11/8/2008
+
+\pgfmathdeclarefunction{greater}{2}{%
+ \begingroup%
+ \ifdim#1pt>#2pt\relax%
+ \def\pgfmathresult{1}%
+ \else%
+ \def\pgfmathresult{0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+\let\pgfmathgreaterthan=\pgfmathgreater
+
+\pgfmathdeclarefunction{less}{2}{%
+ \begingroup%
+ \ifdim#1pt<#2pt\relax%
+ \def\pgfmathresult{1}%
+ \else%
+ \def\pgfmathresult{0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+\let\pgfmathlessthan=\pgfmathless
+
+\pgfmathdeclarefunction{equal}{2}{%
+ \begingroup%
+ \ifdim#1pt=#2pt\relax%
+ \def\pgfmathresult{1}%
+ \else%
+ \def\pgfmathresult{0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+\let\pgfmathequalto=\pgfmathequal
+
+
+% approxequalto function from Christian Feuersanger.
+%
+\newif\ifpgfmathcomparison
+\pgfmathdeclarefunction{approxequalto}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@y=#2pt\relax%
+ \advance\pgfmath@x by-\pgfmath@y%
+ \ifdim\pgfmath@x<0pt\relax%
+ \multiply\pgfmath@x by-1\relax%
+ \fi
+ \ifdim\pgfmath@x<0.0001pt\relax%
+ \def\pgfmathresult{1.0}%
+ \global\pgfmathcomparisontrue%
+ \else%
+ \def\pgfmathresult{0.0}%
+ \global\pgfmathcomparisonfalse%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+
+
+% ifthenelse function.
+%
+\pgfmathdeclarefunction{ifthenelse}{3}{%
+ \begingroup%
+ \ifdim#1pt=0.0pt\relax%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{#3}%
+ \else%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{#2}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% notequal function.
+%
+\pgfmathdeclarefunction{notequal}{2}{%
+ \begingroup%
+ \ifdim#1pt=#2pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \def\pgfmathresult{1}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% notless function.
+%
+\pgfmathdeclarefunction{notless}{2}{%
+ \begingroup%
+ \ifdim#1pt<#2pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \def\pgfmathresult{1}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% notgreater function.
+%
+\pgfmathdeclarefunction{notgreater}{2}{%
+ \begingroup%
+ \ifdim#1pt>#2pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \def\pgfmathresult{1}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% and function.
+%
+\pgfmathdeclarefunction{and}{2}{%
+ \begingroup%
+ \def\pgfmathresult{1}%
+ \ifdim#1pt=0pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \ifdim#2pt=0pt\relax%
+ \def\pgfmathresult{0}%
+ \fi%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% or function.
+%
+\pgfmathdeclarefunction{or}{2}{%
+ \begingroup%
+ \def\pgfmathresult{0}%
+ \ifdim#1pt=0pt\relax%
+ \ifdim#2pt=0pt\relax%
+ \else%
+ \def\pgfmathresult{1}%
+ \fi%
+ \else%
+ \def\pgfmathresult{1}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% not function.
+%
+\pgfmathdeclarefunction{not}{1}{%
+ \begingroup%
+ \ifdim#1pt=0pt\relax%
+ \def\pgfmathresult{1}%
+ \else%
+ \def\pgfmathresult{0}%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% true function.
+%
+\pgfmathdeclarefunction{true}{0}{\def\pgfmathresult{1}}
+
+% false function.
+%
+\pgfmathdeclarefunction{false}{0}{\def\pgfmathresult{0}}
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
new file mode 100644
index 00000000000..65460e4b3cc
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex
@@ -0,0 +1,320 @@
+% Copyright 2007 by Mark Wibrow
+%
+% 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.
+
+% This file defines the mathematical functions and operators.
+%
+% Version 1.414213 29/9/2007
+
+% veclen function adpated from ideas due to Rouben Rostamian.
+%
+% Calcluate the Eulidean length of a 2D vector.
+%
+%
+\pgfmathdeclarefunction{veclen}{2}{%
+ \begingroup%
+ \pgfmath@x#1pt\relax%
+ \pgfmath@y#2pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \pgfmath@x-\pgfmath@x%
+ \fi%
+ \ifdim\pgfmath@y<0pt\relax%
+ \pgfmath@y-\pgfmath@y%
+ \fi%
+ \ifdim\pgfmath@x=0pt\relax%
+ \pgfmath@x\pgfmath@y%
+ \else%
+ \ifdim\pgfmath@y=0pt\relax%
+ \else%
+ \ifdim\pgfmath@x>\pgfmath@y%
+ \pgfmath@xa\pgfmath@x%
+ \pgfmath@x\pgfmath@y%
+ \pgfmath@y\pgfmath@xa%
+ \fi%
+ % We use a scaling factor to reduce errors.
+ \ifdim\pgfmath@y>10000pt\relax%
+ \c@pgfmath@counta1500\relax%
+ \else%
+ \ifdim\pgfmath@y>1000pt\relax%
+ \c@pgfmath@counta150\relax%
+ \else%
+ \ifdim\pgfmath@y>100pt\relax%
+ \c@pgfmath@counta50\relax%
+ \else%
+ \c@pgfmath@counta1\relax%
+ \fi%
+ \fi%
+ \fi%
+ \divide\pgfmath@x\c@pgfmath@counta\relax%
+ \divide\pgfmath@y\c@pgfmath@counta\relax%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgfmath@y}}%
+ \pgfmath@x\pgfmathresult\pgfmath@x%
+ \pgfmath@xa\pgfmath@tonumber{\pgfmath@x}\pgfmath@x%
+ \edef\pgfmath@temp{\pgfmath@tonumber{\pgfmath@xa}}%
+ %
+ % Use A+x^2*(B+x^2*(C+x^2*(D+E*x^2)))
+ % where
+ % A = +1.000012594
+ % B = +0.4993615349
+ % C = -0.1195159052
+ % D = +0.04453994279
+ % E = -0.01019210944
+ %
+ \pgfmath@x-0.01019210944\pgfmath@xa%
+ \advance\pgfmath@x0.04453994279pt\relax%
+ \pgfmath@x\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x-0.1195159052pt\relax%
+ \pgfmath@x\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x0.4993615349pt\relax%
+ \pgfmath@x\pgfmath@temp\pgfmath@x%
+ \advance\pgfmath@x1.000012594pt\relax%
+ \ifdim\pgfmath@y<0pt\relax%
+ \pgfmath@y-\pgfmath@y%
+ \fi%
+ \pgfmath@x\pgfmath@tonumber{\pgfmath@y}\pgfmath@x%
+ % Invert the scaling factor.
+ \multiply\pgfmath@x\c@pgfmath@counta\relax%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+% Hyperbolic functions contributed by Martin Heller.
+%
+\pgfmathdeclarefunction{cosh}{1}{%
+ \begingroup
+ \edef\pgfmath@arg{#1}%
+ \pgfmathexp@{\pgfmath@arg}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmathexp@{-\pgfmath@arg}%
+ \advance\pgfmath@x by\pgfmathresult pt\relax%
+ \divide\pgfmath@x by2\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup}
+
+\pgfmathdeclarefunction{sinh}{1}{%
+ \begingroup
+ \edef\pgfmath@arg{#1}%
+ \pgfmathexp@{\pgfmath@arg}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmathexp@{-\pgfmath@arg}%
+ \advance\pgfmath@x by-\pgfmathresult pt\relax%
+ \divide\pgfmath@x by2\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup
+}%
+
+\pgfmathdeclarefunction{tanh}{1}{%
+ \begingroup
+ \edef\pgfmath@arg{#1}%
+ \pgfmathsinh@{\pgfmath@arg}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmathcosh@{\pgfmath@arg}%
+ \pgfmath@y=\pgfmathresult pt\relax%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgfmath@x}}{\pgfmath@tonumber{\pgfmath@y}}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup
+}%
+
+% \pgfmathscientific
+%
+% Return the value of #1e#2
+%
+% e.g. \pgfmathscientific{1.23456789123}{4}
+%
+% defines \pgfmathresult as 12345.67891
+%
+% NB These arguments *are not parsed*, as the long mantissa would be lost.
+%
+\def\pgfmathscientific#1#2{%
+ \begingroup%
+ \edef\pgfmath@sci@exponent{#2}%
+ \pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \pgfmath@x-\pgfmath@x%
+ \edef\pgfmath@sci@sign{-}%
+ \expandafter\edef\expandafter\pgfmath@temp\expandafter{\expandafter\pgfmath@gobbleone#1}%
+ \else%
+ \edef\pgfmath@sci@sign{+}%
+ \edef\pgfmath@temp{#1}%
+ \fi%
+ \expandafter\pgfmath@in@\expandafter.\expandafter{#1}%
+ \ifpgfmath@in@%
+ \else%
+ \edef\pgfmath@temp{\pgfmath@temp.0}%
+ \fi%
+ \expandafter\pgfmath@scientific@@\pgfmath@temp00000000000\pgfmath@}
+
+\def\pgfmath@scientific@@#1.#2#3#4#5#6{%
+ \edef\pgfmath@sci@int{#1}%
+ \edef\pgfmath@sci@mantissaA{#2#3#4#5#6}%
+ \pgfmath@scientific@@@}
+
+\def\pgfmath@scientific@@@#1#2#3#4#5#6\pgfmath@{%
+ \edef\pgfmath@sci@mantissaB{#1#2#3#4#5}%
+ \c@pgfmath@counta\pgfmath@sci@exponent\relax%
+ \c@pgfmath@countb\c@pgfmath@counta%
+ \ifnum\c@pgfmath@counta<0\relax%
+ \c@pgfmath@counta-\c@pgfmath@counta%
+ \fi%
+ \pgfmathpow@{10}{\the\c@pgfmath@counta}%
+ \afterassignment\pgfmath@gobbletilpgfmath@
+ \c@pgfmath@countc\pgfmathresult\relax\pgfmath@
+ \edef\pgfmath@sci@factor{\the\c@pgfmath@countc}%
+ \ifnum\c@pgfmath@countb<0\relax%
+ % xE-y: easy...
+ \pgfmath@x\pgfmath@sci@int.\pgfmath@sci@mantissaA pt\relax%
+ \divide\pgfmath@x\pgfmath@sci@factor\relax%
+ \else%
+ % xE+y:
+ % Must do this way so as not lose digits in a long mantissa. Sigh...
+ \c@pgfmath@counta\pgfmath@sci@int%
+ \c@pgfmath@countb\pgfmath@sci@mantissaA%
+ \multiply\c@pgfmath@counta\pgfmath@sci@factor\relax%
+ \multiply\c@pgfmath@countb\pgfmath@sci@factor\relax%
+ \c@pgfmath@countc\c@pgfmath@countb%
+ \divide\c@pgfmath@countb100000\relax%
+ \advance\c@pgfmath@counta\c@pgfmath@countb%
+ \multiply\c@pgfmath@countb100000\relax%
+ \advance\c@pgfmath@countc-\c@pgfmath@countb%
+ \c@pgfmath@countb\pgfmath@sci@mantissaB\relax%
+ \multiply\c@pgfmath@countb\pgfmath@sci@factor\relax%
+ \divide\c@pgfmath@countb100000\relax%
+ \advance\c@pgfmath@countc\c@pgfmath@countb%
+ \advance\c@pgfmath@countc100000\relax%
+ \edef\pgfmath@sci@result{\pgfmath@sci@sign\the\c@pgfmath@counta.\expandafter\pgfmath@gobbleone\the\c@pgfmath@countc pt}%
+ \pgfmath@x\pgfmath@sci@result\relax%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup}
+
+
+
+% width function.
+%
+\pgfmathdeclarefunction{width}{1}{%
+ \begingroup%
+ \setbox\pgfmath@box=\hbox{{\pgfmath@selectfont{#1}}}%
+ \pgfmath@x=\wd\pgfmath@box%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+
+% height function.
+%
+\pgfmathdeclarefunction{height}{1}{%
+ \begingroup%
+ \setbox\pgfmath@box=\hbox{{\pgfmath@selectfont{#1}}}%
+ \pgfmath@x=\ht\pgfmath@box%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+% depth function.
+%
+\pgfmathdeclarefunction{depth}{1}{%
+ \begingroup%
+ \setbox\pgfmath@box=\hbox{{\pgfmath@selectfont{#1}}}%
+ \pgfmath@x=\dp\pgfmath@box%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
+
+
+% array function.
+%
+\pgfmathdeclarefunction{array}{2}{%
+ \begingroup%
+ \afterassignment\pgfmath@gobbletilpgfmath@\pgfmath@count=#2\relax\pgfmath@%
+ \expandafter\pgfmatharray@@#1\pgfmath@stop%
+}
+
+\def\pgfmath@token@stop{\pgfmath@stop}%
+\def\pgfmatharray@@#1{%
+ \def\pgfmath@temp{#1}%
+ \advance\pgfmath@count by-1\relax%
+ \ifx\pgfmath@temp\pgfmath@token@stop%
+ \pgfmath@error{Array index out of bounds.}{}%
+ \def\pgfmathresult{0}%
+ \pgfmath@smuggleone\pgfmathresult\endgroup%
+ \let\pgfmath@next=\relax%
+ \else%
+ \ifnum\pgfmath@count=-1\relax%
+ \def\pgfmathresult{#1}%
+ \let\pgfmath@next=\pgfmatharray@@@%
+ \else%
+ \let\pgfmath@next=\pgfmatharray@@%
+ \fi%
+ \fi%
+ \pgfmath@next}
+
+\def\pgfmatharray@@@#1\pgfmath@stop{%
+ \pgfmath@smuggleone\pgfmathresult\endgroup%
+}
+
+
+% max function.
+%
+\pgfmathdeclarefunction{max}{...}{%
+ \begingroup%
+ \pgfmath@x=-16383pt\relax%
+ \pgfmathmax@@#1{}}
+
+\def\pgfmathmax@@#1{%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \let\pgfmath@next=\pgfmathmax@@@%
+ \else%
+ \ifdim#1pt>\pgfmath@x%
+ \pgfmath@x=#1pt\relax%
+ \fi%
+ \let\pgfmath@next=\pgfmathmax@@%
+ \fi%
+ \pgfmath@next}
+
+\def\pgfmathmax@@@{\pgfmath@returnone\pgfmath@x\endgroup}%
+
+% For compatability with old code.
+\def\pgfmathmax#1#2{%
+ \pgfmathparse{getargs(#1,#2)}%
+ \expandafter\pgfmathmax@\expandafter{\pgfmathresult}%
+}
+
+% min function.
+%
+\pgfmathdeclarefunction{min}{...}{%
+ \begingroup%
+ \pgfmath@x=16383pt\relax%
+ \pgfmathmin@@#1{}}
+
+\def\pgfmathmin@@#1{%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \let\pgfmath@next=\pgfmathmin@@@%
+ \else%
+ \ifdim#1pt<\pgfmath@x%
+ \pgfmath@x=#1pt\relax%
+ \fi%
+ \let\pgfmath@next=\pgfmathmin@@%
+ \fi%
+ \pgfmath@next}
+
+\def\pgfmathmin@@@{\pgfmath@returnone\pgfmath@x\endgroup}%
+
+% For compatability with old code.
+\def\pgfmathmin#1#2{%
+ \pgfmathparse{getargs(#1,#2)}%
+ \expandafter\pgfmathmin@\expandafter{\pgfmathresult}%
+}
+
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathrnd.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
index ea8d5bb3092..2811d67c101 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathrnd.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
@@ -39,8 +39,8 @@
%
% #1 -> the new seed.
%
-\def\pgfmathsetseed#1{\pgfmathparse{#1}\expandafter\pgfmath@setseed\pgfmathresult\relax}%
-\def\pgfmath@setseed#1.#2\relax{\def\pgfmath@rnd@z{#1}}%
+\def\pgfmathsetseed#1{\pgfmathparse{#1}\expandafter\pgfmath@setseed\pgfmathresult.0\pgfmath@stop}%
+\def\pgfmath@setseed#1.#2\pgfmath@stop{\def\pgfmath@rnd@z{#1}}%
% Alternative paramaters - see Press et al (1992) p278-279,
% for discussion.
@@ -86,7 +86,7 @@
%
% Generates a pseudo-random number between 0 and 1.
%
-\def\pgfmathrnd{%
+\pgfmathdeclarefunction{rnd}{0}{%
\begingroup%
\pgfmathgeneratepseudorandomnumber%
\c@pgfmath@counta\pgfmathresult%
@@ -95,12 +95,12 @@
\multiply\c@pgfmath@countb-100001\relax%
\advance\c@pgfmath@countb\c@pgfmath@counta%
\advance\c@pgfmath@countb1000000\relax%
- \expandafter\pgfmathrnd@\the\c@pgfmath@countb\pgfmath@%
+ \expandafter\pgfmathrnd@@\the\c@pgfmath@countb\pgfmath@%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}%
-\def\pgfmathrnd@#1#2#3\pgfmath@{%
+\def\pgfmathrnd@@#1#2#3\pgfmath@{%
\edef\pgfmath@temp{#2.#3}%
\pgfmath@x=\pgfmath@temp pt\relax%
}%
@@ -109,7 +109,7 @@
%
% Generates a pseudo-random number between -1 and 1.
%
-\def\pgfmathrand{%
+\pgfmathdeclarefunction{rand}{0}{%
\begingroup%
\pgfmathgeneratepseudorandomnumber%
\c@pgfmath@counta\pgfmathresult%
@@ -123,12 +123,12 @@
\else%
\advance\c@pgfmath@countb1000000\relax%
\fi%
- \expandafter\pgfmathrand@\the\c@pgfmath@countb\pgfmath@%
+ \expandafter\pgfmathrand@@\the\c@pgfmath@countb\pgfmath@%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}%
-\def\pgfmathrand@#1#2#3#4\pgfmath@{%
+\def\pgfmathrand@@#1#2#3#4\pgfmath@{%
\ifx#1-%
\edef\pgfmath@temp{-#3.#4}%
\else%
@@ -137,6 +137,32 @@
\pgfmath@x=\pgfmath@temp pt\relax%
}%
+\pgfmathdeclarefunction{random}{...}{%
+ \begingroup%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \pgfmathrnd@%
+ \else%
+ \expandafter\pgfmathrandom@@#1\pgfmath@stop%
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
+
+\def\pgfmathrandom@@{\futurelet\pgfmath@token\pgfmathrandom@@@}
+\def\pgfmathrandom@@@{%
+ \ifx\pgfmath@token\bgroup%
+ \expandafter\pgfmath@random@@@@%
+ \else%
+ \expandafter\pgfmath@random@@@@@%
+ \fi%
+}
+\def\pgfmath@random@@@@@#1\pgfmath@stop{%
+ \pgfmathrandominteger\pgfmathresult{1}{#1}%
+}
+\def\pgfmath@random@@@@#1#2\pgfmath@stop{%
+ \pgfmathrandominteger\pgfmathresult{#1}{#2}%
+}
+
% \pgfmathrandominteger
%
% Return a 'randomly' selected integer in the range #2 - #3 (inclusive).
@@ -209,4 +235,5 @@
\pgfmath@ifundefined{pgfmath@randomlist@#2}{\pgfmath@error{Unknown random list `#2'}}{%
\edef\pgfmath@randomlistlength{\csname pgfmath@randomlist@#2\endcsname}%
\pgfmathrandominteger{\pgfmath@randomtemp}{1}{\pgfmath@randomlistlength}%
- \def#1{\csname pgfmath@randomlist@#2@\pgfmath@randomtemp\endcsname}}} \ No newline at end of file
+ \def#1{\csname pgfmath@randomlist@#2@\pgfmath@randomtemp\endcsname}}}
+ \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
new file mode 100644
index 00000000000..03f9ca270ae
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
@@ -0,0 +1,112 @@
+% Copyright 2007 by Mark Wibrow
+%
+% 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.
+
+% This file defines the mathematical functions and operators.
+%
+% Version 1.414213 29/9/2007
+
+% round function. Uses asymmetric half-up rounding.
+%
+\pgfmathdeclarefunction{round}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@xa%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
+ \pgfmath@xb\pgfmath@x%
+ \ifdim\pgfmath@xb<0pt\relax%
+ \ifdim\pgfmath@xa<0.5pt\relax%
+ \else%
+ \advance\c@pgfmath@counta-1\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@xa<0.5pt\relax%
+ \else%
+ \advance\c@pgfmath@counta1\relax%
+ \fi%
+ \fi%
+ \pgfmath@returnone\the\c@pgfmath@counta pt%
+ \endgroup%
+}%
+
+% floor function.
+%
+\pgfmathdeclarefunction{floor}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \advance\c@pgfmath@counta by -1\relax%
+ \fi%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+
+% ceil function.
+%
+\pgfmathdeclarefunction{ceil}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \pgfmath@y\pgfmath@x%
+ \advance\pgfmath@y-\c@pgfmath@counta pt\relax%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \ifdim\pgfmath@y>0pt\relax%
+ \advance\pgfmath@x1pt\relax%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+
+% int function
+%
+\pgfmathdeclarefunction{int}{1}{%
+ \begingroup%
+ \expandafter\pgfmathint@@#1.\pgfmath@stop
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
+
+\def\pgfmathint@@#1.#2\pgfmath@stop{%
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \def\pgfmathresult{0}%
+ \else%
+ \pgfmath@in@{#1}{+-+0-0}%
+ \ifpgfmath@in@
+ \def\pgfmathresult{0}%
+ \else%
+ \def\pgfmathresult{#1}%
+ \fi%
+ \fi}
+
+% frac function.
+%
+\pgfmathdeclarefunction{frac}{1}{%
+ \begingroup%
+ \expandafter\pgfmathfrac@@#1.\pgfmath@stop%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
+
+\def\pgfmathfrac@@#1.{%
+ \pgfmath@ifnextchar\pgfmath@stop{\def\pgfmathresult{0.0}\pgfmath@gobbleone}{\pgfmathfrac@@@}%
+}
+\def\pgfmathfrac@@@#1.\pgfmath@stop{\def\pgfmathresult{0.#1}}
+
+% real function.
+%
+\pgfmathdeclarefunction{real}{1}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathtrig.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex
index 20d86dd8bdf..6b60eb7ec16 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathtrig.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-% This file defines the trigonometric functions/operations.
+% This file defines the trigonometric functions/functions.
%
% Much of this file is based on ideas and code (particularly
% the old \pgfcoremath.code.tex) due to Till Tantau.
@@ -16,18 +16,14 @@
% \pgfmathpi
%
-\def\pgfmathpi{\edef\pgfmathresult{\pgfmath@pi}}
-\def\pgfmath@pi{3.14159}
+\pgfmathdeclarefunction{pi}{0}{\def\pgfmathresult{3.141592654}}
% \pgfmathradians
% (for comptability with 1.18 beta, will be deprecated)
%
% Convert #1 from radians to degrees (accurate to 1 deg).
%
-\def\pgfmathradians#1{%
- \pgfmathparse{#1}%
- \pgfmathradians@{\pgfmathresult}}
-\def\pgfmathradians@#1{%
+\pgfmathdeclarefunction{radians}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@x57.29577\pgfmath@x\relax% 57.29577 = 360/(2*pi)
@@ -39,10 +35,7 @@
%
% Convert #1 from radians to degrees.
%
-\def\pgfmathdeg#1{%
- \pgfmathparse{#1}%
- \pgfmathdeg@{\pgfmathresult}}
-\def\pgfmathdeg@#1{%
+\pgfmathdeclarefunction{deg}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@x57.29577\pgfmath@x\relax% 57.29577 = 360/(2*pi)
@@ -54,10 +47,7 @@
%
% Convert #1 from degrees to radians.
%
-\def\pgfmathrad#1{%
- \pgfmathparse{#1}%
- \pgfmathrad@{\pgfmathresult}}
-\def\pgfmathrad@#1{%
+\pgfmathdeclarefunction{rad}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@x3.14159\pgfmath@x%
@@ -70,10 +60,7 @@
%
% Calculate the sine of #1 (in degrees).
%
-\def\pgfmathsin#1{%
- \pgfmathparse{#1}%
- \pgfmathsin@{\pgfmathresult}}
-\def\pgfmathsin@#1{%
+\pgfmathdeclarefunction{sin}{1}{%
% Let #1 = a.b
% Then sin(#1) \approx (1-b)*sin(a) + b*sin(a+1)
%
@@ -114,10 +101,7 @@
%
% Calculate the cosine of #1 (in degrees).
%
-\def\pgfmathcos#1{%
- \pgfmathparse{#1}%
- \expandafter\pgfmathcos@\expandafter{\pgfmathresult}}
-\def\pgfmathcos@#1{%
+\pgfmathdeclarefunction{cos}{1}{%
% Let x = a.b
% Then cos(x) \approx (1-b)*cos(a) + b*cos(a+1)
%
@@ -171,10 +155,7 @@
%
% Calculate the tangent of #1 (in degrees).
%
-\def\pgfmathtan#1{%
- \pgfmathparse{#1}%
- \pgfmathtan@{\pgfmathresult}}
-\def\pgfmathtan@#1{%
+\pgfmathdeclarefunction{tan}{1}{%
\begingroup%
\edef\pgfmath@temparg{#1}%
\pgfmathcos@{\pgfmath@temparg}%
@@ -183,19 +164,6 @@
\pgfmathsin@{\pgfmath@temparg}%
\pgfmath@x\pgfmathresult pt\relax%
\pgfmath@x\pgfmath@tantemp\pgfmath@x%
- \ifdim\pgfmath@x<0pt\relax%
- \c@pgfmath@countb-1\relax%
- \else%
- \c@pgfmath@countb1\relax%
- \fi%
- % Adjust to 4 decimal places. This gets rid of some annoyingly tiny errors.
- \afterassignment\pgfmath@x%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
- \ifdim\pgfmath@x<.0001pt\relax%
- \pgfmath@x0pt\relax%
- \fi%
- \advance\pgfmath@x\c@pgfmath@counta pt%
- \multiply\pgfmath@x\c@pgfmath@countb%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}
@@ -204,10 +172,7 @@
%
% Calculate the cosec of #1 (in degrees).
%
-\def\pgfmathcosec#1{%
- \pgfmathparse{#1}%
- \pgfmathcosec@{\pgfmathresult}}
-\def\pgfmathcosec@#1{%
+\pgfmathdeclarefunction{cosec}{1}{%
\expandafter\pgfmathsin@\expandafter{#1}%
\pgfmathreciprocal@{\pgfmathresult}%
}
@@ -216,10 +181,7 @@
%
% Calculate the sec of #1 (in degrees).
%
-\def\pgfmathsec#1{%
- \pgfmathparse{#1}%
- \pgfmathsec@{\pgfmathresult}}
-\def\pgfmathsec@#1{%
+\pgfmathdeclarefunction{sec}{1}{%
\expandafter\pgfmathcos@\expandafter{#1}%
\pgfmathreciprocal@{\pgfmathresult}%
}
@@ -228,10 +190,7 @@
%
% Calculate the cotangent of #1 (in degrees).
%
-\def\pgfmathcot#1{%
- \pgfmathparse{#1}%
- \pgfmathcot@{\pgfmathresult}}
-\def\pgfmathcot@#1{%
+\pgfmathdeclarefunction{cot}{1}{%
\begingroup%
\edef\pgfmath@temparg{#1}%
\pgfmathsin@{\pgfmath@temparg}%
@@ -240,19 +199,6 @@
\pgfmathcos@{\pgfmath@temparg}%
\pgfmath@x\pgfmathresult pt\relax%
\pgfmath@x\pgfmath@tantemp\pgfmath@x%
- \ifdim\pgfmath@x<0pt\relax%
- \c@pgfmath@countb-1\relax%
- \else%
- \c@pgfmath@countb1\relax%
- \fi%
- % Adjust to 4 decimal places. This gets rid of some annoyingly tiny errors.
- \afterassignment\pgfmath@x%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
- \ifdim\pgfmath@x<.0001pt\relax%
- \pgfmath@x0pt\relax%
- \fi%
- \advance\pgfmath@x\c@pgfmath@counta pt%
- \multiply\pgfmath@x\c@pgfmath@countb%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}
@@ -261,10 +207,7 @@
%
% The asin of #1
%
-\def\pgfmathasin#1{%
- \pgfmathparse{#1}%
- \expandafter\pgfmathasin@\expandafter{\pgfmathresult}}
-\def\pgfmathasin@#1{%
+\pgfmathdeclarefunction{asin}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@xa\pgfmath@x%
@@ -287,10 +230,7 @@
%
% The acos of #1
%
-\def\pgfmathacos#1{%
- \pgfmathparse{#1}%
- \expandafter\pgfmathacos@\expandafter{\pgfmathresult}}
-\def\pgfmathacos@#1{%
+\pgfmathdeclarefunction{acos}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@xa\pgfmath@x%
@@ -303,19 +243,13 @@
\expandafter\pgfmath@x\csname pgfmath@acos@\the\c@pgfmath@counta\endcsname pt\relax%
\ifdim\pgfmath@xa<0pt\relax%
\pgfmath@x-\pgfmath@x%
+ \advance\pgfmath@x by180pt\relax%
\fi%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}
-% \pgfmathasin
-%
-% The atan of #1
-%
-\def\pgfmathatan#1{%
- \pgfmathparse{#1}%
- \expandafter\pgfmathatan@\expandafter{\pgfmathresult}}
-\def\pgfmathatan@#1{%
+\pgfmathdeclarefunction{atan}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
\pgfmath@xa\pgfmath@x%
@@ -344,7 +278,40 @@
\endgroup%
}
-
+\pgfmathdeclarefunction{atan2}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \pgfmath@x=-\pgfmath@x%
+ \fi%
+ \ifdim\pgfmath@x<0.001pt\relax%
+ \ifdim#2pt<0pt\relax%
+ \pgfmath@x=-90pt\relax%
+ \else%
+ \ifdim#2pt>0pt\relax%
+ \pgfmath@x=90pt\relax%
+ \else%
+ \pgfmath@x=0pt\relax%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathdivide@{#2}{#1}%
+ \expandafter\pgfmathatan@\expandafter{\pgfmathresult}%
+ \pgfmath@x=\pgfmathresult pt\relax%
+ \ifdim#2pt<0pt\relax%
+ \ifdim#1pt<0pt\relax%
+ \advance\pgfmath@x by-180pt\relax%
+ \fi%
+ \else%
+ \ifdim#1pt<0pt\relax%
+ \advance\pgfmath@x by180pt\relax%
+ \fi%
+ \fi%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
\def\pgfmath@def#1#2#3{\expandafter\def\csname pgfmath@#1@#2\endcsname{#3}}
\pgfmath@def{cos}{0}{1.00000} \pgfmath@def{cos}{1}{0.99985}
\pgfmath@def{cos}{2}{0.99939} \pgfmath@def{cos}{3}{0.99863}
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathoperations.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathoperations.code.tex
deleted file mode 100644
index 452b9fa0b2c..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathoperations.code.tex
+++ /dev/null
@@ -1,1488 +0,0 @@
-% Copyright 2007 by Mark Wibrow
-%
-% 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.
-
-% This file defines the mathematical functions and operators.
-%
-% Version 1.414213 29/9/2007
-
-% This file defines the mathematical functions and operators.
-%
-% Adding/redefining extra operators/functions:
-%
-% Each operator/function XXX has two forms:
-%
-%
-% \pgfmathXXX#1... a public version which evaluates any
-% arguments passed to it and passes the
-% results on to...
-%
-% \pgfmathXXX@#1... a non-public version which performs
-% required calculation on arguments which
-% must have already been evaluated (i.e.
-% *without* dimensions).
-%
-% If a function XXX is to be included in the parser, it is
-% recommended, for consistency, that where possible, the
-% pgfmathparser file should define the macro \pgfmath@parseXXX.
-% The parser should (ideally) then call \pgfmathXXX@.
-%
-% It is also recommened that all calculations (where necessary)
-% take place within a TeX group. \pgfmath@returnone#1 makes and
-% expanded version of #1 global and stores this in \pgfmathresult
-% after the group is ended.
-%
-
-\input pgfmathtrig.code.tex% Load the trig. stuff.
-\input pgfmathrnd.code.tex% Load the random stuff.
-
-
-% \pgfmathadd
-%
-% Add #1 and #2.
-%
-\def\pgfmathadd#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathadd@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathadd@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \advance\pgfmath@x by\pgfmath@y%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathsubtract
-%
-% Subtract #2 from #1.
-%
-\def\pgfmathsubtract#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathsubtract@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathsubtract@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \advance\pgfmath@x-\pgfmath@y%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathmultiply
-%
-% Multiply #1 by #2.
-%
-\def\pgfmathmultiply#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathmultiply@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathmultiply@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \pgfmath@x\pgfmath@tonumber{\pgfmath@y}\pgfmath@x%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathdivide
-%
-% Divide #1 by #2.
-%
-\def\pgfmathdivide#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathdivide@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathdivide@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \def\pgfmath@sign{}%
- \ifdim\pgfmath@y=0pt\relax%
- \pgfmath@error{You've asked me to divide `#1' by `#2', %
- but I cannot divide any number by `#2'}%
- \fi%
- \afterassignment\pgfmath@xa%
- \expandafter\c@pgfmath@counta\the\pgfmath@y\relax%
- %
- % If y is an integer, use TeX arithmatic.
- %
- \ifdim\pgfmath@xa=0pt\relax%
- \divide\pgfmath@x\c@pgfmath@counta\relax%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
- \let\pgfmath@next\pgfmathdivide@@@%
- \else%
- %
- % Simple long division.
- %
- \ifdim\pgfmath@x<0pt\relax%
- \def\pgfmath@sign{-}%
- \pgfmath@x-\pgfmath@x%
- \fi%
- \ifdim\pgfmath@y<0pt\relax%
- \edef\pgfmath@sign{\pgfmath@sign-}%
- \pgfmath@y-\pgfmath@y%
- \fi%
- \pgfmath@ya\pgfmath@y%
- \c@pgfmath@counta0\relax%
- \ifdim\pgfmath@x>\pgfmath@ya%
- \ifdim\pgfmath@ya<1638.4pt\relax%
- \pgfmathmultiply@dimenbyten\pgfmath@ya%
- \ifdim\pgfmath@ya>\pgfmath@x%
- \pgfmathdivide@dimenbyten\pgfmath@ya%
- \c@pgfmath@counta0\relax%
- \else%
- \ifdim\pgfmath@ya<1638.4pt\relax%
- \pgfmathmultiply@dimenbyten\pgfmath@ya%
- \ifdim\pgfmath@ya>\pgfmath@x%
- \pgfmathdivide@dimenbyten\pgfmath@ya%
- \c@pgfmath@counta1\relax%
- \else%
- \ifdim\pgfmath@ya<1638.4pt\relax%
- \pgfmathmultiply@dimenbyten\pgfmath@ya%
- \ifdim\pgfmath@ya>\pgfmath@x%
- \pgfmathdivide@dimenbyten\pgfmath@ya%
- \c@pgfmath@counta2\relax%
- \else%
- \ifdim\pgfmath@ya<1638.4pt\relax%
- \pgfmathmultiply@dimenbyten\pgfmath@ya%
- \ifdim\pgfmath@ya>\pgfmath@x%
- \pgfmathdivide@dimenbyten\pgfmath@ya%
- \c@pgfmath@counta3\relax%
- \else%
- \pgfmath@error{The result of `#1/#2' is too big for me}{}%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- %
- % If y < 1pt use reciprocal operation.
- %
- \ifdim\pgfmath@y<1pt\relax%
- \ifdim\pgfmath@y<.00007pt\relax%
- \pgfmath@error{The result of `#1/#2' is too big for me}{}%
- \fi%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgfmath@y}}%
- \pgfmath@x\pgfmathresult\pgfmath@x%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
- \let\pgfmath@next\pgfmathdivide@@@%
- \else%
- \pgfmath@y\pgfmath@ya%
- \def\pgfmathresult{}%
- \let\pgfmath@next\pgfmathdivide@@%
- \fi%
- \fi%
- \pgfmath@next%
-}
-
-\def\pgfmathdivide@dimenbyten#1{%
- \edef\pgfmath@temp{\pgfmath@tonumber{#1}}%
- \expandafter\pgfmathdivide@@dimenbyten\pgfmath@temp\@@#1\@@}
-\def\pgfmathdivide@@dimenbyten#1.#2\@@#3\@@{%
- \pgfmath@tempcnta#1\relax%
- \divide\pgfmath@tempcnta10\relax%
- \pgfmath@tempcntb\pgfmath@tempcnta%
- \multiply\pgfmath@tempcnta-10\relax%
- \advance\pgfmath@tempcnta#1\relax%
- #3\the\pgfmath@tempcntb.\the\pgfmath@tempcnta#2pt\relax%
-}
-
-\def\pgfmathmultiply@dimenbyten#1{%
- \edef\pgfmath@temp{\pgfmath@tonumber{#1}}%
- \expandafter\pgfmathmultiply@@dimenbyten\pgfmath@temp\@@#1\@@}
-\def\pgfmathmultiply@@dimenbyten#1.#2#3\@@#4\@@{#4#1#2.#3pt\relax}
-
-\def\pgfmathdivide@@{%
- \ifdim\pgfmath@x>\pgfmath@y%
- \pgfmath@yb6.0\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 6*y
- \advance\pgfmath@yb-\pgfmath@y%
- \advance\pgfmath@yb-\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 4*y
- \advance\pgfmath@yb-\pgfmath@y%
- \advance\pgfmath@yb-\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 2*y
- \advance\pgfmath@yb-\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 1*y
- \c@pgfmath@countb0\relax%
- \else%
- \c@pgfmath@countb1\relax%
- \fi%
- \else%
- \advance\pgfmath@yb\pgfmath@y% 3*y
- \ifdim\pgfmath@yb>\pgfmath@x%
- \c@pgfmath@countb2\relax%
- \else%
- \c@pgfmath@countb3\relax%
- \fi%
- \fi%
- \else%
- \advance\pgfmath@yb\pgfmath@y% 5*y
- \ifdim\pgfmath@yb>\pgfmath@x%
- \c@pgfmath@countb4\relax%
- \else%
- \c@pgfmath@countb5\relax%
- \fi%
- \fi%
- \else%
- \advance\pgfmath@yb\pgfmath@y%
- \advance\pgfmath@yb\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 8*y
- \advance\pgfmath@yb-\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 7*y
- \c@pgfmath@countb6\relax%
- \else%
- \c@pgfmath@countb7\relax%
- \fi%
- \else%
- \advance\pgfmath@yb\pgfmath@y%
- \ifdim\pgfmath@yb>\pgfmath@x% 9*y
- \c@pgfmath@countb8\relax%
- \else%
- \c@pgfmath@countb9\relax%
- \fi%
- \fi%
- \fi%
- \else%
- \c@pgfmath@countb=0\relax%
- \fi%
- \ifnum\c@pgfmath@countb=0\relax%
- \edef\pgfmathresult{\pgfmathresult0}%
- \else%
- \pgfmath@yb\c@pgfmath@countb\pgfmath@y%
- \advance\pgfmath@x-\pgfmath@yb%
- \edef\pgfmathresult{\pgfmathresult\the\c@pgfmath@countb}%
- \fi%
- \pgfmathdivide@dimenbyten\pgfmath@y%
- \ifnum\c@pgfmath@counta=0\relax%
- \edef\pgfmathresult{\pgfmathresult.}%
- \fi%
- \advance\c@pgfmath@counta-1\relax%
- \ifdim\pgfmath@y=0pt\relax%
- \let\pgfmath@next\pgfmathdivide@@@%
- \else%
- \let\pgfmath@next\pgfmathdivide@@%
- \fi%
- \pgfmath@next%
-}
-
-\def\pgfmathdivide@@@{%
- \pgfmath@x\pgfmath@sign\pgfmathresult pt\relax%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-
-% \pgfmathgreaterthan
-%
-% 1.0 if #1 > #2. Otherwise 0.0
-%
-\def\pgfmathgreaterthan#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathgreaterthan@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathgreaterthan@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \advance\pgfmath@x-\pgfmath@y%
- \ifdim\pgfmath@x>0pt\relax%
- \pgfmath@x1pt\relax%
- \else%
- \pgfmath@x0pt\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathlessthan
-%
-% 1.0 if #1< #2. Otherwise 0.0
-%
-\def\pgfmathlessthan#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathlessthan@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathlessthan@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \advance\pgfmath@x-\pgfmath@y\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \pgfmath@x1pt\relax%
- \else%
- \pgfmath@x0pt\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathequalto
-%
-% 1.0 if #1 = #2. Otherwise 0.0
-%
-\def\pgfmathequalto#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathequalto@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathequalto@#1#2{%
- \begingroup%
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \advance\pgfmath@x-\pgfmath@y%
- \ifdim\pgfmath@x=0pt\relax%
- \pgfmath@x1pt\relax%
- \else%
- \pgfmath@x0pt\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathreciprocal
-%
-% 1 / #1
-%
-\def\pgfmathreciprocal#1{%
- \pgfmathparse{#1}%
- \pgfmathreciprocal@{\pgfmathresult}}
-\def\pgfmathreciprocal@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x=0pt\relax%
- \pgfmath@error{You asked me to calculate `1/#1', but I cannot divide any number by zero}{}%
- \fi%
- \edef\pgfmath@reciprocaltemp{\pgfmath@tonumber{\pgfmath@x}}%
- \expandafter\pgfmathreciprocal@@\pgfmath@reciprocaltemp0000000\pgfmath@}
-\def\pgfmathreciprocal@@#1.#2#3#4#5#6#7\pgfmath@{%
- \c@pgfmath@counta#2#3#4#5#6\relax%
- % If the number is an integer, use TeX arithmatic.
- \ifnum\c@pgfmath@counta=0\relax%
- \pgfmath@x1pt\relax%
- \divide\pgfmath@x#1\relax%
- \else%
- \ifnum#1>100\relax%
- \c@pgfmath@counta#1#2#3#4\relax%
- \c@pgfmath@countb1000000000\relax%
- \divide\c@pgfmath@countb\c@pgfmath@counta%
- \c@pgfmath@counta\c@pgfmath@countb%
- \divide\c@pgfmath@counta10000\relax%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \multiply\c@pgfmath@counta-10000\relax%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
- \pgfmath@y\c@pgfmath@countb pt\relax%
- \divide\pgfmath@y1000000\relax%
- \advance\pgfmath@x\pgfmath@y%
- \else%
- \c@pgfmath@counta#1#2#3#4#5#6\relax%
- \c@pgfmath@countb1000000000\relax%
- \divide\c@pgfmath@countb\c@pgfmath@counta%
- \c@pgfmath@counta\c@pgfmath@countb%
- \divide\c@pgfmath@counta10000\relax%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \multiply\c@pgfmath@counta-10000\relax%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
- \pgfmath@y\c@pgfmath@countb pt\relax%
- \pgfmath@y.1\pgfmath@y% Yes! This way is more accurate. Go figure...
- \pgfmath@y.1\pgfmath@y%
- \pgfmath@y.1\pgfmath@y%
- \pgfmath@y.1\pgfmath@y%
- \advance\pgfmath@x\pgfmath@y%
- \fi%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathln
-%
-% Calculate ln(#1}
-%
-% This is based on an algorithm due to Rouben Rostamian and
-% uses coefficients contributed by Alain Matthes.
-%
-\def\pgfmathln#1{\pgfmathparse{#1}\pgfmathln@{\pgfmathresult}}
-\def\pgfmathln@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x>0pt\else%
- \pgfmath@error{I cannot calculate the logarithm of `#1'}{}%
- \fi%
- \c@pgfmath@counta0\relax%
- \ifdim\pgfmath@x>2pt\relax%
- \ifdim\pgfmath@x<128pt\relax%
- \ifdim\pgfmath@x<8pt\relax%
- \ifdim\pgfmath@x<4pt\relax%
- \divide\pgfmath@x2\relax%
- \c@pgfmath@counta1\relax%
- \else%
- \divide\pgfmath@x4\relax%
- \c@pgfmath@counta2\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x<32pt\relax%
- \ifdim\pgfmath@x<16pt\relax%
- \divide\pgfmath@x8\relax%
- \c@pgfmath@counta3\relax%
- \else%
- \divide\pgfmath@x16\relax%
- \c@pgfmath@counta4\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x<64pt\relax%
- \divide\pgfmath@x32\relax%
- \c@pgfmath@counta5\relax%
- \else%
- \divide\pgfmath@x64\relax%
- \c@pgfmath@counta6\relax%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgfmath@x<2048pt\relax%
- \ifdim\pgfmath@x<512pt\relax%
- \ifdim\pgfmath@x<256pt\relax%
- \divide\pgfmath@x128\relax%
- \c@pgfmath@counta7\relax%
- \else%
- \divide\pgfmath@x256\relax%
- \c@pgfmath@counta8\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x<1024pt\relax%
- \divide\pgfmath@x512\relax%
- \c@pgfmath@counta9\relax%
- \else%
- \divide\pgfmath@x1024\relax%
- \c@pgfmath@counta10\relax%
- \fi%
- \fi%
- \else%
- \ifdim\pgfmath@x<8192pt\relax%
- \ifdim\pgfmath@x<4096pt\relax%
- \divide\pgfmath@x2048\relax%
- \c@pgfmath@counta11\relax%
- \else%
- \divide\pgfmath@x4096\relax%
- \c@pgfmath@counta12\relax%
- \fi%
- \else%
- \divide\pgfmath@x8192\relax%
- \c@pgfmath@counta13\relax%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgfmath@x<1pt\relax%
- \ifdim\pgfmath@x>0.0078125pt\relax% 2^-7
- \ifdim\pgfmath@x>0.125pt\relax% 2^-3
- \ifdim\pgfmath@x>0.5pt\relax% 2^-1
- \multiply\pgfmath@x2\relax%
- \c@pgfmath@counta-1\relax%
- \else%
- \multiply\pgfmath@x4\relax%
- \c@pgfmath@counta-2\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x>0.03125pt\relax% 2^-5
- \ifdim\pgfmath@x>0.0625pt\relax%
- \multiply\pgfmath@x8\relax%
- \c@pgfmath@counta-3\relax%
- \else%
- \multiply\pgfmath@x16\relax%
- \c@pgfmath@counta-4\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x>0.015625pt\relax% 2^-6
- \multiply\pgfmath@x32\relax%
- \c@pgfmath@counta-5\relax%
- \else%
- \multiply\pgfmath@x64\relax%
- \c@pgfmath@counta-6\relax%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgfmath@x>0.000244140625pt\relax% 2^-11
- \ifdim\pgfmath@x>0.001953125pt\relax% 2^-9
- \ifdim\pgfmath@x>0.00390625pt\relax% 2^-8
- \multiply\pgfmath@x128\relax%
- \c@pgfmath@counta-7\relax%
- \else%
- \multiply\pgfmath@x256\relax%
- \c@pgfmath@counta-8\relax%
- \fi%
- \else%
- \ifdim\pgfmath@x>0.0009765625pt\relax% 2^-10
- \multiply\pgfmath@x512\relax%
- \c@pgfmath@counta-9\relax%
- \else%
- \multiply\pgfmath@x1024\relax%
- \c@pgfmath@counta-10\relax%
- \fi%
- \fi%
- \else%
- \ifdim\pgfmath@x>0.0001220703125pt\relax% 2^13
- \ifdim\pgfmath@x>0.0002441406256pt\relax% 2^12
- \multiply\pgfmath@x2048\relax%
- \c@pgfmath@counta-11\relax%
- \else%
- \multiply\pgfmath@x4096\relax%
- \c@pgfmath@counta-12\relax%
- \fi%
- \else%
- \multiply\pgfmath@x8192\relax%
- \c@pgfmath@counta-13\relax%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- %
- % Use A+(B+(C+(D+(E+F*x)*x)*x)*x)*x
- %
- % where:
- % A = -2.787927935
- % B = 5.047861502
- % C = -3.489886985
- % D = 1.589480044
- % E = -.4025153233
- % F = 0.04300521312
- %
- \edef\pgfmath@temp{\pgfmath@tonumber{\pgfmath@x}}%
- \pgfmath@x0.04300521312\pgfmath@x%
- \advance\pgfmath@x-.4025153233pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x1.589480044pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x-3.489886985pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x5.047861502pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x-2.787927935pt\relax%
- \advance\pgfmath@x\c@pgfmath@counta pt\relax%
- \pgfmath@x0.6931471806\pgfmath@x%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathabs
-%
-% Calculate |#1|
-%
-\def\pgfmathabs#1{%
- \pgfmathparse{#1}%
- \pgfmathabsolute@{\pgfmathresult}}
-\def\pgfmathabs@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \pgfmath@x-\pgfmath@x%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathmod
-%
-% Calculate #1 mod #2.
-%
-\def\pgfmathmod#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathmod@{\pgfmathresult}{\pgfmath@arg}%
-}
-\def\pgfmathmod@#1#2{%
- \begingroup%
- \pgfmath@xa#1pt%
- \pgfmath@xb#2pt%
- \pgfmath@x\pgfmath@xa%
- \c@pgfmath@counta\pgfmath@xa%
- \c@pgfmath@countb\pgfmath@xb%
- \divide\c@pgfmath@counta\c@pgfmath@countb%
- \multiply\pgfmath@xb\c@pgfmath@counta%
- \advance\pgfmath@x-\pgfmath@xb%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathsqrt
-%
-% Square-root of #1.
-%
-%
-\def\pgfmathsqrt#1{\pgfmathparse{#1}\pgfmathsqrt@{\pgfmathresult}}
-\def\pgfmathsqrt@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \pgfmath@error{I cannot calculate the square-root of the negative number `#1'}{}%
- \else%
- \ifdim\pgfmath@x<10pt\relax%
- \def\pgfmath@zeros{0}%
- \def\pgfmath@targetiterations{1}%
- \else%
- \ifdim\pgfmath@x<100pt\relax%
- \def\pgfmath@zeros{}%
- \def\pgfmath@targetiterations{1}%
- \else%
- \ifdim\pgfmath@x<1000pt\relax%
- \def\pgfmath@zeros{0}%
- \def\pgfmath@targetiterations{2}%
- \else%
- \ifdim\pgfmath@x<10000pt\relax%
- \def\pgfmath@zeros{}%
- \def\pgfmath@targetiterations{2}%
- \else%
- \def\pgfmath@zeros{0}%
- \def\pgfmath@targetiterations{3}%
- \fi\fi\fi\fi\fi%
- \edef\pgfmath@temp{\pgfmath@zeros\pgfmath@tonumber{\pgfmath@x}}%
- \expandafter\pgfmath@sqrt@\pgfmath@temp\pgfmath@%
-}
-\def\pgfmath@sqrt@#1.#2\pgfmath@{\pgfmath@@sqrt@#1#2\pgfmath@empty\pgfmath@empty\pgfmath@}
-
-\def\pgfmath@@sqrt@#1#2{%
- \c@pgfmath@countb#1#2\relax%
- \ifnum\c@pgfmath@countb>35\relax%
- \ifnum\c@pgfmath@countb>63\relax%
- \ifnum\c@pgfmath@countb>80\relax%
- \c@pgfmath@counta9\relax%
- \else%
- \c@pgfmath@counta8\relax%
- \fi%
- \else%
- \ifnum\c@pgfmath@countb>48\relax%
- \c@pgfmath@counta7\relax%
- \else%
- \c@pgfmath@counta6\relax%
- \fi%
- \fi%
- \else%
- \ifnum\c@pgfmath@countb>15\relax%
- \ifnum\c@pgfmath@countb>24\relax%
- \c@pgfmath@counta5\relax%
- \else%
- \c@pgfmath@counta4\relax%
- \fi%
- \else%
- \ifnum\c@pgfmath@countb>3\relax%
- \ifnum\c@pgfmath@countb>8\relax%
- \c@pgfmath@counta3\relax%
- \else%
- \c@pgfmath@counta2\relax%
- \fi%
- \else%
- \ifnum\c@pgfmath@countb>0\relax%
- \c@pgfmath@counta1\relax%
- \else%
- \c@pgfmath@counta0\relax%
- \fi%
- \fi%
- \fi%
- \fi%
- \edef\pgfmath@root{\the\c@pgfmath@counta}%
- \edef\pgfmath@rootspecial{\the\c@pgfmath@counta}%
- \multiply\c@pgfmath@counta-\c@pgfmath@counta\relax%
- \advance\c@pgfmath@counta#1#2\relax%
- \edef\pgfmath@remainder{\the\c@pgfmath@counta}%
- \pgfmath@@@sqrt@%
-}
-
-\def\pgfmath@@@sqrt@#1#2{%
- \ifx\pgfmath@empty#1%
- \edef\pgfmath@remainder{\pgfmath@remainder00}%
- \def\pgfmath@tokens{\pgfmath@empty\pgfmath@empty}%
- \else%
- \ifx\pgfmath@empty#2%
- \edef\pgfmath@remainder{\pgfmath@remainder#10}%
- \def\pgfmath@tokens{\pgfmath@empty\pgfmath@empty}%
- \else%
- \edef\pgfmath@remainder{\pgfmath@remainder#1#2}%
- \def\pgfmath@tokens{}%
- \fi\fi%
- \c@pgfmath@counta\pgfmath@rootspecial\relax%
- \multiply\c@pgfmath@counta20\relax%
- \c@pgfmath@countb\c@pgfmath@counta%
- \multiply\c@pgfmath@countb6\relax%
- \advance\c@pgfmath@countb36\relax%
- \c@pgfmath@countc\c@pgfmath@counta\relax%
- \multiply\c@pgfmath@countc2\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \advance\c@pgfmath@countb-\c@pgfmath@countc%
- \advance\c@pgfmath@countb-20\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \advance\c@pgfmath@countb-\c@pgfmath@countc%
- \advance\c@pgfmath@countb-12\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \advance\c@pgfmath@countb-\c@pgfmath@counta%
- \advance\c@pgfmath@countb-3\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \def\pgfmath@digit{0}%
- \else%
- \def\pgfmath@digit{1}%
- \fi%
- \else%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
- \advance\c@pgfmath@countb5\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \def\pgfmath@digit{2}%
- \else%
- \def\pgfmath@digit{3}%
- \fi%
- \fi%
- \else%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
- \advance\c@pgfmath@countb9\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \def\pgfmath@digit{4}%
- \else%
- \def\pgfmath@digit{5}%
- \fi%
- \fi%
- \else%
- \advance\c@pgfmath@countb\c@pgfmath@countc%
- \advance\c@pgfmath@countb28\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \advance\c@pgfmath@countb-\c@pgfmath@counta%
- \advance\c@pgfmath@countb-15\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \def\pgfmath@digit{6}%
- \else%
- \def\pgfmath@digit{7}%
- \fi%
- \else%
- \advance\c@pgfmath@countb\c@pgfmath@counta%
- \advance\c@pgfmath@countb17\relax%
- \ifnum\c@pgfmath@countb>\pgfmath@remainder\relax%
- \def\pgfmath@digit{8}%
- \else%
- \def\pgfmath@digit{9}%
- \fi%
- \fi%
- \fi%
- \edef\pgfmath@rootspecial{\pgfmath@rootspecial\pgfmath@digit}%
- \advance\c@pgfmath@counta\pgfmath@digit\relax%
- \multiply\c@pgfmath@counta-\pgfmath@digit\relax%
- \advance\c@pgfmath@counta\pgfmath@remainder\relax%
- \edef\pgfmath@remainder{\the\c@pgfmath@counta}%
- \c@pgfmath@counta\pgfmath@targetiterations\relax%
- \advance\c@pgfmath@counta-1\relax%
- \edef\pgfmath@targetiterations{\the\c@pgfmath@counta}%
- \ifnum\c@pgfmath@counta=0\relax%
- \edef\pgfmath@root{\pgfmath@root.\pgfmath@digit}%
- \else%
- \edef\pgfmath@root{\pgfmath@root\pgfmath@digit}%
- \fi%
- \ifnum\c@pgfmath@counta=-4\relax% -n+1 digits of precision.
- \let\pgfmath@next\pgfmath@sqrt@end%
- \else%
- \let\pgfmath@next\pgfmath@@@sqrt@%
- \fi%
- \expandafter\pgfmath@next\pgfmath@tokens%
-}
-
-\def\pgfmath@sqrt@end#1\pgfmath@{%
- \edef\pgfmathresult{\pgfmath@root}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup}
-
-% \pgfmathpow
-%
-% Calculates #1 ^ #2
-%
-\def\pgfmathpow#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathpow@{\pgfmathresult}{\pgfmath@arg}}
-\def\pgfmathpow@#1#2{%
- \begingroup%
- \pgfmath@xa#1pt%
- \pgfmath@xb#2pt%
- \afterassignment\pgfmath@x%
- \expandafter\c@pgfmath@counta\the\pgfmath@xb\relax%
- \ifnum\c@pgfmath@counta<0\relax%
- \c@pgfmath@counta-\c@pgfmath@counta%
- \pgfmathreciprocal@{#1}%
- \pgfmath@xa\pgfmathresult pt\relax%
- \fi
- \ifdim\pgfmath@x=0pt\relax%
- \pgfmath@x1pt\relax%
- \pgfmathloop%
- \ifnum\c@pgfmath@counta>0\relax%
- \ifodd\c@pgfmath@counta%
- \pgfmath@x\pgfmath@tonumber{\pgfmath@x}\pgfmath@xa%
- \fi
- \ifnum\c@pgfmath@counta>1\relax%
- \pgfmath@xa\pgfmath@tonumber{\pgfmath@xa}\pgfmath@xa%
- \fi%
- \divide\c@pgfmath@counta2\relax%
- \repeatpgfmathloop%
- \else%
- \pgfmathln@{#1}%
- \pgfmath@x\pgfmathresult pt\relax%
- \pgfmath@x\pgfmath@tonumber{\pgfmath@xb}\pgfmath@x%
- \pgfmathexp@{\pgfmath@tonumber{\pgfmath@x}}%
- \pgfmath@x\pgfmathresult pt\relax%
- \fi%
- \pgfmath@returnone\pgf@x%
- \endgroup%
-}
-
-% \pgfmathround
-%
-% Asymmetric Half-up rounding.
-%
-\def\pgfmathround#1{\pgfmathparse{#1}\pgfmathround@{\pgfmathresult}}
-\def\pgfmathround@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@xa%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
- \pgfmath@xb\pgfmath@x%
- \ifdim\pgfmath@xb<0pt\relax%
- \ifdim\pgfmath@xa<0.5pt\relax%
- \else%
- \advance\c@pgfmath@counta-1\relax%
- \fi%
- \else%
- \ifdim\pgfmath@xa<0.5pt\relax%
- \else%
- \advance\c@pgfmath@counta1\relax%
- \fi%
- \fi%
- \pgfmath@returnone\the\c@pgfmath@counta pt%
- \endgroup%
-}%
-
-% \pgfmathfloor
-%
-% Floor function.
-%
-\def\pgfmathfloor#1{\pgfmathparse{#1}\pgfmathfloor@{\pgfmathresult}}
-\def\pgfmathfloor@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}%
-
-% \pgfmathceil
-%
-% Ceiling function.
-%
-\def\pgfmathceil#1{\pgfmathparse{#1}\pgfmathceil@{\pgfmathresult}}
-\def\pgfmathceil@#1{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
- \pgfmath@y\pgfmath@x%
- \advance\pgfmath@y-\c@pgfmath@counta pt\relax%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \ifdim\pgfmath@y>0pt\relax%
- \advance\pgfmath@x1pt\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}%
-
-% \pgfmathexp
-%
-% A Maclaurens expansion for e^#1.
-% 0 <= #1 < ln(16384).
-%
-\def\pgfmathexp#1{\pgfmathparse{#1}\pgfmathexp@{\pgfmathresult}}
-\def\pgfmathexp@#1{%
- \begingroup%
- \edef\pgfmath@arg{#1}%
- \pgfmath@x1pt\relax%
- \pgfmath@xa1pt\relax%
- \pgfmath@xb\pgfmath@x%
- \pgfmathloop%
- \pgfmath@xc\pgfmathcounter pt\relax%
- \c@pgfmath@counta\pgfmath@xc%
- \divide\c@pgfmath@counta65536\relax%
- \pgfmath@xc1pt\relax%
- \divide\pgfmath@xc\c@pgfmath@counta%
- \pgfmath@xa\pgfmath@tonumber{\pgfmath@xc}\pgfmath@xa%
- \expandafter\pgfmath@xa\pgfmath@arg\pgfmath@xa%
- \advance\pgfmath@x\pgfmath@xa%
- \ifdim\pgfmath@x=\pgfmath@xb%
- \else%
- \pgfmath@xb\pgfmath@x%
- \repeatpgfmathloop%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-
-
-% \pgfmathvectorlength
-%
-% Calcluate the Eulidean length of a 2D vector.
-%
-% This based on polynomial approximation co-efficents
-% contributed by Rouben Rostamian.
-%
-% #1 - the x component of the vector.
-% #2 - the y component of the vector.
-%
-\def\pgfmathveclen#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathveclen@{\pgfmathresult}{\pgfmath@arg}%
-}
-\def\pgfmathveclen@#1#2{%
- \begingroup%
- \pgfmath@x#1pt\relax%
- \pgfmath@y#2pt\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \pgfmath@x-\pgfmath@x%
- \fi%
- \ifdim\pgfmath@y<0pt\relax%
- \pgfmath@y-\pgfmath@y%
- \fi%
- \ifdim\pgfmath@x=0pt\relax%
- \pgfmath@x\pgfmath@y%
- \else%
- \ifdim\pgfmath@y=0pt\relax%
- \else%
- \ifdim\pgfmath@x>\pgfmath@y%
- \pgfmath@xa\pgfmath@x%
- \pgfmath@x\pgfmath@y%
- \pgfmath@y\pgfmath@xa%
- \fi%
- % We use a scaling factor to reduce errors.
- \ifdim\pgfmath@y>10000pt\relax%
- \c@pgfmath@counta1500\relax%
- \else%
- \ifdim\pgfmath@y>1000pt\relax%
- \c@pgfmath@counta150\relax%
- \else%
- \ifdim\pgfmath@y>100pt\relax%
- \c@pgfmath@counta50\relax%
- \else%
- \c@pgfmath@counta1\relax%
- \fi%
- \fi%
- \fi%
- \divide\pgfmath@x\c@pgfmath@counta\relax%
- \divide\pgfmath@y\c@pgfmath@counta\relax%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgfmath@y}}%
- \pgfmath@x\pgfmathresult\pgfmath@x%
- \pgfmath@xa\pgfmath@tonumber{\pgfmath@x}\pgfmath@x%
- \edef\pgfmath@temp{\pgfmath@tonumber{\pgfmath@xa}}%
- %
- % Use A+x^2*(B+x^2*(C+x^2*(D+E*x^2)))
- % where
- % A = +1.000012594
- % B = +0.4993615349
- % C = -0.1195159052
- % D = +0.04453994279
- % E = -0.01019210944
- %
- \pgfmath@x-0.01019210944\pgfmath@xa%
- \advance\pgfmath@x0.04453994279pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x-0.1195159052pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x0.4993615349pt\relax%
- \pgfmath@x\pgfmath@temp\pgfmath@x%
- \advance\pgfmath@x1.000012594pt\relax%
- \ifdim\pgfmath@y<0pt\relax%
- \pgfmath@y-\pgfmath@y%
- \fi%
- \pgfmath@x\pgfmath@tonumber{\pgfmath@y}\pgfmath@x%
- % Invert the scaling factor.
- \multiply\pgfmath@x\c@pgfmath@counta\relax%
- \fi%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
-}
-
-% \pgfmathmax
-%
-% Return the maximum of #1 or #2
-%
-\def\pgfmathmax#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathmax@{\pgfmathresult}{\pgfmath@arg}}%
-\def\pgfmathmax@#1#2{%
- \begingroup
- \pgfmath@x#1pt%
- \pgfmath@y#2pt\relax%
- \ifdim\pgfmath@x>\pgfmath@y%
- \pgfmath@returnone\pgfmath@x%
- \else%
- \pgfmath@returnone\pgfmath@y%
- \fi%
- \endgroup
-}
-
-% \pgfmathmax
-%
-% Return the minimim of #1 or #2
-%
-\def\pgfmathmin#1#2{%
- \edef\pgfmath@marshal{%
- \noexpand\pgfmathparse{#2}
- \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
- \noexpand\pgfmathparse{#1}%
- }%
- \pgfmath@marshal%
- \pgfmathmin@{\pgfmathresult}{\pgfmath@arg}}%
-\def\pgfmathmin@#1#2{%
- \begingroup
- \pgfmath@x#1pt%
- \pgfmath@y#2pt%
- \relax%
- \ifdim\pgfmath@x<\pgfmath@y%
- \pgfmath@returnone\pgfmath@x%
- \else%
- \pgfmath@returnone\pgfmath@y%
- \fi%
- \endgroup%
-}
-
-% \pgfmathscientific
-%
-% Return the value of #1e#2
-%
-% e.g. \pgfmathscientific{1.23456789123}{4}
-%
-% defines \pgfmathresult as 12345.67891
-%
-% NB These arguments *are not parsed*, as the long mantissa would be lost.
-%
-\def\pgfmathscientific#1#2{%
- \begingroup%
- \edef\pgfmath@sci@exponent{#2}%
- \pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \pgfmath@x-\pgfmath@x%
- \edef\pgfmath@sci@sign{-}%
- \edef\pgfmath@temp{\pgfmath@gobbleone#1}%
- \else%
- \edef\pgfmath@sci@sign{+}%
- \edef\pgfmath@temp{#1}%
- \fi%
- \expandafter\pgfmath@scientific@@\pgfmath@temp00000000000\pgfmath@}
-
-\def\pgfmath@scientific@@#1.#2#3#4#5#6{%
- \edef\pgfmath@sci@int{#1}%
- \edef\pgfmath@sci@mantissaA{#2#3#4#5#6}%
- \pgfmath@scientific@@@}
-
-\def\pgfmath@scientific@@@#1#2#3#4#5#6\pgfmath@{%
- \edef\pgfmath@sci@mantissaB{#1#2#3#4#5}%
- \c@pgfmath@counta\pgfmath@sci@exponent\relax%
- \c@pgfmath@countb\c@pgfmath@counta%
- \ifnum\c@pgfmath@counta<0\relax%
- \c@pgfmath@counta-\c@pgfmath@counta%
- \fi%
- \pgfmathpow@{10}{\the\c@pgfmath@counta}%
- \afterassignment\pgfmath@gobbletilpgfmath@
- \c@pgfmath@countc\pgfmathresult\relax\pgfmath@
- \edef\pgfmath@sci@factor{\the\c@pgfmath@countc}%
- \ifnum\c@pgfmath@countb<0\relax%
- % xE-y: easy...
- \pgfmath@x\pgfmath@sci@int.\pgfmath@sci@mantissaA pt\relax%
- \divide\pgfmath@x\pgfmath@sci@factor\relax%
- \else%
- % xE+y:
- % Must do this way so as not lose digits in a long mantissa. Sigh...
- \c@pgfmath@counta\pgfmath@sci@int%
- \c@pgfmath@countb\pgfmath@sci@mantissaA%
- \multiply\c@pgfmath@counta\pgfmath@sci@factor\relax%
- \multiply\c@pgfmath@countb\pgfmath@sci@factor\relax%
- \c@pgfmath@countc\c@pgfmath@countb%
- \divide\c@pgfmath@countb100000\relax%
- \advance\c@pgfmath@counta\c@pgfmath@countb%
- \multiply\c@pgfmath@countb100000\relax%
- \advance\c@pgfmath@countc-\c@pgfmath@countb%
- \c@pgfmath@countb\pgfmath@sci@mantissaB\relax%
- \multiply\c@pgfmath@countb\pgfmath@sci@factor\relax%
- \divide\c@pgfmath@countb100000\relax%
- \advance\c@pgfmath@countc\c@pgfmath@countb%
- \advance\c@pgfmath@countc100000\relax%
- \edef\pgfmath@sci@result{\pgfmath@sci@sign\the\c@pgfmath@counta.\expandafter\pgfmath@gobbleone\the\c@pgfmath@countc pt}%
- \pgfmath@x\pgfmath@sci@result\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup}
-
-
-
-
-
-% *** The following commands DO NOT WORK without the rest of PGF ***
-%
-% (a dumping ground for stuff that doesn't really belong anywhere else)
-
-% \pgfmathanglebetweenpoints
-%
-% Define \pgfmathresult as the angle between points #1 and #2
-% Should get the quadrants right as well.
-%
-\def\pgfmathanglebetweenpoints#1#2{%
- \begingroup%
- \pgf@process{\pgfpointdiff{#1}{#2}}%
- %
- % First approximate the angle of the external point...
- %
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \ifdim\pgf@xa<0pt\relax%
- \pgf@xa-\pgf@xa%
- \fi%
- \ifdim\pgf@ya<0pt\relax%
- \pgf@ya-\pgf@ya%
- \fi%
- \ifdim\pgf@ya>\pgf@xa%
- \pgf@x\pgf@xa%
- \pgf@y\pgf@ya%
- \else%
- \pgf@x\pgf@ya%
- \pgf@y\pgf@xa%
- \fi%
- \ifdim\pgf@y=0pt\relax%
- \pgf@x0pt%
- \else%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
- \pgf@x\pgfmathresult\pgf@x%
- \fi%
- \multiply\pgf@x1000\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\the\pgf@x\relax\pgfmath@%
- \expandafter\pgf@x\csname pgfmath@atan@\the\c@pgf@counta\endcsname pt\relax%
- \ifdim\pgfmath@ya>\pgfmath@xa\relax%
- \pgf@x-\pgf@x%
- \advance\pgf@x90pt%
- \fi%
- \ifdim\pgf@xb<0pt%
- \ifdim\pgf@yb>0pt%
- \pgf@x-\pgf@x%
- \fi%
- \advance\pgf@x180pt\relax%
- \else%
- \ifdim\pgf@yb<0pt%
- \pgf@x-\pgf@x%
- \advance\pgf@x360pt\relax%
- \fi\fi%
- \pgfmath@returnone\pgf@x%
- \endgroup%
-}
-
-%
-% \pgfmathrotatepointaround
-%
-% Rotate point #1 about point #2 by #3 degrees.
-%
-\def\pgfmathrotatepointaround#1#2#3{%
- \pgf@process{%
- \pgf@process{#2}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgf@process{#1}%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- \pgfmathsetmacro\angle{#3}%
- \pgfmathsin@{\angle}%
- \let\sineangle\pgfmathresult%
- \pgfmathcos@{\angle}%
- \let\cosineangle\pgfmathresult%
- \pgf@xa\cosineangle\pgf@x%
- \advance\pgf@xa-\sineangle\pgf@y%
- \pgf@ya\sineangle\pgf@x%
- \advance\pgf@ya\cosineangle\pgf@y%
- \pgf@x\pgf@xb%
- \pgf@y\pgf@yb%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
-}
-
-% \pgfmathanglebetweenlines
-%
-% Calculate the clockwise angle between a line from point #1
-% to point #2 and a line from #3 to point #4.
-%
-\def\pgfmathanglebetweenlines#1#2#3#4{%
- \begingroup%
- \pgfmathanglebetweenpoints{#1}{#2}%
- \let\firstangle\pgfmathresult%
- \pgfmathanglebetweenpoints{#3}{#4}%
- \let\secondangle\pgfmathresult%
- \ifdim\firstangle pt>\secondangle pt\relax%
- \pgfmathadd@{\secondangle}{360}%
- \let\secondangle\pgfmathresult%
- \fi%
- \pgfmathsubtract@{\secondangle}{\firstangle}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
-
-% \pgfmathpointreflectalongaxis
-%
-% Reflects point #2 around an axis centered on #2 at an angle #3.
-%
-\def\pgfmathreflectpointalongaxis#1#2#3{%
- \pgf@process{%
- \pgfmathanglebetweenpoints{#2}{#1}%
- \pgfmath@tempdima\pgfmathresult pt\relax%
- \pgfmathparse{#3}%
- \advance\pgfmath@tempdima-\pgfmathresult pt\relax%
- \pgfmath@tempdima-2.0\pgfmath@tempdima%
- \pgfmathrotatepointaround{#1}{#2}{\pgfmath@tonumber{\pgfmath@tempdima}}%
- }%
-}
-
-
-% \pgfmathpointintersectionoflineandarc
-%
-% A bit experimental at the moment:
-%
-% Locates the point where a line crosses an eliptical arc. If the line
-% does not cross the arc, a meaningless point will result.
-%
-% #1 the point of the line on the "convex" side of the arc.
-% #2 the point of the line on the "concave" side of the arc.
-% #3 the center of the eliptical arc.
-% #4 start angle of the arc.
-% #5 end angle of the arc.
-% #6 radii of the arc.
-%
-\def\pgfmathpointintersectionoflineandarc#1#2#3#4#5#6{%
- \pgf@process{%
- %
- % Get the required angle.
- %
- \pgfmathanglebetweenpoints{#2}{#1}%
- \let\x\pgfmathresult%
- %
- % Get the radii of the arc.
- %
- \pgfmath@in@{and }{#6}%
- \ifpgfmath@in@%
- \pgf@polar@#6\@@%
- \else%
- \pgf@polar@#6 and #6\@@%
- \fi%
- \edef\xarcradius{\the\pgf@x}%
- \edef\yarcradius{\the\pgf@y}%
- %
- % Get the start and end angles of the arc...
- %
- \pgfmathsetmacro\s{#4}%
- \pgfmathsetmacro\e{#5}%
- %
- % ...and also with rounding.
- %
- \pgfmathmod@{\s}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\ss\pgfmathresult%
- \pgfmathmod@{\e}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\ee\pgfmathresult%
- %
- % Hackery for when arc straddles zero.
- %
- \ifdim\ee pt<\ss pt\relax%
- \pgfmathadd@{\x}{180}%
- \pgfmathmod@{\pgfmathresult}{360}%
- \let\x\pgfmathresult%
- \fi%
- \def\m{360}% Measure of nearness.
- \pgfmathadd@{\s}{\e}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\n\pgfmathresult% The best estimate (default to middle of arc).
- \pgfmathloop%
- \pgfmathadd@{\s}{\e}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\p\pgfmathresult%
- \ifdim\p pt=\s pt\relax%
- \else%
- \pgfmathanglebetweenpoints{#2}{%
- \pgfpointadd{#3}{%
- \pgf@x\xarcradius\relax%
- \pgfmathcos@{\p}%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y\yarcradius\relax%
- \pgfmathsin@{\p}%
- \pgf@y\pgfmathresult\pgf@y%
- }%
- }%
- %
- % Hackery for when arc straddles zero.
- %
- \ifdim\ee pt<\ss pt\relax%
- \pgfmathadd@{\pgfmathresult}{180}%
- \pgfmathmod@{\pgfmathresult}{360}%
- \fi%
- \let\q\pgfmathresult%
- %
- % More hackery...
- %
- \ifdim\x pt>335pt\relax%
- \ifdim\q pt<45pt\relax%
- \pgfmathadd@{\q}{360}%
- \let\q\pgfmathresult%
- \fi%
- \fi%
- \ifdim\x pt=\q pt% Found it!
- \pgfmathbreakloop% Breaks after current iteration is complete.
- \else
- \ifdim\x pt<\q pt\relax%
- \let\e\p%
- \else%
- \let\s\p%
- \fi%
- \fi%
- \pgfmathsubtract@{\x}{\q}%
- \pgfmathabs@{\pgfmathresult}%
- %
- % Save the estimate if it is better than any previous estimate.
- %
- \ifdim\pgfmathresult pt<\m pt\relax%
- \let\m\pgfmathresult%
- \let\n\p%
- \fi%
- \repeatpgfmathloop%
- \pgfpointadd{#3}{\pgfpointpolar{\n}{\xarcradius and \yarcradius}}%
- }%
-}
-
-% \pgfmathangleonellipse
-%
-% Find the angle corresponding to a point on the border of an ellispe.
-%
-% #1 - the point on the border.
-% #2 - the radii of the ellipse.
-%
-\def\pgfmathangleonellipse#1#2{%
- \begingroup%
- \pgfmath@in@{and }{#2}%
- \ifpgfmath@in@%
- \pgf@polar@#2\@@%
- \else%
- \pgf@polar@#2 and #2\@@%
- \fi%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgf@process{#1}%
- \ifdim\pgf@x=0pt\relax%
- \pgfutil@tempdima1pt\relax%
- \else%
- \pgfutil@tempdima\pgf@x%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \fi%
- \ifdim\pgf@y=0pt\relax%
- \pgfutil@tempdima1pt\relax%
- \else%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@y}}{\pgfmath@tonumber{\pgf@ya}}%
- \pgfutil@tempdima\pgfmathresult\pgfutil@tempdima%
- \pgfmathatan@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \fi%
- %
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \ifdim\pgfutil@tempdima<0pt\relax%
- \advance\pgfutil@tempdima360pt\relax%
- \fi%
- \ifdim\pgf@x<0pt\relax%
- \ifdim\pgf@y=0pt\relax%
- \pgfutil@tempdima180pt\relax%
- \else%
- \ifdim\pgf@y<0pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \else%
- \advance\pgfutil@tempdima-180pt\relax%
- \fi%
- \fi%
- \else%
- \ifdim\pgf@x=0pt\relax%
- \ifdim\pgf@y<0pt\relax%
- \pgfutil@tempdima270pt\relax%
- \else%
- \pgfutil@tempdima90pt\relax%
- \fi%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \pgfutil@tempdima0pt\relax%
- \fi%
- \fi%
- \fi%
- \pgfmath@returnone\pgfutil@tempdima%
- \endgroup%
-} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
index 3d69d34b73c..81f6545897e 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
@@ -1,970 +1,772 @@
-% Copyright 2007 Mark Wibrow
-%
-% 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.
-% This file parses/evaluates a decimal expression.
-%
-% Version 1.414213 29/9/2007
+\newdimen\pgfmath@dimen
+\newcount\pgfmath@count
+\newbox\pgfmath@box
+\newtoks\pgfmath@toks
-% \pgfmathparse, \pgfmathqparse
-%
-% Evaluates a decimal expression.
-%
-% #1 - the expression.
-%
-% returns
-%
-% x = the result as a dimension.
-%
-% E.g.
-% \pgfmathparse{3pt*2cm+1.5}
-% \pgfmathqparse{3pt*2cm+1.5pt}
-%
-% Every number in \pgfmathqparse *must*
-% specify a unit.
-%
\newif\ifpgfmath@quickparse
+\newif\ifpgfmathfloat
+\newif\ifpgfmathunitsdeclared
+\newif\ifpgfmathignoreunitscale
+
+\def\pgfmathprint#1{\pgfmathparse{#1}\pgfmathresult}
\def\pgfmathparse{%
- \pgfmath@quickparsefalse%
- \pgfmathparse@}
+ \begingroup%
+ \pgfmath@catcodes%
+ \pgfmath@quickparsefalse%
+ \ifpgfmathfloat%
+ \let\pgfmath@parse@next=\pgfmathfloatparsenumber%
+ \else%
+ \let\pgfmath@parse@next=\pgfmathparse@%
+ \fi%
+ \pgfmath@parse@next}
-\def\pgfmathqparse{%
- \pgfmath@quickparsetrue%
- \pgfmathparse@}
-
-\def\pgfmath@calcreal#1{#1}%
-\def\pgfmath@calcminof#1#2{min(#1,#2)}%
-\def\pgfmath@calcmaxof#1#2{max(#1,#2)}%
-\def\pgfmath@calcratio#1#2{#1/#2}%
+\def\pgfmath@catcodes{% Maybe unecessary.
+ \catcode`\==12%
+ \catcode`\,=12%
+ \catcode`\|=12%
+ \catcode`\&=12%
+}
+\def\pgfmathqparse{%
+ \begingroup%
+ \pgfmath@catcodes%
+ \pgfmath@quickparsetrue%
+ \pgfmathparse@}
+
\def\pgfmathparse@#1{%
- \begingroup%
- % Reinstall correct font, so that dimensions like 1em are correct
+ % Stuff for calc compatiability.
+ \let\real=\pgfmath@calc@real%
+ \let\minof=\pgfmath@calc@minof%
+ \let\maxof=\pgfmath@calc@maxof%
+ \let\ratio=\pgfmath@calc@ratio%
+ \let\widthof=\pgfmath@calc@widthof%
+ \let\heightof=\pgfmath@calc@heightof%
+ \let\depthof=\pgfmath@calc@depthof%
+ % Restore font.
\pgfmath@selectfont%
- \let\real\pgfmath@calcreal%
- \let\minof\pgfmath@calcminof%
- \let\maxof\pgfmath@calcmaxof%
- \let\ratio\pgfmath@calcratio%
- \edef\pgfmath@temp{#1}%
- \pgfmath@resetparsingparameters%
+ % Expand expression so any reamining CSs are registers
+ % or box dimensions (i.e., \wd, \ht, \dp).
+ \edef\pgfmath@expression{#1}%
+ % No units yet.
\global\pgfmathunitsdeclaredfalse%
- \ifpgfmath@quickparse%
- \let\pgfmath@parseoperand\pgfmath@quickparseoperand%
- \else%
- \let\pgfmath@parseoperand\pgfmath@parseoperand%
- \fi%
- \let\pgfmath@parsepostgroup\pgfmath@parseoperator%
- \expandafter\pgfmath@parse@\pgfmath@temp @@@@@@@@@@@\pgfmath@empty}
+ % Set up stack.
+ \pgfmath@stack@operation={{}{}{}}%
+ \pgfmath@stack@operand={{}{}{}}%
+ \let\pgfmath@stack@operation@top=\pgfmath@stack@empty%
+ \let\pgfmath@stack@operand@top=\pgfmath@stack@empty%
+ % An expression always begins with an operand.
+ \expandafter\pgfmath@bgroup@strip\expandafter{\pgfmath@expression}%
+ \expandafter\pgfmath@parse@@operand\pgfmath@bgroup@stripped @@@@\pgfmath@parse@stop%
+}%
+\def\pgfmath@parse@end#1\pgfmath@parse@stop{%
+ \pgfmathpostparse%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+ \ignorespaces}%
-% \pgfmath@resetparsingparameters
-%
-% Reset the stack at the begining of the parse/group.
-%
-\def\pgfmath@resetparsingparameters{%
- \pgfmath@stack{\pgfmath@empty\pgfmath@empty\pgfmath@empty\pgfmath@empty}%
- \def\pgfmath@stacknextoperator{\pgfmath@empty}% Will not work with \let
-}
-% \pgfmath@parse@
-%
-% Start parsing. Expect one of
-% 1) the end of the parse
-% 2) the start of a group
-% 3) a (possible) operand.
+\let\pgfmathpostparse=\relax%
+
+% For compatiability with older version.
%
-\def\pgfmath@parse@#1{%
- \def\pgfmath@token{}%
- \ifx#1@%
- \let\pgfmath@parsenext\pgfmath@endparse%
- \else%
- \ifx#1(%
- \let\pgfmath@parsenext\pgfmath@startparsegroup%
- \else%
- \edef\pgfmath@token{#1}%
- \let\pgfmath@parsenext\pgfmath@parseoperand%
- \fi\fi%
- \pgfmath@parsenext%
+\def\pgfmathscaleresult{%
+ \ifpgfmathunitsdeclared%
+ \else%
+ \ifpgfmathignoreunitscale%
+ \else%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \pgfmath@x\pgfmathresultunitscale pt\relax\pgfmath@%
+ \expandafter\pgfmath@x\pgfmathresult\pgfmath@x%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \fi%
+ \fi%
}
-
-% If no TeX units are declared *at any point* in the parse
-% the result is scaled by \pgfmathresultunitscale.
-\newif\ifpgfmathunitsdeclared
\def\pgfmathsetresultunitscale#1{\def\pgfmathresultunitscale{#1}}
\def\pgfmathresultunitscale{1}
-% \pgfmath@endparse
-%
-% Everything stops here.
-%
-\def\pgfmath@endparse#1\pgfmath@empty{%
- \pgfmath@processalloperations%
- \pgfmath@stackpop{\pgfmathresult}%
- \begingroup%
- \ifpgfmathunitsdeclared%
- \pgfmath@x1pt\relax%
- \else%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \pgfmath@x\pgfmathresultunitscale pt\relax\pgfmath@%
- \fi%
- \expandafter\pgfmath@x\pgfmathresult\pgfmath@x%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
- \pgfmath@smuggleone{\pgfmathresult}%
- \endgroup%
- \ignorespaces%
-}
+% Stuff for compatability with the calc package.
+%
+\def\pgfmath@calc@real#1{#1}
+\def\pgfmath@calc@minof#1#2{min(#1,#2)}
+\def\pgfmath@calc@maxof#1#2{max(#1,#2)}
+\def\pgfmath@calc@ratio#1#2{#1/#2}
+\def\pgfmath@calc@widthof#1{width("#1")}
+\def\pgfmath@calc@heightof#1{height("#1")}
+\def\pgfmath@calc@depthof#1{depth("#1")}
+
+\def\pgfmath@bgroup{\string\pgfmath@bgroup}
+\def\pgfmath@egroup{\string\pgfmath@egroup}
+\def\pgfmath@egroup@token{\pgfmath@egroup}
+
+\def\pgfmath@text@@{@}
+\def\pgfmath@text@operator{operator}
+\def\pgfmath@text@function{function}
+\def\pgfmath@dots{...}
+\def\pgfmath@char@zero{0}
+\def\pgfmath@char@quote{"}
+\def\pgfmath@char@exclamation{!}
+\def\pgfmath@char@plus{+}
+\def\pgfmath@char@minus{-}
+\def\pgfmath@char@period{.}
+\def\pgfmath@char@leftangle{<}
+\def\pgfmath@char@leftbracket{[}
+\pgfmath@toks={#}
+\edef\pgfmath@char@hash{\the\pgfmath@toks}
+
+\def\pgfmath@tokens@make#1#2{%
+ \def\pgfmath@prefix{#1}%
+ \expandafter\pgfmath@tokens@@make#2{}}
+
+\def\pgfmath@tokens@@make#1{%
+ \def\pgfmath@token{#1}%
+ \ifx\pgfmath@token\pgfmath@empty%
+ \else%
+ \pgfmath@namedef{pgfmath@token@\pgfmath@prefix @\string#1}{#1}%
+ \expandafter\pgfmath@tokens@@make%
+ \fi}
-% \pgfmath@startparsegroup
-%
-% When opening ( is scanned start a new group.
+\pgfmath@tokens@make{box}{\wd\ht\dp}
+\pgfmath@tokens@make{unit}{{bp}{cc}{cm}{dd}{em}{ex}{in}{mm}{pc}{pt}{sp}}
+\pgfmath@tokens@make{numeric}{.0123456789}
+\pgfmath@tokens@make{number}{0123456789}
+\pgfmath@tokens@make{functional}{_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ}
+\pgfmath@tokens@make{exponent}{eE}
+\pgfmath@tokens@make{group}{{()}{[]}{\pgfmath@bgroup\pgfmath@egroup}}
+\pgfmath@tokens@make{specials}{@)]\pgfmath@egroup}
+\pgfmath@tokens@make{hexadecimal}{0123456789ABCDEFabcdef}
+\pgfmath@tokens@make{octal}{01234567}
+\pgfmath@tokens@make{binary}{01}
+
+\pgfmath@namedef{pgfmath@base@0x}{16}
+\pgfmath@namedef{pgfmath@base@0X}{16}
+\pgfmath@namedef{pgfmath@base@0b}{2}
+\pgfmath@namedef{pgfmath@base@0B}{2}
+
+% Determine if a register is a count or a dimension/skip register.
%
-\def\pgfmath@startparsegroup{%
+\newif\ifpgfmath@dimen@
+\def\pgfmath@dimen@#1{%
\begingroup%
- \let\pgfmath@parsepostgroup\pgfmath@parseoperator%
- \pgfmath@resetparsingparameters%
- \pgfmath@parse@}
-
-% \pgfmath@endparsegroup
-%
-% When closing ) is scanned, processes all waiting
-% operations (within the group) and close the group.
-%
-\def\pgfmath@endparsegroup{%
- \pgfmath@processalloperations%
- \pgfmath@stackpop{\pgfmathresult}%
- \expandafter\pgfmath@x\pgfmathresult pt\relax%
- \pgfmath@returnone\pgfmath@x%
+ \afterassignment\pgfmath@dimen@@%
+ #1=0.0pt\relax\pgfmath@}
+\def\pgfmath@dimen@@#1#2\pgfmath@{%
\endgroup%
- \pgfmath@parsepostgroup%
-}
+ \ifx#1.%
+ \pgfmath@dimen@false%
+ \else%
+ \pgfmath@dimen@true%
+ \fi}
-% \pgfmath@parseoperator
-%
-% An operator is expected here.
-% Or the end of the parse or parse group.
-%
-\def\pgfmath@parseoperator#1{%
- \def\pgfmath@token{}%
- % Push the operand in \pgfmathresult on to the stack.
- \expandafter\pgfmath@stackpushoperand\expandafter{\pgfmathresult}%
- \ifx#1@%
- \let\pgfmath@parsenext\pgfmath@endparse%
+\def\pgfmath@parse@ifbgroup#1#2{%
+ \let\pgfmath@parse@bgroup@after=#1%
+ \let\pgfmath@parse@nobgroup@after=#2%
+ \futurelet\pgfmath@token@let%
+ \pgfmath@parse@@ifbgroup}
+
+\def\pgfmath@parse@@ifbgroup{%
+ \ifx\pgfmath@token@let\bgroup%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@ifbgroup%
\else%
- \ifx#1+%
- \let\pgfmath@parsenext\pgfmath@parseadd%
+ \ifx\pgfmath@token@let\pgfmath@sptoken%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@@ifbgroup%
\else%
- \ifx#1-%
- \let\pgfmath@parsenext\pgfmath@parsesubtract%
- \else%
- \ifx#1*%
- \let\pgfmath@parsenext\pgfmath@parsemultiply%
- \else%
- \ifx#1/%
- \let\pgfmath@parsenext\pgfmath@parsedivide%
- \else
- \ifx#1)%
- \let\pgfmath@parsenext\pgfmath@endparsegroup%
- \else%
- \ifx#1r%
- \let\pgfmath@parsenext\pgfmath@parseradians%
- \else%
- \ifx#1>%
- \let\pgfmath@parsenext\pgfmath@parsegreaterthan%
- \else%
- \ifx#1<%
- \let\pgfmath@parsenext\pgfmath@parselessthan%
- \else%
- \if#1=%
- \let\pgfmath@parsenext\pgfmath@parseequalto%
- \else%
- \if#1^%
- \let\pgfmath@parsenext\pgfmath@parsepower%
- \else%
- \pgfmath@error{Unknown operator `#1'}%
- \let\pgfmath@parsenext\relax%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
- \pgfmath@parsenext%
-}
-
-% Use a \toks register as a stack.
-\newtoks\pgfmath@stack
+ \let\pgfmath@parse@next=\pgfmath@parse@nobgroup@after%
+ \fi%
+ \fi%
+ \pgfmath@parse@next}
-% \pgfmath@stackpushoperator
-%
-% Push an operator (actually its macro e.g., \pgfmathadd@)
-% on to the stack. And keep track of it using the macro
-% \pgfmath@stacknextoperator.
-%
-\def\pgfmath@stackpushoperator#1{%
- \edef\pgfmath@temp{\noexpand#1\the\pgfmath@stack}%
- \expandafter\pgfmath@stack\expandafter{\pgfmath@temp}%
- \def\pgfmath@stacknextoperator{#1}}% <- Must \def. Cannot \let.
+\def\pgfmath@parse@@@ifbgroup#1{\pgfmath@parse@bgroup@after\pgfmath@bgroup#1\pgfmath@egroup}
-% \pgfmath@stackpushoperand
-%
-% Push an operand (i.e. a number) on the stack. It is
-% put within a TeX group to make popping a lot simpler.
-%
-\def\pgfmath@stackpushoperand#1{%
- \edef\pgfmath@temp{{#1}\the\pgfmath@stack}%
- \expandafter\pgfmath@stack\expandafter{\pgfmath@temp}%
+{
+\def\:{\pgfmath@parse@@@@ifbgroup}
+\expandafter\gdef\: {\futurelet\pgfmath@token@let\pgfmath@parse@@ifbgroup}
}
-% \pgfmath@stackpeek
-%
-% Peek (i.e. without removal) at the top of the stack.
-%
-\def\pgfmath@stackpeek{\expandafter\pgfmath@stackpeek@\the\pgfmath@stack\pgfmath@}
-\def\pgfmath@stackpeek@#1#2\pgfmath@{#1}%
+% Parse an operand.
+%
+\def\pgfmath@parse@operand{\expandafter\pgfmath@parse@@operand\pgfmath@token@next}%
-% \pgfmath@stackpop
-%
-% Pop (i.e. remove) the top of the stack into #1.
-%
-\def\pgfmath@stackpop#1{\expandafter\pgfmath@stackpop@\expandafter#1\the\pgfmath@stack\pgfmath@}
-\def\pgfmath@stackpop@#1#2#3\pgfmath@{\edef#1{#2}\pgfmath@stack{#3}}%
+\def\pgfmath@parse@@operand{\pgfmath@parse@ifbgroup{\pgfmath@parse@@operand}{\pgfmath@parse@@operand@}}
-% \pgfmath@stackpopoperation
-%
-% Remove and perform an operation from the stack.
-%
-\def\pgfmath@stackpopoperation{%
- \expandafter\pgfmath@stackpopoperation@\the\pgfmath@stack\pgfmath@%
-}
-\def\pgfmath@stackpopoperation@#1#2#3#4#5\pgfmath@{%
- \ifx\pgfmath@empty#1\relax%
- \pgfmath@stack{\pgfmath@empty\pgfmath@empty\pgfmath@empty\pgfmath@empty}%
+\def\pgfmath@parse@@operand@#1{%
+ \def\pgfmath@token{#1}%
+ \ifx\pgfmath@token\pgfmath@char@plus% Ignore.
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
\else%
- \ifx\pgfmath@empty#2\relax%
- \pgfmath@stack{{#1}\pgfmath@empty\pgfmath@empty\pgfmath@empty\pgfmath@empty}%
+ \ifx\pgfmath@token\pgfmath@char@minus%
+ \pgfmath@stack@push@operation{neg}% Unary minus.
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
\else%
- #2{#3}{#1}%
- \pgfmath@stack{#4#5}%
- \expandafter\pgfmath@stackpushoperand\expandafter{\pgfmathresult}%
- \fi\fi%
- \def\pgfmath@stacknextoperator{#4}}
+ \expandafter\ifx\csname pgfmath@operation@\expandafter\string\pgfmath@token @prefix\endcsname\pgfmath@token%
+ \let\pgfmath@parse@next=\pgfmath@parse@prefix@operator%
+ \else%
+ \ifpgfmath@quickparse%
+ \let\pgfmath@parse@next=\pgfmath@qparse@operand%
+ \else%
+ \let\pgfmath@number=\pgfmath@empty%
+ \expandafter\ifx\csname pgfmath@token@functional@\string#1\endcsname\relax%
+ \let\pgfmath@base=\pgfmath@empty%
+ \let\pgfmath@token@next=\pgfmath@token%
+ \if#10% Check for octal prefix.
+ \def\pgfmath@base{8}%
+ \fi%
+ \let\pgfmath@parse@next=\pgfmath@parse@number%
+ \else%
+ \let\pgfmath@function=\pgfmath@token%
+ \let\pgfmath@parse@next=\pgfmath@parse@function%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgfmath@parse@next%
+}
-% \pgfmath@processalloperations
-%
-% Process all operation in the stack. The
-% overall result is at the top of the stack.
+% Parse prefix operators.
%
-\def\pgfmath@processalloperations{%
- \expandafter\pgfmath@in@\pgfmath@stacknextoperator{\pgfmath@empty}%
- \ifpgfmath@in@%
- \let\pgfmath@processnext\relax%
+\def\pgfmath@parse@prefix@operator{%
+ \ifx\pgfmath@token\pgfmath@char@quote% Quote character.
+ \let\pgfmath@parse@next=\pgfmath@parse@operand@quote%
\else%
- \pgfmath@stackpopoperation%
- \let\pgfmath@processnext\pgfmath@processalloperations%
+ \ifx\pgfmath@token\pgfmath@char@exclamation% Prefix !.
+ \pgfmath@stack@push@operation{not}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
+ \else% Anything else, just push and hope.
+ \expandafter\pgfmath@stack@push@operation\expandafter{\pgfmath@token}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
+ \fi%
\fi%
- \pgfmath@processnext}
+ \pgfmath@parse@next%
+}%
-% \pgfmath@processoperationsuntil
-%
-% Process operations in the stack, until the specified
-% operation/s is/are encountered. The overall result is
-% at the top of the stack.
-%
-\def\pgfmath@processoperationsuntil#1{%
- \expandafter\pgfmath@in@\pgfmath@stacknextoperator{#1\pgfmath@empty}%
- \ifpgfmath@in@%
- \let\pgfmath@processnext\pgfmath@processoperationsuntil@end%
+
+% Quote part of an expression.
+%
+\def\pgfmath@parse@operand@quote#1"{%
+ \def\pgfmathresult{#1}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \pgfmath@parse@@operator%
+}
+
+% Quick operand parsing. Should always have units.
+% No functions, base conversion, quoting or scientific notation
+% are permitted.
+\def\pgfmath@qparse@operand{%
+ \afterassignment\pgfmath@qparse@@operand%
+ \pgfmath@dimen\pgfmath@token}
+\def\pgfmath@qparse@@operand{%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \pgfmath@parse@@operator%
+}
+
+% Parse a number, which can take the form:
+%
+% 1. An integer, or a decimal, with or without units.
+% 2. A dimension/skip or a count register.
+% 3. A dimension register preceded by a number or count register.
+% 4. A box dimension (e.g., \wd\mybox).
+% 5. A box dimension preceded by a number or a count register.
+% 6. Scientific notation (e.g., 1.234567e-10).
+% 7. A binary, hexadeciaml, or octal number.
+%
+\def\pgfmath@parse@number{\pgfmath@parse@ifbgroup{\pgfmath@parse@number}{\pgfmath@parse@number@}}
+\def\pgfmath@parse@number@#1{%
+ \let\pgfmath@token=\pgfmath@token@next%
+ \def\pgfmath@token@next{#1}%
+ \pgfmath@parse@@number}
+
+\def\pgfmath@parse@@number{%
+ \ifx\pgfmath@token\pgfmath@egroup@token%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmath@number}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@operator%
\else%
- \pgfmath@stackpopoperation%
- \let\pgfmath@processnext\pgfmath@processoperationsuntil%
+ \expandafter\ifcat\pgfmath@token\relax% A CS?
+ \expandafter\ifx\csname pgfmath@token@box@\expandafter\string\pgfmath@token\endcsname\relax%
+ % So, is the CS is a dimension or a count register?
+ \expandafter\pgfmath@dimen@\pgfmath@token%
+ \ifpgfmath@dimen@% A dimension register.
+ \global\pgfmathunitsdeclaredtrue%
+ \pgfmath@dimen=\pgfmath@number\pgfmath@token%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@operator%
+ \else% A count register.
+ \pgfmath@count=\pgfmath@token%
+ \expandafter\def\expandafter\pgfmath@number\expandafter{\the\pgfmath@count}%
+ \expandafter\ifcat\pgfmath@token@next\relax%
+ % A CS following a count register should be \wd, \ht or \dp.
+ \let\pgfmath@parse@next=\pgfmath@parse@number%
+ \else%
+ \let\pgfmathresult=\pgfmath@number%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@operator%
+ \fi%
+ \fi%
+ \else%
+ % This should be a box specification, for example, 0.5\wd\mybox.
+ \global\pgfmathunitsdeclaredtrue%
+ \pgfmath@dimen=\pgfmath@number\pgfmath@token\pgfmath@token@next%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operator%
+ \fi%
+ \else%
+ \expandafter\ifx\csname pgfmath@token@numeric@\expandafter\string\pgfmath@token\endcsname\relax%
+ % It isn't numeric (i.e., 012345679.), so it might be units...
+ \expandafter\ifx\csname pgfmath@token@unit@\pgfmath@token\expandafter\string\pgfmath@token@next\endcsname\relax%
+ % ...or the exponent characters...
+ \expandafter\ifx\csname pgfmath@token@exponent@\pgfmath@token\endcsname\relax%
+ % ...or a base prefix...
+ \expandafter\ifx\csname pgfmath@base@\pgfmath@number\pgfmath@token\endcsname\relax%
+ % ...none of the above...
+ \ifx\pgfmath@base\pgfmath@empty%
+ \let\pgfmathresult=\pgfmath@number%
+ \else%
+ \ifx\pgfmath@number\pgfmath@char@zero%
+ \let\pgfmathresult=\pgfmath@number%
+ \else%
+ % Convert from octal.
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\pgfmath@number}{8}{10}%
+ \fi%
+ \fi%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@operator%
+ \else%
+ % ...here, it is a base prefix 0x, 0X, 0b or 0B
+ \expandafter\let\expandafter\pgfmath@base\expandafter=%
+ \csname pgfmath@base@\pgfmath@number\pgfmath@token\endcsname%
+ \let\pgfmath@parse@next=\pgfmath@parse@base%
+ \fi%
+ \else% ... and here, it is the exponent characters.
+ \let\pgfmath@parse@next=\pgfmath@parse@exponent%
+ \fi%
+ \else% ...but here it is units.
+ \global\pgfmathunitsdeclaredtrue%
+ \pgfmath@dimen=\pgfmath@number\pgfmath@token\pgfmath@token@next\relax%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@dimen}}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operator%
+ \fi%
+ \else% It is numeric.
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfmath@number%
+ \expandafter\expandafter\expandafter{\expandafter\pgfmath@number\pgfmath@token}%
+ \ifx\pgfmath@token\pgfmath@char@period%
+ \let\pgfmath@base=\pgfmath@empty%
+ \fi%
+ \let\pgfmath@parse@next=\pgfmath@parse@number%
+ \fi%
+ \fi%
\fi%
- \pgfmath@processnext{#1}}
-\def\pgfmath@processoperationsuntil@end#1{}
+ \pgfmath@parse@next%
+}
+% Parse the exponent of a number.
+%
+% REMARK: this method will be overwritten by the FPU library. Please
+% keep changes consistent...
+\def\pgfmath@parse@exponent{%
+ \afterassignment\pgfmath@parse@@exponent%
+ \pgfmath@count\pgfmath@token@next}
+\def\pgfmath@parse@@exponent{%
+ \pgfmathscientific{\pgfmath@number}{\the\pgfmath@count}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \pgfmath@parse@@operator%
+}
-% OK. Now the operators are parsed.
-% These correspond to the + - / * ^ < > = operators and r (postfix) function.
+% Parse binary or hexadecimal numbers (octal numbers done elsehwere).
%
-\def\pgfmath@parseadd{%
- % If no operator has been assigned (i.e. + is the first operator scanned),
- % do nothing, except add addition to the stack.
- \ifx\pgfmath@stacknextoperator\pgfmath@empty%
+\def\pgfmath@parse@base{%
+ \ifnum\pgfmath@base=2\relax%
+ \let\pgfmath@parse@next=\pgfmath@parse@binary%
\else%
- % Empty the process stack up to any inequalities.
- \pgfmath@processoperationsuntil{\pgfmathequalto@\pgfmathlessthan@\pgfmathgreaterthan@}%
+ \ifnum\pgfmath@base=16\relax%
+ \let\pgfmath@parse@next=\pgfmath@parse@hexadecimal%
+ \else%
+ \pgfmath@error{Unexpected numerical base `\pgfmath@base'}{}%
+ \def\pgfmathresult{0}%
+ \let\pgfmath@parse@next=\pgfmath@parse@end%
+ \fi%
\fi%
- \pgfmath@stackpushoperator{\pgfmathadd@}%
- \pgfmath@parse@}
+ \let\pgfmath@number=\pgfmath@empty%
+ \expandafter\pgfmath@parse@next\pgfmath@token@next%
+}
-\def\pgfmath@parsesubtract{%
- % If no operator has been assigned (i.e. - is the first operator scanned),
- % do nothing, except add subtract to the stack.
- \ifx\pgfmath@stacknextoperator\pgfmath@empty%
+\def\pgfmath@parse@binary#1{%
+ \expandafter\ifx\csname pgfmath@token@binary@#1\endcsname\relax%
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\pgfmath@number}{2}{10}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \def\pgfmath@token@next{#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@operator%
\else%
- % Empty the process stack up to any inequalities.
- \pgfmath@processoperationsuntil{\pgfmathequalto@\pgfmathlessthan@\pgfmathgreaterthan@}%
+ \expandafter\def\expandafter\pgfmath@number\expandafter{\pgfmath@number#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@binary%
\fi%
- \pgfmath@stackpushoperator{\pgfmathsubtract@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parsemultiply{%
- % If no operator has been assigned (i.e. * is the first operator scanned),
- % do nothing, except push multiply onto the stack.
- \ifx\pgfmath@stacknextoperator\pgfmath@empty%
+ \pgfmath@parse@next%
+}
+
+\def\pgfmath@parse@hexadecimal#1{%
+ \expandafter\ifx\csname pgfmath@token@hexadecimal@#1\endcsname\relax%
+ \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\pgfmath@number}{16}{10}%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \def\pgfmath@token@next{#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@operator%
\else%
- % Process all operations up to inequalites or addition/subtraction
- \pgfmath@processoperationsuntil{\pgfmathequalto@\pgfmathlessthan@\pgfmathgreaterthan@%
- \pgfmathadd@\pgfmathsubtract@}%
+ \expandafter\def\expandafter\pgfmath@number\expandafter{\pgfmath@number#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@hexadecimal%
\fi%
- \pgfmath@stackpushoperator{\pgfmathmultiply@}%
- \pgfmath@parse@}
+ \pgfmath@parse@next%
+}
-\def\pgfmath@parsedivide{%
- % If no operator has been assigned (i.e. / is the first operator scanned),
- % do nothing, except push divide onto the stack.
- \ifx\pgfmath@stacknextoperator\pgfmath@empty%
+% Parse a function.
+%
+\def\pgfmath@parse@function{\pgfmath@parse@ifbgroup{\pgfmath@parse@function}{\pgfmath@parse@@function}}
+\def\pgfmath@parse@function@{\futurelet\pgfmath@token@let\pgfmath@parse@@function}
+\def\pgfmath@parse@@function{%
+ \ifx\pgfmath@token@let\pgfmath@sptoken%
+ \let\pgfmath@token=\pgfmath@empty%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@@function%
\else%
- % Process all operations up to inequalites or addition/subtraction
- \pgfmath@processoperationsuntil{\pgfmathequalto@\pgfmathlessthan@\pgfmathgreaterthan@%
- \pgfmathadd@\pgfmathsubtract@}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@@function%
\fi%
- \pgfmath@stackpushoperator{\pgfmathdivide@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parsegreaterthan{%
- % On scanning an equality/inequality operator everything up to
- % (but not including) the operator is evaluated...
- \pgfmath@processalloperations%
- % ...and the operation pushed onto the stack.
- \pgfmath@stackpushoperator{\pgfmathgreaterthan@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parselessthan{%
- \pgfmath@processalloperations%
- \pgfmath@stackpushoperator{\pgfmathlessthan@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parseequalto={%
- \pgfmath@processalloperations%
- \pgfmath@stackpushoperator{\pgfmathequalto@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parsepower{%
- % Easy, just push power onto the stack.
- \pgfmath@stackpushoperator{\pgfmathpow@}%
- \pgfmath@parse@}
-
-\def\pgfmath@parseradians{%
- % r is a post-fix function...
- \ifx\pgfmath@primaryoperation\pgfmath@empty%
- \else%
- \pgfmath@processoperationsuntil{\pgfmathequalto@\pgfmathlessthan@\pgfmathgreaterthan@%
- \pgfmathadd@\pgfmathsubtract@}%
- \fi%
- \pgfmath@stackpop{\pgfmath@temp}%
- \pgfmathdeg@{\pgfmath@temp}%
- % ...so processing returns to \pgfmath@parseoperator
- \pgfmath@parseoperator}
-
-\newcount\c@pgfmath@parsecounta
-\newcount\c@pgfmath@parsecountb
-\newcount\c@pgfmath@parsecountc
-\newdimen\pgfmath@parsex
+ \pgfmath@parse@next}
+
+\def\pgfmath@parse@@@function#1{%
+ \expandafter\ifx\csname pgfmath@token@functional@\expandafter\string#1\endcsname\relax%
+ \expandafter\ifx\csname pgfmath@token@number@\expandafter\string#1\endcsname\relax%
+ \def\pgfmath@token{#1}% Not from A-Z, a-z, 0-9, or _.
+ \let\pgfmath@parse@next=\pgfmath@parse@@@@function%
+ \else% It is from 0-9.
+ \expandafter\def\expandafter\pgfmath@function\expandafter{\pgfmath@function#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@function@%
+ \fi%
+ \else% It is from from A-Z, a-z, or _.
+ \edef\pgfmath@function{\pgfmath@function#1}%
+ \let\pgfmath@parse@next=\pgfmath@parse@function@%
+ \fi%
+ \pgfmath@parse@next}
-% \pgfmath@quickparseoperand
-%
-% An operand can *only* be a dimension.
-%
-\def\pgfmath@quickparseoperand{%
- \afterassignment\pgfmath@quickparseoperand@%
- \pgfmath@parsex\pgfmath@token}
-\def\pgfmath@quickparseoperand@{%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \pgfmath@parseoperator%
-}
-
-% \pgfmath@parseoperand
-%
-% An operand can be an ASCII number (with or without dimensions, with
-% or without a decimal point), a TeX register (count, dimen or skip,
-% which may have expanded with \the), or a function e.g. sin(X).
-%
-% It is assumed that after \edef-ing, the only unexpanded tokens are registers.
-%
-\def\pgfmath@parseoperand{%
- \def\pgfmath@sign{}%
- \expandafter\pgfmath@parseoperandsign\pgfmath@token}
-\def\pgfmath@parseoperandsign#1{%
- \pgfmath@in@#1{-+}%
- \ifpgfmath@in@
- % Gobble multiple signs.
- \edef\pgfmath@sign{\pgfmath@sign#1}%
- \expandafter\pgfmath@parseoperandsign%
+\def\pgfmath@parse@@@@function{%
+ \expandafter\ifx\csname pgfmath@function@\pgfmath@function\endcsname\relax%
+ \pgfmath@error{Unknown function `\pgfmath@function'}{}%
+ \def\pgfmathresult{0}%
+ \let\pgfmath@parse@next=\pgfmath@parse@end%
\else%
- \expandafter\pgfmath@parsenumberorfunction\expandafter#1%
+ \expandafter\ifnum\csname pgfmath@operation@\pgfmath@function @arity\endcsname=0\relax%
+ % Functions with zero arity are called directly.
+ \csname pgfmath\pgfmath@function @\endcsname%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operator%
+ \else% Otherwise, they are pushed onto the operator stack
+ \expandafter\pgfmath@stack@push@operation\expandafter{\pgfmath@function}%
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
+ \fi%
+ \fi%
+ \expandafter\pgfmath@parse@next\pgfmath@token}
+
+% Parse an operator.
+%
+\def\pgfmath@parse@operator{\pgfmath@parse@ifbgroup{\pgfmath@parse@operator}{\pgfmath@parse@operator@}}%
+\def\pgfmath@parse@operator@#1{% Get one token.
+ \let\pgfmath@token=\pgfmath@token@next%
+ \def\pgfmath@token@next{#1}%
+ \pgfmath@parse@@@operator}
+
+\def\pgfmath@parse@@operator{\pgfmath@parse@ifbgroup{\pgfmath@parse@@operator}{\pgfmath@parse@@operator@}}%
+\def\pgfmath@parse@@operator@#1{% Get first token...
+ \def\pgfmath@token{#1}%
+ \pgfmath@parse@ifbgroup{\pgfmath@parse@@operator@@}{\pgfmath@parse@@operator@@}}%
+\def\pgfmath@parse@@operator@@#1{% ...and second token.
+ \def\pgfmath@token@next{#1}%
+ \pgfmath@parse@@@operator}
+
+\def\pgfmath@parse@@@operator{%
+ \expandafter\ifx\csname pgfmath@operator@\pgfmath@token\expandafter\string\pgfmath@token@next\endcsname\relax%
+ % Not a double character operator.
+ \expandafter\ifx\csname pgfmath@operator@\pgfmath@token\endcsname\relax%
+ % Not a single character operator.
+ \pgfmath@error{Unknown operator `\pgfmath@token' or `\pgfmath@token\pgfmath@token@next'}{}%
+ \def\pgfmathresult{0}%
+ \let\pgfmath@parse@next=\pgfmath@parse@end%
+ \else%
+ \expandafter\pgfmath@operation@process\expandafter{\pgfmath@token}%
+ \ifx\pgfmath@token\pgfmath@text@@%
+ \let\pgfmath@parse@next=\pgfmath@parse@end%
+ \else%
+ \expandafter\ifx\csname pgfmath@operation@\pgfmath@token @postfix\endcsname\pgfmath@token%
+ % Postfix operators are followed by an operator.
+ \ifx\pgfmath@token@next\pgfmath@char@leftbracket% Except [.
+ \let\pgfmath@parse@next=\pgfmath@parse@operand%
+ \else%
+ \let\pgfmath@parse@next=\pgfmath@parse@operator%
+ \fi%
+ \else%
+ % Any other operator is followed by an operand.
+ \let\pgfmath@parse@next=\pgfmath@parse@operand%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ % A double character operator...
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgfmath@token\expandafter\expandafter\expandafter%
+ {\expandafter\pgfmath@token\pgfmath@token@next}%
+ \expandafter\pgfmath@operation@process\expandafter{\pgfmath@token}%
+ % ...is always followed by an operand.
+ \let\pgfmath@parse@next=\pgfmath@parse@@operand%
\fi%
+ \pgfmath@parse@next%
}
-\newif\ifpgfmath@dimen@
-\def\pgfmath@ifregisterdimen@#1\pgfmath@{%
- \pgfmath@in@{p}{#1}%
- \ifpgfmath@in@%
- \pgfmath@dimen@true%
+% Process an operation.
+%
+\def\pgfmath@operation@process#1{%
+ \def\pgfmath@operator{#1}%
+ \ifx\pgfmath@stack@operation@top\pgfmath@stack@empty%
\else%
- \pgfmath@dimen@false%
- \fi}
-
-\def\pgfmath@parsenumberorfunction#1{%
- \let\pgfmath@parsenext\pgfmath@parsenumberorfunction@simple%
- \ifx#1\wd\let\pgfmath@parsenext\pgfmath@boxdimen\fi%
- \ifx#1\ht\let\pgfmath@parsenext\pgfmath@boxdimen\fi%
- \ifx#1\dp\let\pgfmath@parsenext\pgfmath@boxdimen\fi%
- \pgfmath@parsenext#1%
-}
-
-\def\pgfmath@boxdimen#1#2{%
- \pgfmath@parsex=\pgfmath@sign#1#2%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \global\pgfmathunitsdeclaredtrue% a dimension has units
- \pgfmath@parseoperator%
+ \pgfmath@operation@@process%
+ \fi%
+ \expandafter\ifx\csname pgfmath@token@specials@#1\endcsname\relax%
+ \pgfmath@stack@push@operation{#1}%
+ \fi%
}
-\def\pgfmath@parsenumberorfunction@simple#1{%
- \expandafter\ifcat#1\relax%
- % So, a TeX register.
- \afterassignment\pgfmath@ifregisterdimen@%
- \pgfmath@parsex\pgfmath@sign#1pt\relax\pgfmath@%
- \ifpgfmath@dimen@%
- % A dimension! So stop scanning operand here.
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \global\pgfmathunitsdeclaredtrue% a dimension has units
- \def\pgfmath@temp{}%
- \let\pgfmath@parsenext\pgfmath@parseoperator%
+% Process the operation stack.
+%
+\def\pgfmath@operation@@process{%
+ \ifx\pgfmath@stack@operation@top\pgfmath@stack@empty%
+ \let\pgfmath@parse@next=\relax%
+ \else%
+ \ifnum\csname pgfmath@operation@\pgfmath@operator @precedence\endcsname>%
+ \csname pgfmath@operation@\pgfmath@stack@operation@top @precedence\endcsname\relax%
+ % If the precedence of the scanned operator is greater than the
+ % precedence of the operator at the top of the stack, do nothing.
+ \let\pgfmath@parse@next=\relax%
\else%
- % A count! Expand it, but carry on as usual as it might
- % be immediately followed by a dimension.
- \ifdim\pgfmath@parsex<0pt\relax%
- \edef\pgfmath@sign{\pgfmath@sign-}%
- \pgfmath@parsex-\pgfmath@parsex%
+ \let\pgfmath@stack@operation@last=\pgfmath@stack@operation@top%
+ \expandafter\ifx\csname pgfmath@operator@\pgfmath@stack@operation@top\endcsname\relax%
+ \pgfmath@function@@@process%
+ \else%
+ \pgfmath@operator@@@process%
+ \fi%
+ \expandafter\pgfmath@stack@push@operand\expandafter{\pgfmathresult}%
+ \expandafter\ifx\csname pgfmath@token@group@\pgfmath@stack@operation@last\pgfmath@operator\endcsname\relax%
+ \let\pgfmath@parse@next=\pgfmath@operation@@process%
+ \else%
+ \let\pgfmath@parse@next=\relax%
\fi%
- \edef\pgfmath@temp{\pgfmath@tonumber{\pgfmath@parsex}}%
- \let\pgfmath@parsenext\pgfmath@parsenumberorfunction@%
\fi%
- \else%
- % Could be a number or a function...?
- \edef\pgfmath@temp{#1}%
- \let\pgfmath@parsenext\pgfmath@parsenumberorfunction@%
\fi%
- \expandafter\pgfmath@parsenext\pgfmath@temp%
-}%
-
-\def\pgfmath@parsenumberorfunction@#1{%
- \ifx#1(% It might be a group e.g. -(1+2)...
- \let\pgfmath@parsenext\pgfmath@parseoperandgroup%
+ \pgfmath@parse@next%
+}
+
+% Process an operator.
+%
+\def\pgfmath@operator@@@process{% Process an operator.
+ \pgfmath@stack@pop@operation\pgfmath@@operator%
+ \pgfmath@stack@pop@operand\pgfmath@operand@a%
+ \ifcase\csname pgfmath@operation@\pgfmath@@operator @arity\endcsname\relax%
+ % Zero arity operators (!).
+ \or%
+ \pgfmath@operator@@@@process{\pgfmath@operand@a}%
+ \or%
+ \pgfmath@stack@pop@operand\pgfmath@operand@b%
+ \pgfmath@operator@@@@process{\pgfmath@operand@b}{\pgfmath@operand@a}%
+ \or%
+ \pgfmath@stack@pop@operand\pgfmath@operand@b%
+ \expandafter\pgfmath@operator@@@@process\expandafter%
+ {\expandafter\pgfmath@operand@b\expandafter}\pgfmath@operand@a%
\else%
- \pgfmath@in@{#1}{.0123456789}%
- \ifpgfmath@in@% ... or a number...
- \let\pgfmath@parsenext\pgfmath@parsenumber%
- \else% ... or a function.
- \let\pgfmath@parsenext\pgfmath@parsefunction%
- \fi%
+ % No operators with more than tenary arity.
\fi%
- \pgfmath@parsenext#1%
-}%
-
-\def\pgfmath@parseoperandgroup({%
- \let\pgfmath@postparsegroup\pgfmath@@parseoperandgroup%
- \pgfmath@startparsegroup%
-}
-
-\def\pgfmath@@parseoperandgroup{%
- \let\pgfmath@postparsegroup\pgfmath@parseoperator%
- \edef\pgfmathresult{\pgfmath@sign\pgfmathresult}%
- \pgfmath@parseoperator%
}
-\def\pgfmath@parsenumber{%
- % Consider the number 3.14159
- % 3 is parsed by assignment to a, then '.' is absorbed and 14159
- % parsed by assignement to b (actually b=114159, see below).
- \c@pgfmath@parsecountc0\relax%
- \afterassignment\pgfmath@parsedecimalpoint%
- \c@pgfmath@parsecounta0}
-
-\def\pgfmath@parsedecimalpoint#1{%
- \ifx#1.% Is there a decimal point? If not, see if there are any units.
- \let\pgfmath@parsenext\pgfmath@parsemantissa%
- \else%
- \c@pgfmath@parsecountb10\relax% The first digit of b is gobbled (see below).
- \let\pgfmath@parsenext\pgfmath@parseunits%
- \fi%
- \pgfmath@parsenext#1}
-
-
+\def\pgfmath@operator@@@@process{%
+ \csname pgfmath%
+ \csname pgfmath@operation@\pgfmath@@operator @name\endcsname%
+ @\endcsname}
-% We would like to assign the following number (which is the mantisse)
-% to a number. However, for a very long mantisse as in 3.141592653589793238462643
-% this will fail since the number becomes too large.
+% Process a function.
%
-% Because of this, we have to do some ``magic'': We scan 9 tokens and
-% then do an assignment with a guard after 9 tokens so that the
-% assigment cannot fail.
-%
-\def\pgfmath@parsemantissa.#1#2#3#4#5#6#7#8#9{%
- \afterassignment\pgfmath@checkforguard%
- % Consider the number: 2.005
- % 2 is assigned to a, but b will be assigned 5, which is *not right*.
- % So using 1 here hereresults in b=1005. The first digit is then
- % gobbled later, when expanded with \the.
- \c@pgfmath@parsecountb1#1#2#3#4#5#6#7#8#9\relax}%
-
-\def\pgfmath@checkforguard{%
- \pgfmath@ifnextchar\relax%
- {%
- % Ok, this is a looong mantisse. Start gobbling all following
- % numbers
- \pgfmath@gobblemantisse%
- }%
- {%
- \pgfmath@removeguard%
- }%
+\def\pgfmath@function@@@process{% Process a function.
+ \ifnum\csname pgfmath@operation@\pgfmath@stack@operation@top @arity\endcsname>0\relax%
+ \pgfmath@stack@pop@operation\pgfmath@@function%
+ \pgfmath@stack@pop@operand\pgfmath@@operand%
+ \ifnum\csname pgfmath@operation@\pgfmath@@function @arity\endcsname>1\relax%
+ \ifnum\csname pgfmath@operation@\pgfmath@@function @arity\endcsname>9\relax%
+ \csname pgfmath\pgfmath@@function @\endcsname{\pgfmath@@operand}%
+ \else%
+ \expandafter\pgfmath@function@@@@process\pgfmath@@operand%
+ \fi
+ \else%
+ \expandafter\pgfmath@function@@@@process\expandafter{\pgfmath@@operand}%
+ \fi%
+ \fi%
}
-\def\pgfmath@gobblemantisse\relax#1#2#3#4#5#6#7#8#9{%
- \afterassignment\pgfmath@checkforguard%
- \c@pgfmath@parsecountc0#1#2#3#4#5#6#7#8#9\relax% these digits are ignored
-}
+\def\pgfmath@function@@@@process{\csname pgfmath\pgfmath@@function @\endcsname}
-\def\pgfmath@removeguard#1\relax{\pgfmath@parseunits#1}
-
-
-\def\pgfmath@parseunits#1{%
- % Here the extra first digit in b is gobbled.
- \edef\pgfmath@resulttemp{%
- \pgfmath@sign\the\c@pgfmath@parsecounta.\expandafter\pgfmath@gobbleone\the\c@pgfmath@parsecountb}%
- % Check whether #1 is a \dp, \wd, or \ht
- \let\pgfmath@parsenext=\pgfmath@parseunits@simple%
- \ifx#1\wd\let\pgfmath@parsenext=\pgfmath@parseunits@boxdimen\fi%
- \ifx#1\ht\let\pgfmath@parsenext=\pgfmath@parseunits@boxdimen\fi%
- \ifx#1\dp\let\pgfmath@parsenext=\pgfmath@parseunits@boxdimen\fi%
- \pgfmath@parsenext#1%
-}
+% Stack.
+%
+\newtoks\pgfmath@stack@operand
+\newtoks\pgfmath@stack@operation
+\let\pgfmath@stack@empty=\pgfmath@empty
-\def\pgfmath@parseunits@boxdimen#1#2{%
- \pgfmath@parsex=\pgfmath@sign#1#2%
- \pgfmath@parsex\pgfmath@resulttemp\pgfmath@parsex%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \global\pgfmathunitsdeclaredtrue% a dimension has units
- \pgfmath@parseoperator%
-}
+\def\pgfmath@stack@push#1#2{%
+ \def\pgfmath@stack@top{#2}%
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter%
+ {\expandafter\pgfmath@stack@top\expandafter}\the#1}}%
-\def\pgfmath@parseunits@simple#1{%
- % Now check if #1 is actually a register.
- \ifcat#1\relax%
- \afterassignment\pgfmath@ifregisterdimen@%
- \pgfmath@parsex#1pt\relax\pgfmath@%
- \pgfmath@parsex\pgfmath@resulttemp\pgfmath@parsex%
- \ifpgfmath@dimen@% If it's a dimen stop scanning operand here.
- \global\pgfmathunitsdeclaredtrue% a dimension has units
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \let\pgfmath@parsenext\pgfmath@parseoperator%
- \else
- \edef\pgfmath@resulttemp{\pgfmath@tonumber{\pgfmath@parsex}}%
- \let\pgfmath@parsenext\pgfmath@parseunits@%
- \fi%
- \expandafter\pgfmath@parsenext%
- \else%
- \expandafter\pgfmath@parseunits@\expandafter#1%
- \fi}
+\def\pgfmath@stack@pop#1#2{\expandafter\pgfmath@stack@@pop\the#1\pgfmath@stack@stop{#1}{#2}}
+\def\pgfmath@stack@@pop#1#2#3\pgfmath@stack@stop#4#5{\def#5{#1}#4={{#2}#3}\def\pgfmath@stack@top{#2}}
-\def\pgfmath@parseunits@#1#2{%
- % Check if #1 is an operator, or the character `@' indicating the end of the parse.
- \pgfmath@in@#1{@+-*/^r<>=()}%
- \ifpgfmath@in@%
- \edef\pgfmath@tokens{#1#2}%
- \edef\pgfmathresult{\pgfmath@resulttemp}%
- \let\pgfmath@parsenext\pgfmath@parseoperator%
- \else%
- \pgfmath@in@#1{Ee}% e+0X
- \ifpgfmath@in@%
- % Oh no! It might be and em or an ex...
- \pgfmath@in@#2{mx}%
- \ifpgfmath@in@%
- \global\pgfmathunitsdeclaredtrue%
- \pgfmath@parsex\pgfmath@resulttemp#1#2\relax%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \edef\pgfmath@tokens{}%
- \let\pgfmath@parsenext\pgfmath@parseoperator%
- \else%
- \edef\pgfmath@tokens{#2}%
- \let\pgfmath@parsenext\pgfmath@parsescientific%
- \fi%
- \else
- % Anything else *should* be a TeX unit.
- \global\pgfmathunitsdeclaredtrue%
- \pgfmath@parsex\pgfmath@resulttemp#1#2\relax%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@parsex}}%
- \edef\pgfmath@tokens{}%
- \let\pgfmath@parsenext\pgfmath@parseoperator%
- \fi\fi%
- \expandafter\pgfmath@parsenext\pgfmath@tokens%
-}
+\def\pgfmath@stack@push@operation#1{%
+ \pgfmath@stack@push\pgfmath@stack@operation{#1}%
+ \let\pgfmath@stack@operation@top=\pgfmath@stack@top}
-% Parse 'Scientific' notation in the form xEyy
-%
-\def\pgfmath@parsescientific{%
- \afterassignment\pgfmath@parsescientific@%
- \c@pgfmath@parsecounta}
-
-\def\pgfmath@parsescientific@{%
- \edef\pgfmath@parsesci@temp{\pgfmath@resulttemp\the\c@pgfmath@parsecountc}%
- \expandafter\pgfmathscientific\expandafter{\pgfmath@parsesci@temp}%
- {\the\c@pgfmath@parsecounta}%
- \edef\pgfmath@resulttemp{\pgfmathresult}%
- \pgfmath@parseunits@}
-
-% Functions parsed (not calculated) here are:
-%
-% round(X) 'half-up' rounding.
-% floor(X) floor function.
-% ciel(X) ceiling function.
-% abs(X) absolute function.
-%
-% exp(X) e^X (0 <= X <~= 9.7).
-% ln(X) logarithm of X.
-% pow(X,Y) X^Y,
-%
-% sin(X) sine function.
-% cos(X) cosine function.
-% tan(X) tan function.
-% asin(X) arcsine of X (in radians) -1 <= X <= 1
-% acos(X) arccosine of X (in radians) -1 <= X <= 1
-% atan(X) arctangent of X (in radians) -1 <= X <= 1
-% veclen(X,Y) the length Z where Z^2 = X^2 + Y^2
-% mod(X,Y) X modulo Y
-% max(X,Y) the maximum of X or Y
-% min(X,Y) the minimum of X or Y
-%
-% NB veclen, mod, max, and min *cannot* be nested.
-%
-% deg(X) converts X to degrees (X in radians)
-% rad(X) converts X to radians (X in degrees)
-%
-% rnd generate pseudo-random number X (0 <= X <= 1).
-% rand generate pseudo-random number X (1 <= X <= -1).
-% sqrt(X) square root.
-%
-% pi the constant PI.
-
-\def\pgfmath@parsefunction{%
- \def\pgfmath@parsedfunctionname{}%
- \futurelet\pgfmath@parsetoken\pgfmath@parsefunction@@}
-\def\pgfmath@parsefunction@@#1{%
- \pgfmath@in@#1{()@+-*/^<>=}% A function name ends with one of these...
- \ifpgfmath@in@%
- \let\pgfmath@parsefunctionnext\pgfmath@parsefunction@end%
- \else%
- \ifx\pgfmath@parsetoken\pgfmath@sptoken% ...or a space.
- \let\pgfmath@parsefunctionnext\pgfmath@parsefunction@end%
- \else%
- \let\pgfmath@parsefunctionnext\pgfmath@parsefunction@continue%
- \fi\fi%
- \pgfmath@parsefunctionnext#1}
-
-\def\pgfmath@parsefunction@end#1{%
- \expandafter\ifx\csname pgfmath@parsefunction@\pgfmath@parsedfunctionname\endcsname\relax%
- \pgfmath@reportunknownfunction%
- \let\pgfmath@parsefunctionnext\relax%
- \else%
- \let\pgfmath@parsefunctionnext\pgfmath@executeparsefunction@%
- \fi%
- \pgfmath@parsefunctionnext#1}
-
-\def\pgfmath@parsefunction@continue#1{%
- \edef\pgfmath@parsedfunctionname{\pgfmath@parsedfunctionname#1}%
- \futurelet\pgfmath@parsetoken\pgfmath@parsefunction@@}
+\def\pgfmath@stack@pop@operation#1{%
+ \pgfmath@stack@pop\pgfmath@stack@operation{#1}%
+ \let\pgfmath@stack@operation@top=\pgfmath@stack@top}
-\def\pgfmath@executeparsefunction@{\csname pgfmath@parsefunction@\pgfmath@parsedfunctionname\endcsname}
-
-
-\def\pgfmath@reportunknownfunction{%
- \pgfmath@error{Unknown function `\pgfmath@parsedfunctionname'}{}%
-}
-
-% \pgfmath@postfunction
-%
-% In scanning a function e.g. sin(40), we subvert the normal parsing
-% group mechanism by messing around with \pgfmath@parsepostgroup, so
-% that after scanning ), the parser doesn't scan for an operator, but
-% returns to the macros scanning the function.
-% Here the mechanism is restored, and the value of the function is
-% stored along with the approprate sign, which was saved earlier.
-%
-\def\pgfmath@postfunction{%
- \let\pgfmath@parsepostgroup\pgfmath@parseoperator%
- \edef\pgfmathresult{\pgfmath@sign\pgfmathresult}%
- \pgfmath@parseoperator}
+% REMARK: This method will be overwritten by the FPU library. Please
+% keep any changes consistent.
+\def\pgfmath@stack@push@operand#1{%
+ \pgfmath@stack@push\pgfmath@stack@operand{#1}%
+ \let\pgfmath@stack@operand@top=\pgfmath@stack@top}
+
+\def\pgfmath@stack@pop@operand#1{%
+ \pgfmath@stack@pop\pgfmath@stack@operand{#1}%
+ \let\pgfmath@stack@operand@top=\pgfmath@stack@top}
-% \pgfmath@parsefunction@abs
+% Declare an operator for the parser.
%
-\def\pgfmath@parsefunction@abs{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@abs@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@abs@{%
- \expandafter\pgfmathabs@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
-
-% \pgfmath@parsefunction@sqrt
+% It is not recommended that new operators be created as
+% the parser is not fully robust for arbitrary operators.
%
-\def\pgfmath@parsefunction@sqrt{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@sqrt@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@sqrt@{%
- \expandafter\pgfmathsqrt@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
+\def\pgfmathdeclareoperator#1#2#3#4#5{%
+ \pgfmath@namedef{pgfmath@operator@\string#1}{#1}%
+ \pgfmath@namedef{pgfmath@operation@\string#1@name}{#2}%
+ \pgfmath@namedef{pgfmath@operation@\string#1@arity}{#3}%
+ \pgfmath@namedef{pgfmath@operation@\string#1@#4}{#1}%
+ \pgfmath@namedef{pgfmath@operation@\string#1@precedence}{#5}%
}
-% \pgfmath@parsefunction@round
-%
-\def\pgfmath@parsefunction@round{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@round@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@round@{%
- \expandafter\pgfmathround@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{+}{add} {2}{infix}{500}
+\pgfmathdeclareoperator{-}{subtract}{2}{infix}{500}
+\pgfmathdeclareoperator{*}{multiply}{2}{infix}{700}
+\pgfmathdeclareoperator{/}{divide} {2}{infix}{700}
+\pgfmathdeclareoperator{^}{pow} {2}{infix}{900}
-% \pgfmath@parsefunction@floor
-%
-\def\pgfmath@parsefunction@floor{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@floor@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@floor@{%
- \expandafter\pgfmathfloor@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{<} {} {1}{prefix} {1}
-% \pgfmath@parsefunction@ceil
-%
-\def\pgfmath@parsefunction@ceil{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@ceil@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@ceil@{%
- \expandafter\pgfmathceil@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{>} {greater} {2}{infix} {250}
+\pgfmathdeclareoperator{<} {less} {2}{infix} {250}
+\pgfmathdeclareoperator{==}{equal} {2}{infix} {250}
+\pgfmathdeclareoperator{>=}{notless} {2}{infix} {250}
+\pgfmathdeclareoperator{<=}{notgreater}{2}{infix} {250}
+\pgfmathdeclareoperator{&&}{and} {2}{infix} {200}
+\pgfmathdeclareoperator{||}{or} {2}{infix} {200}
+\pgfmathdeclareoperator{!=}{notequalto}{2}{infix} {250}
+\pgfmathdeclareoperator{!} {not} {1}{prefix}{975}
+\pgfmathdeclareoperator{?} {ifthenelse}{3}{infix} {100}
+\pgfmathdeclareoperator{:} {@@collect} {2}{infix}{101}
-% \pgfmath@parsefunction@sin
-%
-\def\pgfmath@parsefunction@sin{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@sin@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@sin@{%
- \expandafter\pgfmathsin@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{!}{factorial}{1}{postfix}{800}% Must be defined after prefix ! operator.
+\pgfmathdeclareoperator{r}{deg} {1}{postfix}{600}
-% \pgfmath@parsefunction@cos
-%
-\def\pgfmath@parsefunction@cos{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@cos@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@cos@{%
- \expandafter\pgfmathcos@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{,}{@collect} {2}{infix} {10}
+\pgfmathdeclareoperator{[}{@startindex}{2}{prefix} {7}
+\pgfmathdeclareoperator{]}{@endindex} {0}{postfix}{6}
+\pgfmathdeclareoperator{(}{@startgroup}{1}{prefix} {5}
+\pgfmathdeclareoperator{)}{@endgroup} {0}{postfix}{4}
-% \pgfmath@parsefunction@asin
-%
-\def\pgfmath@parsefunction@asin{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@asin@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@asin@{%
- \expandafter\pgfmathasin@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\pgfmathdeclareoperator{\pgfmath@bgroup}{@startarray}{1}{prefix} {3}
+\pgfmathdeclareoperator{\pgfmath@egroup}{@endarray} {1}{postfix}{2}%
-% \pgfmath@parsefunction@acos
-%
-\def\pgfmath@parsefunction@acos{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@acos@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@acos@{%
- \expandafter\pgfmathacos@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction}
-
-% \pgfmath@parsefunction@atan
-%
-\def\pgfmath@parsefunction@atan{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@atan@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@atan@{%
- \expandafter\pgfmathatan@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+% Special operators.
+\pgfmathdeclareoperator{"}{}{1}{prefix}{1}
+\pgfmathdeclareoperator{@}{}{0}{postfix}{0}
-% \pgfmath@parsefunction@tan
-%
-\def\pgfmath@parsefunction@tan{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@tan@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@tan@{%
- \expandafter\pgfmathtan@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+% Internal functions.
-% \pgfmath@parsefunction@cot
+% Begin and end parenthesis ().
%
-\def\pgfmath@parsefunction@cot{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@cot@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@cot@{%
- \expandafter\pgfmathcot@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\def\pgfmath@startgroup@#1{\edef\pgfmathresult{#1}}
+\def\pgfmath@endgroup@{}% Never actually called.
-% \pgfmath@parsefunction@sec
+% Begin and end array access [].
%
-\def\pgfmath@parsefunction@sec{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@sec@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@sec@{%
- \expandafter\pgfmathsec@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\def\pgfmath@startindex@#1#2{%
+ \expandafter\pgfmatharray@#1{#2}%
+ \expandafter\pgfmath@bgroup@strip\expandafter{\pgfmathresult}%
+ \ifx\pgfmath@token@let\bgroup%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\expandafter{\pgfmathresult}}%
+ \fi}
+\def\pgfmath@endindex@{}% Never actually called.
-% \pgfmath@parsefunction@cosec
+% Begin and end array {}.
%
-\def\pgfmath@parsefunction@cosec{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@cosec@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@cosec@{%
- \expandafter\pgfmathcosec@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
+\def\pgfmath@startarray@#1{\expandafter\def\expandafter\pgfmathresult\expandafter{\expandafter{#1}}}
+\def\pgfmath@endarray@#1{\expandafter\def\expandafter\pgfmathresult\expandafter{#1}}% Never actually called.
-% \pgfmath@parsefunction@rad
-%
-\def\pgfmath@parsefunction@rad{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@rad@%
- \pgfmath@parse@}
-\def\pgfmath@parsefunction@rad@{%
- \expandafter\pgfmathrad@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction}%
-
-% \pgfmath@parsefunction@rad
-%
-\def\pgfmath@parsefunction@deg{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@deg@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@deg@{%
- \expandafter\pgfmathdeg@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction}%
-
-% \pgfmath@parsefunction@rnd
-%
-\def\pgfmath@parsefunction@rnd{%
- \expandafter\pgfmathrnd%
- \expandafter\pgfmath@postfunction}
-
-% \pgfmath@parsefunction@rand
-%
-\def\pgfmath@parsefunction@rand{%
- \expandafter\pgfmathrand%
- \expandafter\pgfmath@postfunction}%
-
-% \pgfmath@parsefunction@exp
-%
-\def\pgfmath@parsefunction@exp{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@exp@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@exp@{%
- \expandafter\pgfmathexp@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
-}
-% \pgfmath@parsefunction@ln
-%
-\def\pgfmath@parsefunction@ln{%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@ln@%
- \expandafter\pgfmath@parse@}
-\def\pgfmath@parsefunction@ln@{%
- \expandafter\pgfmathln@\expandafter{\pgfmathresult}%
- \pgfmath@postfunction%
+\def\pgfmath@@collect@#1#2{%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgfmathresult\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter%
+ {\expandafter#1\expandafter}\expandafter{#2}}%
}
-
-% \pgfmath@parsefunction@pi
+% Collect items separated by ,.
%
-\def\pgfmath@parsefunction@pi{%
- \pgfmathpi%
- \pgfmath@postfunction%
+\def\pgfmath@collect@#1#2{%
+ \expandafter\def\expandafter\pgfmath@collect@original\expandafter{#1}%
+ \expandafter\pgfmath@bgroup@strip\expandafter{#1}%
+ \ifx\pgfmath@token@let\bgroup%
+ \ifx\pgfmath@collect@original\pgfmath@bgroup@stripped%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmath@bgroup@stripped}%
+ \else%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\expandafter{\pgfmath@bgroup@stripped}}%
+ \fi%
+ \else%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\expandafter{\pgfmath@bgroup@stripped}}%
+ \fi%
+ \expandafter\pgfmath@bgroup@strip\expandafter{#2}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgfmathresult\expandafter\expandafter\expandafter%
+ {\expandafter\pgfmathresult\expandafter{\pgfmath@bgroup@stripped}}%
}
-% \pgfmath@parsefunction@veclen
+% Strip braces from a token sequence.
%
-\def\pgfmath@parsefunction@veclen{%
- \expandafter\pgfmath@parsefunction@veclen@}
-\def\pgfmath@parsefunction@veclen@(#1,{%
- \pgfmathparse@{#1}\edef\pgfmath@firstoperand{\pgfmathresult}%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@veclen@@
- \pgfmath@startparsegroup}
-\def\pgfmath@parsefunction@veclen@@{%
- \edef\pgfmath@secondoperand{\pgfmathresult}%
- \pgfmathveclen@{\pgfmath@firstoperand}{\pgfmath@secondoperand}%
- \pgfmath@postfunction}
-
-% \pgfmath@parsefunction@mod
-%
-\def\pgfmath@parsefunction@mod{%
- \expandafter\pgfmath@parsefunction@mod@}
-\def\pgfmath@parsefunction@mod@(#1,{%
- \pgfmathparse@{#1}\edef\pgfmath@firstoperand{\pgfmathresult}%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@mod@@
- \pgfmath@startparsegroup}
-\def\pgfmath@parsefunction@mod@@{%
- \edef\pgfmath@secondoperand{\pgfmathresult}%
- \pgfmathmod@{\pgfmath@firstoperand}{\pgfmath@secondoperand}%
- \pgfmath@postfunction}
-
-% \pgfmath@parsefunction@max
-%
-\def\pgfmath@parsefunction@max{%
- \expandafter\pgfmath@parsefunction@max@}
-\def\pgfmath@parsefunction@max@(#1,{%
- \pgfmathparse@{#1}\edef\pgfmath@firstoperand{\pgfmathresult}%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@max@@
- \pgfmath@startparsegroup}
-\def\pgfmath@parsefunction@max@@{%
- \edef\pgfmath@secondoperand{\pgfmathresult}%
- \pgfmathmax@{\pgfmath@firstoperand}{\pgfmath@secondoperand}%
- \pgfmath@postfunction}
-
-% \pgfmath@parsefunction@min
-%
-\def\pgfmath@parsefunction@min{%
- \expandafter\pgfmath@parsefunction@min@}
-\def\pgfmath@parsefunction@min@(#1,{%
- \pgfmathparse@{#1}\edef\pgfmath@firstoperand{\pgfmathresult}%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@min@@
- \pgfmath@startparsegroup}
-\def\pgfmath@parsefunction@min@@{%
- \edef\pgfmath@secondoperand{\pgfmathresult}%
- \pgfmathmin@{\pgfmath@firstoperand}{\pgfmath@secondoperand}%
- \pgfmath@postfunction}
-
-% \pgfmath@parsefunction@pow
-%
-\def\pgfmath@parsefunction@pow{%
- \expandafter\pgfmath@parsefunction@pow@}
-\def\pgfmath@parsefunction@pow@(#1,{%
- \pgfmathparse@{#1}\edef\pgfmath@firstoperand{\pgfmathresult}%
- \let\pgfmath@parsepostgroup\pgfmath@parsefunction@pow@@
- \pgfmath@startparsegroup}
-\def\pgfmath@parsefunction@pow@@{%
- \edef\pgfmath@secondoperand{\pgfmathresult}%
- \pgfmathpow@{\pgfmath@firstoperand}{\pgfmath@secondoperand}%
- \pgfmath@postfunction} \ No newline at end of file
+\def\pgfmath@bgroup@strip#1{%
+ \def\pgfmath@bgroup@strip@last{#1}%
+ \pgfmath@bgroup@@strip{#1}\pgfmath@\pgfmath@@\pgfmath@@@}
+
+\def\pgfmath@bgroup@strip@#1{%
+ \def\pgfmath@bgroup@strip@last{#1}%
+ \pgfmath@bgroup@@strip#1\pgfmath@\pgfmath@@\pgfmath@@@}
+
+\def\pgfmath@bgroup@pgfmath@{\pgfmath@}
+
+\def\pgfmath@bgroup@@strip{\futurelet\pgfmath@token@let\pgfmath@bgroup@@@strip}
+\def\pgfmath@bgroup@@@strip#1#2#3\pgfmath@@@{%
+ \ifx\pgfmath@token@let\bgroup%
+ \def\pgfmath@bgroup@test{#2}%
+ \ifx\pgfmath@bgroup@test\pgfmath@bgroup@pgfmath@%
+ \def\pgfmath@next{\pgfmath@bgroup@strip@{#1}}%
+ \else%
+ \let\pgfmath@bgroup@stripped=\pgfmath@bgroup@strip@last%
+ \let\pgfmath@next=\relax%
+ \fi%
+ \else%
+ \pgfmath@bgroup@@@@strip#1#2#3%
+ \let\pgfmath@next=\relax%
+ \fi%
+ \pgfmath@next%
+}
+
+\def\pgfmath@bgroup@@@@strip#1\pgfmath@\pgfmath@@{\def\pgfmath@bgroup@stripped{#1}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
index db2c38fa350..5e353007618 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
@@ -20,14 +20,15 @@
% #1 - count or dimen.
% #2 - a control sequence.
%
-\newbox\pgfmath@box%
\def\pgfmath@ensureregister#1#2{%
- \setbox\pgfmath@box\hbox\bgroup% In case #2 is a defined macro. Unlikely, but you never know...
+ \begingroup%
+ \setbox0=\hbox\bgroup\begingroup% In case #2 is a defined macro. Unlikely, but you never know...
\afterassignment\pgfmath@@ensureregister%
\noexpand#20.0pt\let\pgfmath@temp\relax\relax\pgfmath@#2#1\pgfmath@}
\def\pgfmath@@ensureregister#1#2\pgfmath@#3#4#5\pgfmath@{%
- \egroup%
+ \endgroup\egroup%
+ \endgroup%
\ifx#4c%
\ifx#1.% Already a count register.
\else%
@@ -181,8 +182,18 @@
\let\pgfmath@PackageError\PackageError%
\fi%
-\def\pgfmath@error#1#2{\pgfmath@PackageError{PGF Math}{#1}{#2}}
-\def\pgfmath@warning#1{\pgfmath@PackageWarning{PGF Math}{#1}}
+\def\pgfmath@error#1#2{%
+ \pgfmath@PackageError{PGF Math}{%
+ #1%
+ \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}%
+ }{#2}%
+}
+\def\pgfmath@warning#1{%
+ \pgfmath@PackageWarning{PGF Math}{%
+ #1%
+ \pgfutil@ifundefined{pgfmath@expression}{}{ (in '\pgfmath@expression')}%
+ }%
+}
% \pgfmath@pt
%
@@ -208,6 +219,9 @@
\def\pgfmath@gobbleone#1{}%
+\def\pgfmath@namedef#1{\expandafter\def\csname#1\endcsname}
+\def\pgfmath@nameedef#1{\expandafter\edef\csname#1\endcsname}
+
% \pgfmathloop
%
% A version of the standard TeX and LaTeX
@@ -233,9 +247,6 @@
% \pgfmath@returnone
%
-% \edef \pfgmathresult to the value of #1 after the end
-% of a group, which *must directly follow*.
-%
% #1 - a dimension representing a number or dimension.
%
% Changed by TT: made faster and simpler since it is used
@@ -248,11 +259,7 @@
\expandafter\endgroup\expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmath@temp}%
}
-
-% \pgfmath@returntwo
-%
-% Removed by TT: not used.
-
+\let\pgfmathreturn=\pgfmath@returnone
% \pgfmath@smuggleone
%
@@ -263,3 +270,5 @@
%
\def\pgfmath@smuggleone#1\endgroup{%
\expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#1}}
+
+\let\pgfmathsmuggle=\pgfmath@smuggleone
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
new file mode 100644
index 00000000000..1c78bb221e6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
@@ -0,0 +1,3035 @@
+% Copyright 2006 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduledatavisualization.code.tex,v 1.37 2010/08/24 21:28:58 tantau Exp $
+
+\usepgfmodule{oo,shapes}
+\usepgflibrary{fpu}
+
+
+% This module defines the basic framework for data visualization.
+
+% In order to visualize data, you first need data. The format for this
+% data is not specified, indeed, different formats are possible. A
+% data point is created each time the command \pgfdatapoint is
+% used. The "parameters" of the data point are just the current values
+% of the keys or macros in the current scope.
+%
+% A set of data points created using the \pgfdata command.
+% When a data point is created, a number of signals are emitted, see
+% the description of \pgfdatapoint. To actually visualize something,
+% objects should be created that listen to these signals and that
+% handle them.
+%
+% The following class manages a data visualization
+
+\pgfooclass{data visualization}
+{
+ % Class data visualization
+ %
+ % This class is used to "manage" a data visualization. It provides
+ % methods for hooking into the data visualization process and its
+ % constructor initializes the signals that are issued during a data
+ % visualization.
+ %
+ % When a data visualization object is created, a whole bunch of
+ % signal objects. You should then create objects that connect to
+ % these signals. They will be emitted when datapoints come
+ % available.
+ %
+ % It is permissible to have several data visualization objects
+ % active at the same time.
+ %
+ % To use a data visualization object, you should (possibly
+ % repeatedly) call the method add data() or the macro \pgfdata. You should also
+ % create transformation, mapping and visualization objects. Then,
+ % you should, first, call the method survey, which will "survey" the
+ % data, allowing the mapping and bounding objects to compute the
+ % correct ranges. You may then create further objects based on this
+ % data. Then, you should call the "visualize" method, which will
+ % invoke the visualization signals for the data points.
+
+
+ % These attribute store code that should be executed at certain
+ % points. The order is the following:
+ %
+ % 1. "before survey" code
+ % 2. "begin survey" phase signal
+ % 3. "at start survey" code
+ % 4. data points are processed
+ % 5. "at end survey" code
+ % 6. "end survey" phase signal
+ % 7. "after survey" code
+ %
+ % The first seven points will be repeated until the method "do
+ % another survey" is no longer called during a survey.
+ %
+ % 8. "before visualization" code
+ % 9. "begin visualization" phase signal
+ % 10. "at start visualization" code
+ % 11. data points are processed once more
+ % 12. "at end visualization" code
+ % 13. "end visualization" phase signal
+ % 14. "after visualization" code
+ \attribute before survey;
+ \attribute at start survey;
+ \attribute at end survey;
+ \attribute after survey;
+ \attribute before visualization;
+ \attribute at start visualization;
+ \attribute at end visualization;
+ \attribute after visualization;
+
+ %
+ % Survey counts and handling
+ %
+
+ \attribute survey count=1;
+ % Each time a survey is done before the visualization is done, this
+ % count is incremented. Normally, there is only one survey, but
+ % objects may request another survey or even more surveys to be
+ % done, giving them a chance to setup further internal values. By
+ % accessing this count (via the get survey count method), you can
+ % find out which survey is currently being done.
+
+ \attribute number of surveys=1;
+ % By increasing this count, you can request additional surveys to be
+ % done.
+
+
+ % Stores the to-be-visualized data
+ \attribute data;
+
+
+ % Stores the signal objects
+ \attribute prepare datapoint signal;
+ \attribute map datapoint signal;
+ \attribute transform datapoint signal;
+ \attribute visualize datapoint signal;
+ \attribute finish datapoint signal;
+ \attribute survey datapoint signal;
+ \attribute phase signal;
+ \attribute path signal;
+ \attribute direction signal;
+ \attribute style signal;
+
+
+ % Constructor
+ %
+ % Inits the signals
+ \method data visualization() {
+ \pgfoonew{prepare datapoint signal}=new signal()%
+ \pgfoonew{map datapoint signal}=new signal()%
+ \pgfoonew{transform datapoint signal}=new signal()%
+ \pgfoonew{visualize datapoint signal}=new signal()%
+ \pgfoonew{finish datapoint signal}=new signal()%
+ \pgfoonew{survey datapoint signal}=new signal()%
+ \pgfoonew{phase signal}=new signal()%
+ \pgfoonew{path signal}=new signal()%
+ \pgfoonew{direction signal}=new signal()%
+ \pgfoonew{style signal}=new signal()%
+ %
+ % Store this object in a key
+ %
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeyslet{/pgf/data visualization/obj}\pgf@dv@me
+ }
+
+ % The phase signal will emit the following constants:
+ \def\pgfdvbeforesurvey{1}
+ \def\pgfdvbeginsurvey{2}
+ \def\pgfdvendsurvey{3}
+ \def\pgfdvaftersurvey{4}
+ \def\pgfdvbeforevisualization{5}
+ \def\pgfdvbeginvisualization{6}
+ \def\pgfdvendvisualization{7}
+ \def\pgfdvaftervisualization{8}
+
+ % The path signale will meit the following constants:
+ \def\pgfdvpathmovetotoken{5}
+ \def\pgfdvpathlinetotoken{6}
+ \def\pgfdvdirectionfromtoken{7}
+ \def\pgfdvdirectiontotoken{8}
+
+ % Method
+ %
+ % Connect the object #1's slot "#2" to the signal named "#3"
+ \method connect(#1,#2,#3) {
+ \pgfoovalueof{#3}.connect(#1,#2)
+ }
+
+ % Method
+ %
+ % Add data that is to be visualized. The code #1 should call the
+ % \pgfdatapoint macro for each data point it creates.
+ \method add data(#1) {
+ \pgfooappend{data}{#1}
+ }
+
+
+ % Setters
+ \method before survey(#1) {
+ \pgfooappend{before survey}{#1}
+ }
+ \method at start survey(#1) {
+ \pgfooappend{at start survey}{#1}
+ }
+ \method before visualization(#1) {
+ \pgfooappend{before visualization}{#1}
+ }
+ \method at start visualization(#1) {
+ \pgfooappend{at start visualization}{#1}
+ }
+
+ % Method
+ \method at end survey(#1) {
+ \pgfooprefix{at end survey}{#1}
+ }
+ \method after survey(#1) {
+ \pgfooprefix{after survey}{#1}
+ }
+ \method at end visualization(#1) {
+ \pgfooprefix{at end visualization}{#1}
+ }
+ \method after visualization(#1) {
+ \pgfooprefix{after visualization}{#1}
+ }
+
+
+ % Method
+ %
+ % Copy the signals to macros. This is just for efficiency (ha!)
+ \method prepare signal macros() {
+ \pgfooget{prepare datapoint signal}\pgf@signalpreparedatapoint
+ \pgfooget{map datapoint signal}\pgf@signalmapdatapoint
+ \pgfooget{transform datapoint signal}\pgf@signaltransformdatapoint
+ \pgfooget{visualize datapoint signal}\pgf@signalvisualizedatapoint
+ \pgfooget{finish datapoint signal}\pgf@signalfinishdatapoint
+ \pgfooget{survey datapoint signal}\pgf@signalsurveydatapoint
+ \pgfooget{phase signal}\pgf@signalphase
+ \pgfooget{path signal}\pgf@signalpath
+ \pgfooget{direction signal}\pgf@signaldirection
+ \pgfooget{style signal}\pgf@signalstyle
+ }
+
+
+ % Survey method
+ %
+ % Call this method to "survey" the data. This should be done before
+ % the "visualize" method is called.
+ \method survey() {
+ % Survey phase.
+ \let\pgfdatapoint=\pgfdatapoint@surveyphase%
+ \pgfoothis.prepare signal macros()
+ \pgfooset{survey count}{1}
+ \pgfutil@loop
+ \pgf@signalphase.emit(\pgfdvbeforesurvey)
+ \pgfoovalueof{before survey}%
+ \pgf@signalphase.emit(\pgfdvbeginsurvey)
+ \pgfoovalueof{at start survey}
+ \pgfoovalueof{data}%
+ \pgfoovalueof{at end survey}
+ \pgf@signalphase.emit(\pgfdvendsurvey)%
+ \pgfoovalueof{after survey}
+ \pgf@signalphase.emit(\pgfdvaftersurvey)
+ \c@pgf@counta=\pgfoovalueof{survey count}\relax
+ \c@pgf@countb=\pgfoovalueof{number of surveys}\relax
+ \ifnum\c@pgf@counta<\c@pgf@countb
+ \advance\c@pgf@counta by1\relax
+ \pgfooeset{survey count}{\the\c@pgf@counta}
+ \pgfutil@repeat
+ }
+
+ % Getter
+ \method get survey count(#1) {
+ \pgfooget{survey count}{#1}
+ }
+
+ % Request another survey to be done
+ \method do an additional survey() {
+ \c@pgf@counta=\pgfoovalueof{number of surveys}\relax
+ \advance\c@pgf@counta by1\relax
+ \pgfooeset{number of surveys}{\the\c@pgf@counta}
+ }
+
+ % Visualize method
+ %
+ % This method will cause the actual visualization.
+ \method visualize() {
+ % Visualization phase.
+ \let\pgfdatapoint=\pgfdatapoint@visualizationphase%
+ \pgfoothis.prepare signal macros()
+ \pgf@signalphase.emit(\pgfdvbeforevisualization)%
+ \pgfoovalueof{before visualization}
+ \pgf@signalphase.emit(\pgfdvbeginvisualization)%
+ \pgfoovalueof{at start visualization}
+ \pgfoovalueof{data}%
+ \pgfoovalueof{at end visualization}
+ \pgf@signalphase.emit(\pgfdvendvisualization)%
+ \pgfoovalueof{after visualization}
+ \pgf@signalphase.emit(\pgfdvaftervisualization)%
+ }
+}
+
+
+%
+% The data point keys
+%
+% Unlike other keys, the subkeys of /data point/ can simply be set
+% directly. If the key has not been initialized, it will automatically
+% be.
+\pgfkeys{/data point/.unknown/.code={%
+ \pgfkeyssetvalue{/data point/\pgfkeyscurrentname}{#1}
+ }}
+
+
+
+
+% Create and handle a data point
+%
+% Description:
+%
+% This command is called by the survey and the visualize methods
+% whenever a complete data point has been produced. Depending on the
+% current circumstances, different signals will be emitted.
+%
+% The data that is represented by the data point is not given as a
+% parameter. Rather, it is stored in macros and keys, that is, the
+% data point is conceptually given by the settings of all the keys and
+% macros in the local scope.
+%
+% There are two phases to data processing: In the survey phase data
+% points are produced and handled in order to find out things like
+% their number or the minimum and maximum values of attributes, so
+% that axes and picture sizes can be prepared correctly. In the
+% visualization phase, data point are actually shown.
+%
+% During the survey phase, for each data point the signal
+% "surveydatapoint" is emitted.
+%
+% During the visualization phase, more signals are emitted. A prepare
+% signal is emitted first, giving all objects a
+% chance to "prepare" for the data point. Note that it is permissible
+% for an object to manipulate the data point here (and also
+% in later on).
+%
+% Next, the command \pgfdvmapdatapointtocanvas is called. Mainly,
+% the effect of this command is to setup the keys /data point/canvas x
+% and /data point/canvas y, see the description of this command for
+% more details.
+%
+% The next step consists of signaling "visualize data point". Objects
+% listening to this will cause some form of visualization of the
+% data point to occur.
+%
+% Before the visualization is started, it is checked whether the key
+% /data point/name is set (to a non-empty value). If so,
+% a coordinate is created with the given canvas x and y values and
+% this key's value as name.
+%
+% Finally, finish data point allows objects to do any final processing
+% of the data point.
+
+\def\pgfdatapoint@surveyphase{%
+ \pgf@signalpreparedatapoint.emit()%
+ \pgf@signalmapdatapoint.emit()%
+ \pgf@signalsurveydatapoint.emit()%
+}
+
+\def\pgfdatapoint@visualizationphase{%
+ \pgf@signalpreparedatapoint.emit()%
+ \pgfdvmapdatapointtocanvas%
+ \pgfkeysifdefined{/data point/name}
+ {%
+ \pgfcoordinate{\pgfkeysvalueof{/data point/name}}{\pgfpointdvdatapoint}%
+ }{}%
+ \pgf@signalvisualizedatapoint.emit()%
+ \pgf@signalfinishdatapoint.emit()%
+}
+
+
+
+% Compute a position of a data point
+%
+% Description:
+%
+% This command uses a special signal to compute the position where a
+% data point should be visualized on the canvas. In detail, the
+% following happens:
+%
+% A local scope is created and the
+% transformation matrix is reset. Then, two signals are emitted: First,
+% "map data points" and then "transform data point". The first
+% lets listening objects "map" the object by setting up
+% attributes of the data point. The second asks objects
+% listening to this signal to transform the current transformation
+% matrix. After the signals, we compute where
+% the origin lies inside this transformed coordinate system. Then the
+% two keys /data point/canvas x and /data point/canvas y are set to
+% the values of this position. The local scope ends (but the settings
+% of the keys persist by a bit of magic), thus restoring the
+% transformation matrix to its original value.
+
+\def\pgfdvmapdatapointtocanvas{%
+ {%
+ \pgfpointdvlocaldatapoint
+ % Smuggle outside group
+ \expandafter%
+ }%
+ \edef\pgf@marshal{%
+ \noexpand\pgfkeyssetvalue{/data point/canvas x}{\the\pgf@x}
+ \noexpand\pgfkeyssetvalue{/data point/canvas y}{\the\pgf@y}
+ }%
+ \pgf@marshal%
+}
+
+% Help functions for locating a canvas data point
+%
+% Description:
+%
+% The first function returns the data point computed by a
+% canvasposition... call.
+
+\def\pgfpointdvdatapoint{%
+ \pgfqpoint{\pgfkeysvalueof{/data point/canvas x}}{\pgfkeysvalueof{/data point/canvas y}}%
+}
+
+\def\pgfpointdvlocaldatapoint{%
+ {%
+ % only returns the data point in \pgf@x and \pgf@y, does not set
+ % canvas x and canvas y
+ \pgf@signalmapdatapoint.emit()%
+ \pgftransformreset%
+ \pgf@signaltransformdatapoint.emit()%
+ \pgfpointtransformed{\pgfpointorigin}%
+ }%
+}
+
+
+
+%
+% Special path constructions commands
+%
+%
+% The following commands are used to construct paths based on
+% datapoints.
+%
+% Normally, all these methods need to do is to compute the current
+% canvas position of the current data point and then do a moveto,
+% lineto or some other operation to this position.
+%
+% However, when the coordinate system is weird, like with polar
+% coordinates or spherical or log-polar coordinate or whatever, a
+% straight line "along an attribute" is no longer a straight line.
+% In this case, two actions can be taken:
+%
+% 1. The problem can be ignored, resulting in a wrong line.
+% 2. Some clever algorithm kicks in an replaces the straight line by
+% the correct replacement.
+%
+% As always, when a computer tries to be clever, things can go
+% wrong... Nevertheless, some support for the second method is
+% given. This works as follows: Objects can register to the data
+% visualization path signal. This signal is emitted every time the
+% lineto or moveto commands are executed. If an object reacts to such
+% a command and handles it, it should set
+% \pgfdvhandledtrue.
+
+\newif\ifpgfdvhandled
+
+\def\pgfdv@generic#1#2#3{%
+ {%
+ \pgfdvhandledfalse%
+ \pgf@signalmapdatapoint.emit()%
+ #1.emit(#2)%
+ \ifpgfdvhandled%
+ \else%
+ \pgf@process{%
+ \pgftransformreset%
+ \pgf@signaltransformdatapoint.emit()%
+ \pgfpointtransformed{\pgfpointorigin}%
+ }%
+ #3{}%
+ \fi%
+ }%
+}
+
+
+% Handle a moveto
+%
+% This command has no parameters since the target of the moveto is
+% given by the canvas position of the current local data point.
+\def\pgfpathdvmoveto{%
+ \pgfdv@generic{\pgf@signalpath}{\pgfdvpathmovetotoken}{\pgfpathmoveto}
+}
+
+
+% Handle a lineto
+%
+% This command has no parameters since the target of the moveto is
+% given by the canvas position of the current local data point.
+\def\pgfpathdvlineto{%
+ \pgfdv@generic{\pgf@signalpath}{\pgfdvpathlinetotoken}{\pgfpathlineto}
+}
+
+
+
+% Compute a normalized vector pointing from some point to another.
+%
+% #1 = code for setting the attributes of the first point
+% #2 = code for setting the attributes of the second point
+%
+% Using #1 and #2 you specify two data points. These are then
+% localized on the canvas and a vector pointing from the first data
+% point to the second one is returned. However, for instance in polar
+% coordinates the vector may actually "point along" the angle axis.
+%
+% Internally, this command first sets up the first data point and then
+% emits a "path" signal with the \pgfdvpathdirectionfromtoken set and
+% then sets up the second point and emits the corresponding
+% ...totoken.
+%
+
+\def\pgfpointdvdirection#1#2{%
+ {
+ {
+ #1
+ \pgfdv@generic{\pgf@signaldirection}{\pgfdvdirectionfromtoken}{\xdef\pgf@dv@from{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}
+ }
+ {
+ #2
+ \pgfdv@generic{\pgf@signaldirection}{\pgfdvdirectiontotoken}{
+ \edef\pgf@dv@dir@xa{\the\pgf@x}
+ \edef\pgf@dv@dir@ya{\the\pgf@y}
+ \pgf@process{
+ \pgfpointnormalised{%
+ \pgfpointdiff{\pgf@dv@from}{\pgfqpoint{\pgf@dv@dir@xa}{\pgf@dv@dir@ya}}
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+
+
+%
+%
+% Data parsing and formatting
+%
+%
+
+
+
+% Run the rendering pipeline on a dataset.
+%
+% #1 = options with path /pgf/data/
+% #2 = optionally data given inline in curly braces.
+%
+% Description:
+%
+% This command is used to define a data set. For a single data
+% visualization, multiple data sets can be defined, they will
+% accumulate. Data can be in different formats, as specified by the
+% "format" key, and you can define new formats.
+%
+% The setting of the following keys is important:
+%
+% /pgf/data visualization/obj contains a handle to the dv-object
+% /pgf/data/format stores the format (see below)
+% /pgf/data/source determines where the data is.
+%
+% If source is empty, the data is stored in the argument that
+% follows. Otherwise, the file whose name is stored in source is read.
+% This data is stored in an internal variable, which is local to the
+% current group.
+%
+% After the group, the key "/pgf/data/continue code" will be
+% executed.
+%
+% When the data is actually used later on (during a survey or a
+% visualization), independently of what source is used, a format
+% handler is started for each data set. This works as follows: first,
+% the handler's startup code is executed. Then for each line of the
+% data file/the data given inline, the line handler function is
+% called. Finally, the data format end handler is called.
+%
+% The format handler's job is to call \pgfdatapoint each time a
+% complete data point has been produced.
+%
+% Example:
+%
+% \pgfoonew \dv=new data visualization()
+% \pgfoonew \obj=new attribute mapper(...)
+% ...
+%
+% \pgfkeys{/pgf/data/.cd,
+% column 1=dax/low,
+% column 2=dax/high,
+% column 3=dax/entry,
+% column 4=dax/exit}
+%
+% \pgfdata[format=space separated columns]
+% {
+% % today
+% 2000 2300 2100 2200
+% 2000 2350 2200 2500
+% 2200 2300 2250 2260
+% 1800 2260 2260 1900
+% 2000 2300 2100 2200
+% }
+%
+% \pgfdata[format=comma separated columns]
+% {
+% % yesterday
+% 2000, 2350, 2200, 2250
+% 2200, 2300, 2250, 2260
+% }
+%
+% \pgfdata[source=data,format=comma separated columns]
+%
+% \dv.survey()
+% \dv.visualize()
+
+\def\pgfdata{\pgfutil@ifnextchar[{\pgf@dataset@data@opt}{\pgf@dataset@data@opt[]}}%}
+\def\pgf@dataset@data@opt[#1]{%
+ % Ok, add one data thing...
+ \pgfkeysvalueof{/pgf/data visualization/obj}.add data(\pgf@do@data{#1})%
+ \begingroup%
+ \pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}%
+ \pgfkeysgetvalue{/pgf/data/continue code}\pgf@dv@cont@code%
+ \global\let\pgf@dv@cont@code\pgf@dv@cont@code%
+ \pgfkeysgetvalue{/pgf/data/format}\pgf@dv@format%
+ \expandafter\let\expandafter\pgf@dv@format@catcodes\csname pgfdv@format@\pgf@dv@format @catcodes\endcsname%
+ \ifx\pgf@dv@format@catcodes\relax
+ \PackageError{pgf}{Unknown data format '\pgf@dv@format'}{}%
+ \else%
+ \pgfkeysgetvalue{/pgf/data/source}\pgf@dv@source%
+ \ifx\pgf@dv@source\pgfutil@empty%
+ \let\pgf@next\pgf@dataset@grab@inline%
+ \else%
+ \let\pgf@next\pgf@dataset@grab@external%
+ \fi%
+ \pgf@next%
+}
+\def\pgf@dataset@grab@inline{%
+ \pgfutil@ifnextchar\bgroup{%
+ \begingroup%
+ \catcode`\^^M=\active%
+ \pgf@dv@format@catcodes%
+ \pgf@dataset@grab@@inline}%
+ {\PackageError{pgf}{Opening brace expected}{}}%
+}
+\def\pgf@dataset@grab@external{%
+ \fi%
+ \endgroup%
+ \pgfkeysvalueof{/pgf/data visualization/obj}.add data({{{\pgf@dataset@do@external}}})%
+ \pgf@dv@cont@code%
+}
+
+{\catcode`\^^M=\active%
+ \gdef\pgf@dataset@grab@@inline#1{%
+ \endgroup%
+ \pgfkeysvalueof{/pgf/data visualization/obj}.add data({{{\pgf@dataset@do@inline#1^^M\pgf@@eol}}})%
+ \fi%
+ \endgroup%
+ \pgf@dv@cont@code%
+ }%
+}%
+\def\pgf@@eol{\pgf@eol}
+
+\def\pgf@do@data#1#2{%
+ \begingroup%
+ \pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}%
+ \pgfkeysgetvalue{/pgf/data/format}\pgf@dv@format%
+ \expandafter\let\expandafter\pgf@dv@format@line\csname pgfdv@format@\pgf@dv@format @line\endcsname%
+ \expandafter\let\expandafter\pgf@dv@format@emptyline\csname pgfdv@format@\pgf@dv@format @empty\endcsname%
+ \csname pgfdv@format@\pgfkeysvalueof{/pgf/data/format}@startup\endcsname%
+ #2%
+ \csname pgfdv@format@\pgfkeysvalueof{/pgf/data/format}@end\endcsname%
+ \endgroup%
+}
+
+
+%
+% Read external file
+%
+
+\def\pgf@dataset@do@external{%
+ \csname pgfdv@format@\pgfkeysvalueof{/pgf/data/format}@catcodes\endcsname%
+ \immediate\openin\r@pgf@reada=\pgfkeysvalueof{/pgf/data/source} %
+ \ifeof\r@pgf@reada\relax
+ \PackageError{pgf}{Data source '\pgfkeysvalueof{/pgf/data/source}' not found}{}%
+ \else
+ \pgf@dataset@readline%
+ \fi
+ \immediate\closein\r@pgf@reada%
+}
+
+\def\pgf@partext{\par}%
+\def\pgf@dataset@readline{%
+ \immediate\read\r@pgf@reada to \pgf@temp%
+ \ifx\pgf@temp\pgf@partext%
+ \pgf@dv@format@emptyline%
+ \else%
+ \ifx\pgf@temp\pgfutil@empty%
+ \pgf@dv@format@emptyline%
+ \else%
+ \expandafter\pgf@dv@format@line\pgf@temp\pgfeol%
+ \fi%
+ \fi%
+ \ifeof\r@pgf@reada\else\expandafter\pgf@dataset@readline\fi%
+}
+
+
+%
+% Read inline data
+%
+
+\def\pgf@dataset@do@inline{%
+ \pgf@dv@handle@line%
+}
+
+{\catcode`\^^M=\active%
+\gdef\pgf@dv@handle@line{%
+ \pgfutil@ifnextchar^^M{\pgf@dv@format@emptyline\expandafter\pgf@dv@handle@line\pgfutil@gobble}%
+ {\pgfutil@ifnextchar\pgf@@eol{\pgfutil@gobble}{\pgf@dv@handle@nonemptyline}}%
+}%
+\gdef\pgf@dv@handle@nonemptyline#1^^M{%
+ \pgf@dv@format@line#1\pgfeol%
+ \pgf@dv@handle@line%
+}%
+}
+
+\pgfkeys{
+ /pgf/data/data visualization obj/.initial=\undefined,
+ /pgf/data/format/.initial=table,% the default format
+ /pgf/data/source/.initial=,
+ /pgf/data/continue code/.initial=
+}
+
+
+
+
+
+
+% Define a data format
+%
+% #1 = format name
+% #2 = catcode code
+% #3 = startup code
+% #4 = line arguments
+% #5 = line code
+% #6 = empty line code
+% #7 = end code
+%
+% Description:
+%
+% This command defines a new data format for data visualization. When
+% a data set is visualized and the format is set to #1, this handler
+% is used to parse the data.
+%
+% In detail, the \dataset command will select a source. Before this
+% source is read, #2 will be executed to setup the
+% catcodes. Additionally, each time the data is parsed, #3 will be
+% called. Then, for each nonempty line of the source, the
+% command #5 is executed, where the line will be matched against the
+% argument pattern given in #4. For empty lines, #6 will be executed
+% instead. At the end of the source, #7 will be executed.
+
+\def\pgfdeclaredataformat#1#2#3#4#5#6#7{%
+ \expandafter\def\csname pgfdv@format@#1@catcodes\endcsname{#2}%
+ \expandafter\def\csname pgfdv@format@#1@startup\endcsname{#3}%
+ \expandafter\def\csname pgfdv@format@#1@line\endcsname#4\pgfeol{#5}%
+ \expandafter\def\csname pgfdv@format@#1@empty\endcsname{#6}%
+ \expandafter\def\csname pgfdv@format@#1@end\endcsname{#7}%
+}
+
+
+
+%
+% Predefined standard formats
+%
+
+% TeX code format
+%
+% Description:
+%
+% The lines of the data set are assumed to contain executable TeX
+% code that will call \pgfdatapoint.
+%
+% Example:
+%
+% \pgfdatavisualizationrender[format=TeX code]
+% \dataset{
+% \pgfkeyssetvalue{/data point/x}{5}
+% \pgfkeyssetvalue{/data point/y}{5}
+% \pgfdatapoint
+% \pgfkeyssetvalue{/data point/x}{6}
+% \pgfkeyssetvalue{/data point/y}{6}
+% \pgfdatapoint
+% }
+
+\pgfdeclaredataformat{TeX code}{}{}{#1}{#1 }{}{}
+
+
+
+% Key-value lines format
+%
+% Description:
+%
+% The lines of the data set are passed to \pgfkeys with the path set
+% to /data point.
+%
+% Example:
+%
+% \data[format=key value pairs] {
+% x=5, y=6, hi=9
+% x=7, y=6, lo=10
+% }
+
+\pgfdeclaredataformat{key value pairs}{}{}{#1}{{\pgfkeys{/data point/.cd,#1}\pgfdatapoint}}{}{}
+
+
+
+
+
+% Table format
+%
+% Description:
+%
+% A table consists of a head line, which contains the attribute names
+% of the values that will be found in the following lines. Each line
+% (except for the headline) contains one data point.
+%
+% Inside each line the data points are separated by a separator like a
+% comma or a space or a colon. The separator can be configured using
+% the key /pgf/data/separator (leave the separator empty or set it to
+% \space for a space as separator). The default separator is a comma.
+%
+% Some tables will miss the headline. In this case, using the
+% /pgf/data/headline key you can provide a headline yourself.
+%
+% Example:
+%
+% \data[format=table] {
+% x y
+% 10 5
+% 11 6
+% 6 7
+% }
+%
+% \data[format=table,separator={,}] {
+% x, y
+% 10, 5
+% 11, 6
+% 6, 7
+% }
+%
+% \data[format=table,headline=x y] {
+% 10 5
+% 11 6
+% 6 7
+% }
+
+\pgfdeclaredataformat{table}
+{} % no catcodes
+{
+ \pgfkeysgetvalue{/pgf/data/headline}\pgf@dv@headline
+ \pgfkeysgetvalue{/pgf/data/separator}\pgf@dv@separator
+ \ifx\pgf@dv@separator\pgfutil@empty
+ \let\pgf@dv@separator\space
+ \fi
+ \ifx\pgf@dv@separator\pgf@dv@spacetext
+ \let\pgf@dv@separator\space
+ \fi
+ \expandafter\def\expandafter\pgf@dv@till@separator%
+ \expandafter##\expandafter1\pgf@dv@separator{\pgf@dv@table@handle{##1}}
+ \expandafter\def\expandafter\pgf@dv@till@separator@head%
+ \expandafter##\expandafter1\pgf@dv@separator{\pgf@dv@head@handle{##1}}
+ \ifx\pgf@dv@headline\pgfutil@empty
+ % Ok, read headline from file
+ \pgfdv@firstlinetrue
+ \else
+ % Headline already set
+ \pgfdv@firstlinefalse
+ \expandafter\pgf@dv@parse@headline\expandafter{\pgf@dv@headline}
+ \fi
+}
+{#1} % special line pattern, so read everything
+{
+ \ifpgfdv@firstline
+ \pgfdv@firstlinefalse
+ \pgf@dv@parse@headline{#1}
+ \else
+ {
+ \c@pgf@counta=0\relax% keep track of attribute number
+ \def\pgf@marshal{\pgf@dv@parse@table#1}
+ \expandafter\expandafter\expandafter\pgf@marshal%
+ \expandafter\pgf@dv@separator\expandafter\pgfeol\pgf@dv@separator
+ \pgfdatapoint
+ }
+ \fi
+}
+{} % ignore empty lines
+{} % no special end code
+
+\newif\ifpgfdv@firstline
+
+\pgfkeys{
+ /pgf/data/separator/.initial={,},
+ /pgf/data/headline/.initial=
+}
+\def\pgf@dv@spacetext{\space}
+
+\def\pgf@dv@parse@table{%
+ \pgfutil@ifnextchar"% Special, but ignored right now...
+ {\PackageError{pgf}{csv with quotes not yet implemented}{}}
+ {\pgf@dv@till@separator}
+}
+\def\pgf@dv@table@handle#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfeoltext%
+ % Bingo! Stop
+ \let\pgf@next=\relax%
+ \else%
+ \advance\c@pgf@counta by1\relax%
+ \pgfkeysgetvalue{/pgf/data/table/attribute \the\c@pgf@counta}\pgf@dv@target
+ \ifx\pgf@dv@target\relax%
+ \edef\pgf@dv@target{attribute \the\c@pgf@counta}
+ \pgfkeyslet{/pgf/data/table/attribute \the\c@pgf@counta}\pgf@dv@target
+ \fi
+ \pgfkeyssetvalue{/data point/\pgf@dv@target}{#1}
+ \let\pgf@next=\pgf@dv@parse@table%
+ \fi%
+ \pgf@next%
+}
+
+
+
+\def\pgf@dv@parse@headline#1{
+ \c@pgf@counta=0\relax% keep track of attribute number
+ \def\pgf@marshal{\pgf@dv@doparse@headline#1}
+ \expandafter\expandafter\expandafter\pgf@marshal%
+ \expandafter\pgf@dv@separator\expandafter\pgfeol\pgf@dv@separator
+}
+
+\def\pgf@dv@doparse@headline{%
+ \pgfutil@ifnextchar"% Special, but ignored right now...
+ {\PackageError{pgf}{csv with quotes not yet implemented}{}}
+ {\pgf@dv@till@separator@head}
+}
+\def\pgf@dv@head@handle#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfeoltext%
+ % Bingo! Stop
+ \let\pgf@next=\relax%
+ \else%
+ \advance\c@pgf@counta by1\relax%
+ \pgfkeyssetvalue{/pgf/data/table/attribute \the\c@pgf@counta}{#1}
+ \let\pgf@next=\pgf@dv@doparse@headline%
+ \fi%
+ \pgf@next%
+}
+
+\def\pgfeoltext{\pgfeol}
+
+
+%
+%
+% Micro math kernel for dv
+%
+%
+
+% The idea behind the following methods is to "abstract away" which
+% math engine is used. In the future, something fancy build on luatex
+% might be used, so it would we should not rely directly on the
+% fpu library code.
+%
+% The system works as follows: First, you "enter" a number into the
+% engine. When you do so, it is converted into some internal
+% representation that cannot be accessed any more and is called a
+% "math variable" henceforth. All commands of the
+% math system only work on math variables.
+%
+% In order to "exit" a value stored in a math variable from the
+% engine, some other macros can be used.
+%
+% Operations like addition or multiplication take two math variables
+% and store the result in another math variable.
+
+
+
+% Store a value in a math variable of the math engine
+%
+% #1 = a math variable (a macro name) that is to store the value
+% #2 = an expression describing a number
+%
+%
+% Description:
+%
+% The #2 should be an expression that evaluates to a number. However,
+% due to the way the pgf math engine(s) work, currently, there are
+% several restrictions/the syntax is not as simple as one might
+% hope. Fortunately, the syntax is hopefully compatible with
+% easier-to-use future systems.
+%
+% The syntax is as follows: #2 may be
+%
+% 1. a simple high-precision number. This number is currently directly
+% passed to \pgfmathfloatparsenumber, so typical permissible values
+% are "100" or "10000000000000" or "nan" or "-5.673543345345e9000"
+%
+% 2. a mathematical expression, which *must* be surrounded by
+% parantheses. From a "mathematical" point of view these
+% parantheses are superfluous, but the they are used to help pgf
+% distinguish expressions from high-precision numbers. (If, in the
+% future, expressions may contain high precision numbers, the
+% parantheses will simply be ignored.)
+%
+% The expression is evaluated using \pgfmathparse, which means that
+% TeX-precision is used. This means, for instance, that numbers
+% larger than about 16500 will create error messages.
+%
+% The advantage is that you may say write things like "(5+6)" or
+% "(pi/2)".
+%
+% 3. In case #2 starts with an exclamation mark (indicating an
+% "escape"), everything following the mark is simply evaluated by
+% TeX. The effect of evaluating #2 should be that the math
+% variable "\pgfdvmathvalue" is set to some value. This value will
+% then be transferred to #1.
+%
+% 4. In case #2 is the result of calling \pgfdvmathexitbyserializing, the
+% "serialized" value is restored. The idea is that the serialized
+% will turn its internal representation of a number into something
+% that can be stored as a text somewhere.
+%
+% Currently, "@" at the beginning of #2 is used to indicate that
+% what follows is a serialized version of a math variable.
+%
+% In order to determine which of the above cases is to be used for a
+% variable, the first symbol #2 is checked, *after* the first symbol
+% of #2 has been expanded once (using \expandafter once).
+%
+% Example:
+%
+% \pgfdvmathenter{\mymacro}{20000000000000}
+% \pgfdvmathenter{\mymacro}{(5+pi)}
+% \pgfdvmathenter{\mymacro}{!\pgfdvmathadd{\pgfdvmathvalue}{\a}{\b}}
+%
+% \pgfdvmathenter{\foo}{5}
+% \pgfdvmathexitbyserializing{\somevalue}{\foo}
+% \pgfdvmathenter{\mymacro}{\somevalue}
+
+\def\pgfdvmathenter#1#2{%
+ \expandafter\pgfdvmathenter@check\expandafter#1#2\pgfdvmath@end%
+}
+\def\pgfdvmathenter@check#1{%
+ \pgfutil@ifnextchar @{\pgfdvmath@internal#1}{%
+ \pgfutil@ifnextchar ({\pgfdvmath@expression#1}{%)
+ \pgfutil@ifnextchar !{\pgfdvmath@execute#1}{\pgfdvmath@normal#1}}}%
+}
+
+\def\pgfdvmath@internal#1@#2\pgfdvmath@end{%
+ \def#1{#2}%
+}
+\def\pgfdvmath@expression#1(#2)#3\pgfdvmath@end{%
+ \pgfmathparse{#2}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \let#1=\pgfmathresult%
+}
+\def\pgfdvmath@execute#1!#2\pgfdvmath@end{%
+ #2%
+ \let#1=\pgfdvmathvalue%
+}
+\def\pgfdvmath@normal#1#2\pgfdvmath@end{%
+ \pgfmathfloatparsenumber{#2}%
+ \let#1=\pgfmathresult%
+}
+
+
+
+% Print a math variable in the math engine using \pgfmathprintnumber
+%
+% #1 = math variable
+%
+% Description:
+%
+% See the description of \pgfmathprintnumber
+%
+% Example:
+%
+% \pgfdvmathenter{\mymacro}{20000000000000}
+% \pgfdvmathexitbyprinting{\mymacro}
+
+\def\pgfdvmathexitbyprinting#1{%
+ \pgfmathprintnumber{#1}%
+}
+
+
+
+% Exit a math variable as a number in a scientific and portable number
+% format in a macro
+%
+% #1 = macro in which to store the value
+% #2 = math variable
+%
+% Description:
+%
+% You can exit a number using this operation. You can then directly
+% reenter the number using \pgfdvmathenter
+%
+% Example:
+%
+% \pgfdvmathenter{\mynumber}{20000000000000}
+% \pgfdvmathexitbyscientificformat{\mymacro}{\mynumber}
+
+\def\pgfdvmathexitbyscientificformat#1#2{%
+ \edef#1{\pgfmathfloatvalueof#2}%
+}
+
+
+
+% Exit a math variable as a "serialized" (= string-based)
+% version.
+%
+% #1 = macro in which to store the value
+% #2 = math variable
+%
+% Description:
+%
+% The serialized version can be reentered using
+% \pgfmathenter and is similar to \pgfdvmathexitbyscientificformat,
+% but exiting and entering are (a bit) faster.
+%
+% Example:
+%
+% \pgfdvmathenter{\mynumber}{20000000000000}
+% \pgfdvmathexitbyserializing{\mymacro}{\mynumber}
+
+\def\pgfdvmathexitbyserializing#1#2{%
+ \edef#1{@#2}%
+}
+
+
+
+
+
+% Operations on two numbers
+%
+% #1 = macro that should store the result of applying the
+% corresponding operation to the following:
+% #2 = entered number
+% #3 = entered number
+%
+% Description:
+%
+% Sets #1 to the result of applying an operation to #2 and #3
+%
+% Example:
+%
+% \pgfdvmathenter{\a}{2000}
+% \pgfdvmathenter{\b}{5+6}
+% \pgfdvmathadd{\c}{\a}{\b}
+
+\def\pgfdvmathadd#1#2#3{%
+ \pgfmathfloatadd{#2}{#3}%
+ \let#1=\pgfmathresult%
+}
+\def\pgfdvmathsub#1#2#3{%
+ \pgfmathfloatsubtract{#2}{#3}%
+ \let#1=\pgfmathresult%
+}
+\def\pgfdvmathmul#1#2#3{%
+ \pgfmathfloatmultiply{#2}{#3}%
+ \let#1=\pgfmathresult%
+}
+\def\pgfdvmathdiv#1#2#3{%
+ \pgfmathfloatdivide{#2}{#3}%
+ \let#1=\pgfmathresult%
+}
+
+
+
+
+% Log, ln and exponent functions
+%
+% #1 = a math variable
+% #2 = a math variable
+%
+% Description
+%
+% \pgfdvmathln will compute #1 = ln(#2)
+% \pgfdvmathlog will compute #1 = log_{10}(#2)
+% \pgfdvmathexp will compute #1 = exp(#2)
+% \pgfdvmathpowten will compute #1 = 10^{#2}
+
+\def\pgfdvmathln#1#2{%
+ \pgfmathfloatln{#2}%
+ \let#1=\pgfmathresult%
+}
+
+\def\pgfdvmathlog#1#2{%
+ \pgfmathfloatln{#2}%
+ \pgfmathfloatmultiply{\pgfmathresult}{\pgfdvmathalwaysloge}%
+ \let#1=\pgfmathresult%
+}
+
+\def\pgfdvmathexp#1#2{%
+ \pgfmathfloatexp{#2}%
+ \let#1=\pgfmathresult%
+}
+
+\def\pgfdvmathpowten#1#2{%
+ \pgfmathfloattofixed{#2}%
+ \let\pgf@dv@temp=\pgfmathresult%
+ \pgfmathround{\pgf@dv@temp}%
+ \let\pgf@dv@temp@round=\pgfmathresult%
+ \pgf@x=\pgf@dv@temp@round pt%
+ \pgf@x=-\pgf@x%
+ \advance\pgf@x by\pgf@dv@temp pt\relax%
+ \ifdim\pgf@x>0.0002pt%
+ \pgfmathfloatmultiply{#2}{\pgfdvmathalwayslnten}%
+ \pgfmathfloatexp{\pgfmathresult}%
+ \else
+ \ifdim\pgf@x<-0.0002pt%
+ \pgfmathfloatmultiply{#2}{\pgfdvmathalwayslnten}%
+ \pgfmathfloatexp{\pgfmathresult}%
+ \else
+ \pgf@x=\pgf@dv@temp@round sp%
+ \c@pgf@counta=\pgf@x%
+ \pgfmathfloatcreate{1}{1.0}{\the\c@pgf@counta}%
+ \fi
+ \fi
+ \let#1=\pgfmathresult%
+}
+
+
+% Floor functions
+%
+% #1 = a math variable
+% #2 = a math variable
+%
+% Description
+%
+% Sets #1 to the largest integer less or equal to #2
+
+\def\pgfdvmathfloor#1#2{%
+ \pgfmathifisint{#2}{%
+ \let#1=#2%
+ }{%
+ \pgfmathfloatgetflags#2\c@pgf@counta%
+ \ifcase\c@pgf@counta
+ \let#1=\pgfdvmathalwayszero%
+ \or
+ \pgfmathfloatfloor{#2}%
+ \let#1=\pgfmathresult%
+ \or
+ \pgfmathfloatsubtract{\pgfdvmathalwaysone}{#2}%
+ \pgfmathfloatfloor{\pgfmathresult}%
+ \pgfmathfloatsubtract{\pgfdvmathalwayszero}{\pgfmathresult}%
+ \let#1=\pgfmathresult%
+ \or\let#1=#2%
+ \or\let#1=#2%
+ \or\let#1=#2%
+ \fi%
+ }%
+}
+
+
+% Advanced unary operations
+%
+% #1 = macro that should store the result of applying the
+% operation to an entered number
+% #2 = the operation (as a string like "ln")
+% #3 = entered number
+%
+% Description:
+%
+% Sets #1 to the result of applying #2 to #3
+%
+% Example:
+%
+% \pgfdvmathenter{\a}{2000}
+% \pgfdvmathunaryop{\b}{ln}{\a}
+
+\def\pgfdvmathunaryop#1#2#3{%
+ \csname pgfmathfloat#2\endcsname{#3}%
+ \let#1=\pgfmathresult%
+}
+
+
+% Advanced binary operations
+%
+% #1 = macro that should store the result of applying the
+% operation to two entered number
+% #2 = the operation (as a string like "veclen")
+% #3 = first argument (an entered number)
+% #4 = second argument (an entered number)
+%
+% Description:
+%
+% Sets #1 to the result of applying #2 to #3
+%
+% Example:
+%
+% \pgfdvmathenter{\a}{3}
+% \pgfdvmathenter{\b}{4}
+% \pgfdvmathbinop{\c}{veclen}{\a}{\b}
+
+\def\pgfdvmathbinop#1#2#3#4{%
+ \csname pgfmathfloat#2\endcsname{#3}{#4}%
+ \let#1=\pgfmathresult%
+}
+
+
+
+% Comparing values
+%
+% #1 = first math variable
+% #2 = second math variable
+% #3 = code to-be-executed if #1 < #2
+% #4 = code to-be-executed if #1 >= #2
+%
+%
+% Example:
+%
+% \pgfdvmathenter{\a}{3}
+% \pgfdvmathenter{\b}{4}
+% \pgfdvmathifless{\a}{\b}{yes}{should not happen}
+
+\def\pgfdvmathifless#1#2#3#4{%
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison#3\else#4\fi%
+}
+
+
+
+
+%
+%
+% Standard objects for data visualization
+%
+%
+
+
+%
+% Transformers
+%
+
+\pgfooclass{linear transformer}
+{
+ % Class linear transformer
+ %
+ % This class is a transformer class. It reacts to the transform
+ % datapoint signal. When this signal is raised, it will shift the
+ % coordinate system as follows: If the current value of /data
+ % point/this.attribute is 0, then the system is shifted to the
+ % current value of this.origin. If the current value is 1, the
+ % system is shifted to this.origin + this.unit vector. For other
+ % values of /data point/this.attribuate, the shift is interpolated
+ % between these two values.
+
+
+ \attribute attribute;
+ % The attribute (/data point/this.attribute) by which
+ % the unit vector is multiplied. If it is empty (which is
+ % different from 0), no transformation is done at all.
+
+ \attribute origin = \pgfpointorigin;
+ % The shift in case the /data point/this.attribute is 0.
+
+ \attribute unit vector;
+ % The coordinate system is additionally shifted by this amount
+ % times the current value of /data point/this.attribute.
+
+
+ % Constructor
+ %
+ % #1 = attribute that is being transformed. Example: x
+ % #2 = a vector corresponding to one unit of #1.
+ % Example: \pgfpoint{1cm}{0cm}
+ \method linear transformer(#1,#2) {
+ \pgfooset{attribute}{#1}
+ \pgf@process{#2}
+ \edef\pgf@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \pgfoolet{unit vector}\pgf@temp%
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,transform,transform datapoint signal)
+ }
+
+ % Setter
+ \method set origin(#1) {
+ \pgf@process{#1}
+ \edef\pgf@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \pgfoolet{origin}\pgf@temp%
+ }
+
+ % Slot
+ %
+ % This slot should be connected to the transform datapoint
+ % signal. When this signal is emitted, the coordinate system will be
+ % shifted according to the current value of the attribute.
+ \method transform() {
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}}\pgf@dv@val%
+ \ifx\pgf@dv@val\pgfutil@empty%
+ \else%
+ \ifx\pgf@dv@val\relax%
+ \else%
+ \pgfdvmathenter{\pgf@dv@math@var}{\pgf@dv@val}%
+ \pgfdvmathexitbyscientificformat{\pgf@dv@val}{\pgf@dv@math@var}%
+ \pgftransformshift{\pgfoovalueof{origin}}%
+ \pgfmathfloatgetexponent\pgf@dv@math@var\c@pgf@counta%
+ \ifnum\c@pgf@counta<-3\relax%
+ \else%
+ \pgftransformshift{\pgfpointscale{\pgf@dv@val}{\pgfoovalueof{unit vector}}}%
+ \fi%
+ \fi%
+ \fi%
+ }
+
+}
+
+
+%
+% Numerical mapping of attributes to other attributes
+%
+
+\pgfooclass{interval mapper}
+{
+ % Class interval mapper
+ %
+ % This interval mapper reacts to the map datapoint signal. Its purpose is to
+ % map one attribute to another attribute. For the first attribute,
+ % an intervals is specified.
+ %
+ % In addition to the in interval [a,b] there is also an outinterval
+ % [c,d]. Values in the range [a,b] are linearly mapped to the
+ % range [c,d] and the result is stored in the second attribute.
+ %
+ % For instance, if the first range is [10,20] and the second range
+ % is [0,100], then 10 is mapped to 0, 11 is mapped to 10, 20 is
+ % mapped to 100 and 30 is mapped to 200.
+ %
+ % It is permissible to specify an additional non-linear
+ % transformation function f. In this case, for an input value x the
+ % position of f(x) inside the interval [f(a),f(b)] is determined and
+ % this position is linearly mapped to [c,d].
+ %
+ % For example, if f(x) = log_10 (x) and the first range [a,b] =
+ % [10,1000] and the second range is [1,2], then 10 is mapped to 1,
+ % 100 is mapped to 1.5 (since f(100) = 3 lies in the middle
+ % between f(10) = 2 and f(1000) = 4) and 100000 is mapped to 3.
+
+
+ \attribute in;
+ % The name of the input attribute. If the value of this attribute
+ % is empty or undefined, no mapping is done.
+ %
+ % The in attribute may have a subkey called .../const. If this key
+ % has a value different from \relax, it will always be used instead
+ % of the in attribute itself. This can be useful to temporarily
+ % set a constant value to a key inside a mapping chain.
+
+% \attribute clip;
+% % The code for clipping the interval. Will set \pgf@dvcliptrue, if a
+% % clip is necessary.
+
+ \attribute out;
+ % The name of the output attribute.
+
+ \attribute trans;
+ % Stores (more or less) the transformation function.
+
+ \attribute out min;
+ % Start of the second range (the value of c).
+
+ \attribute trans in min;
+ % Transformed value of the start of the first range (the value
+ % f(a)).
+
+ \attribute scale;
+ % The scaling factor, that is, the value of (f(d)-f(c))/(b-a).
+
+
+ % Constructor
+ %
+ % #1 = input attribute. Example: velocity.
+ % #2 = output attribute. Example: x
+ % #3 = optional transformation function. The input value for this
+ % function is stored in entered number \pgfvalue.
+ % The output of the function should be stored in the
+ % same entered number.
+ %
+ % The intervals are set using setter methods later on.
+ %
+ \method interval mapper(#1,#2,#3) {
+ \pgfooset{in}{#1}
+ \pgfooset{out}{#2}
+ \def\pgf@temp{#3}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfooset{trans}{%
+ #3%
+ }%
+ \fi%
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,map,map datapoint signal)
+ }
+
+% % Method
+% \method set clip interval(#1,#2) {
+% \def\pgfdvmin{#1}%
+% \def\pgfdvmax{#2}%
+% \ifx\pgfdvmin\pgfutil@empty%
+% \else%
+% \pgfdvmathenter{\pgf@dv@temp}{\pgfdvmin}%
+% \pgfdvmathexitbyserializing{\pgfdvmin}{\pgf@dv@temp}%
+% \fi
+% \ifx\pgfdvmax\pgfutil@empty%
+% \else%
+% \pgfdvmathenter{\pgf@dv@temp}{\pgfdvmax}%
+% \pgfdvmathexitbyserializing{\pgfdvmax}{\pgf@dv@temp}%
+% \fi
+% \pgfooeset{clip}{%
+% \noexpand\pgf@dvclipfalse%
+% \ifx\pgfdvmin\pgfutil@empty%
+% \else%
+% \noexpand\pgfdvmathenter{\noexpand\pgf@dv@temp}{\pgfdvmin}%
+% \noexpand\pgfdvmathifless{\noexpand\pgfvalue}{\noexpand\pgf@dv@temp}{\noexpand\pgf@dvcliptrue}{}%
+% \fi%
+% \ifx\pgfdvmax\pgfutil@empty%
+% \else%
+% \noexpand\pgfdvmathenter{\noexpand\pgf@dv@temp}{\pgfdvmax}%
+% \noexpand\pgfdvmathifless{\noexpand\pgf@dv@temp}{\noexpand\pgfvalue}{\noexpand\pgf@dvcliptrue}{}%
+% \fi%
+% }
+% }
+
+ % Method
+ %
+ % #1 = in interval minimum
+ % #2 = in interval maximum
+ % #3 = out interval minimum
+ % #4 = out interval maximum
+ %
+ % This method will (re)compute the correct mappings for the interval
+ % mapper.
+ \method set interval values(#1,#2,#3,#4) {
+ {%
+ \pgfdvmathenter{\pgf@in@interval@min}{#1}
+ \pgfdvmathenter{\pgf@in@interval@max}{#2}
+ \pgfdvmathenter{\pgf@out@interval@min}{#3}
+ \pgfdvmathenter{\pgf@out@interval@max}{#4}
+ % Let's start with the output, it's easier...
+ \pgfoolet{out min}{\pgf@out@interval@min}
+ \pgfdvmathsub{\pgf@out@diff}{\pgf@out@interval@max}{\pgf@out@interval@min}
+ \let\pgfvalue=\pgf@in@interval@min
+ \pgfoovalueof{trans}
+ \let\pgf@in@interval@min@transformed=\pgfvalue
+ \pgfoolet{trans in min}{\pgf@in@interval@min@transformed}%
+ \let\pgfvalue=\pgf@in@interval@max
+ \pgfoovalueof{trans}
+ \let\pgf@in@interval@max@transformed=\pgfvalue
+ \pgfdvmathsub{\pgf@diff@in@transformed}{\pgf@in@interval@max@transformed}{\pgf@in@interval@min@transformed}
+ %
+ % Precompute the scaling
+ %
+ \pgfdvmathdiv{\pgf@scale}{\pgf@out@diff}{\pgf@diff@in@transformed}%
+ \pgfoolet{scale}{\pgf@scale}%
+ }%
+ }
+
+ % Slot
+ \method map() {
+ \pgfooget{scale}\pgf@temp
+ \ifx\pgf@temp\pgfutil@empty%
+ % not yet setup
+ \else%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{in}/const}\pgf@dv@external@value%
+ \ifx\pgf@dv@external@value\relax%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{in}}\pgf@dv@external@value%
+ \fi%
+ \ifx\pgf@dv@external@value\pgfutil@empty%
+ \else%
+ \ifx\pgf@dv@external@value\relax%
+ \else%
+% % Clip?
+ \pgfdvmathenter{\pgfvalue}{\pgf@dv@external@value}%
+% \pgfoovalueof{clip}%
+% \ifpgf@dvclip%
+% \pgfkeyslet{/data point/\pgfoovalueof{out}}\pgfutil@empty%
+% \else%
+ \pgf@dv@mapper@trans{}
+% \fi%
+ \fi%
+ \fi%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{in}/min}\pgf@dv@external@value%
+ \ifx\pgf@dv@external@value\relax\else%
+ \ifx\pgf@dv@external@value\pgfutil@empty\else%
+ \pgfdvmathenter{\pgfvalue}{\pgf@dv@external@value}%
+ \pgf@dv@mapper@trans{/min}
+ \fi
+ \fi
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{in}/max}\pgf@dv@external@value%
+ \ifx\pgf@dv@external@value\relax\else%
+ \ifx\pgf@dv@external@value\pgfutil@empty\else%
+ \pgfdvmathenter{\pgfvalue}{\pgf@dv@external@value}%
+ \pgf@dv@mapper@trans{/max}
+ \fi
+ \fi
+ \fi%
+ }
+
+ \def\pgf@dv@mapper@trans#1{
+ \pgfooget{trans in min}{\pgf@dv@trans@in@min}%
+ \pgfooget{scale}{\pgf@dv@scale}%
+ \pgfooget{out min}{\pgf@dv@out@min}%
+ \pgfoovalueof{trans}%
+ \pgfdvmathsub{\pgfvalue}{\pgfvalue}{\pgf@dv@trans@in@min}%
+ \pgfdvmathmul{\pgfvalue}{\pgfvalue}{\pgf@dv@scale}%
+ \pgfdvmathadd{\pgfvalue}{\pgfvalue}{\pgf@dv@out@min}%
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{out}#1/offset}\pgf@dv@external@offset%
+ \ifx\pgf@dv@external@offset\relax\else%
+ \ifx\pgf@dv@external@offset\pgfutil@empty\else%
+ \pgfdvmathenter{\pgf@dv@offset}{\pgf@dv@external@offset}%
+ \pgfdvmathadd{\pgfvalue}{\pgfvalue}{\pgf@dv@offset}
+ \fi
+ \fi
+ \pgfdvmathexitbyserializing{\pgf@temp}{\pgfvalue}%
+ \pgfkeyslet{/data point/\pgfoovalueof{out}#1}\pgf@temp%
+ }
+}
+
+
+
+
+
+%\newif\ifpgf@dvclip
+\newif\ifpgf@dvignore
+
+\pgfooclass{scaling mapper}
+{
+ % Class scaling mapper
+ %
+ % A scaling mapper is (mainly) used to scale an attribute in such a way
+ % that it can be rendered easily on a page. The idea is that you
+ % specify some attribute and a desired target interval size (like
+ % [0,5]). The scaling mapper will then survey the data and will setup a
+ % interval mapper in such a way that the minimum value present in the data is
+ % mapped to 0 and the maximum to 5. However, it is also possible to,
+ % say, only have the maximum value mapped to 5 and have 0 be mapped
+ % to 0. Other, more complicated specifications are also possible.
+ %
+ % The scaling mapper internally creates several objects: First, a surveyor
+ % for determining the minimum and maximum values of the attribute
+ % and a interval mapper for then mapping the values to the scaled
+ % values. Additionally, interval objects are needed.
+
+ \attribute in;
+ % The to-be-scaled attribute;
+
+ \attribute out;
+ % The attribute storing the scaled value.
+
+ \attribute in range obj;
+ % This interval keep track of the range of the in attribute
+
+ \attribute scaling spec;
+ % A specification of how the scaling should be performed.
+ %
+ % The format is the following:
+ %
+ % #1 at #2 and #3 at #4
+ %
+ % Here, #2 and #4 must be numbers. #1 and #3 can either be numbers
+ % or #1 can be the text "min" and #3 can be the text "max".
+ %
+ % The effect of such a specification is the following: The value #1
+ % is mapped to #2, the value #3 is mapped to #4 and values between
+ % #1 and #3 (or outside this range) are mapped linearly to a value
+ % between (or outside) #2 and #4. In case #1 is set to "min", the
+ % smallest observed value of the in-attribute is mapped to #3 and
+ % similarly for a value of "max" for #3.
+ %
+ % Additionally, as for a interval mapper, a function f might be specified
+ % that deforms the linear mapping. In case f is specified,
+ % f(#1) is mapped to #2 and f(#3) is mapped to #4.
+
+ \attribute function;
+ % Stores the function
+
+ \attribute interval mapper;
+ % Stores the interval mapper object
+
+ \attribute range surveyor;
+ % Stores the range surveyor object
+
+
+ % Constructor
+ %
+ % #1 = in attribute
+ % #2 = out attribute
+ % #3 = scaling specification
+ % #4 = optional function
+ %
+ \method scaling mapper(#1,#2,#3,#4) {
+ %
+ % Save the parameters in attributes
+ %
+ \pgfooset{in}{#1}
+ \pgfooset{out}{#2}
+ \pgfooset{scaling spec}{#3}
+ \pgfooset{function}{#4}
+ %
+ % Now setup the objects for the before survey phase
+ %
+ %
+ % First, the in range interval
+ \pgfoonew \pgf@dv@in@range@obj=new interval(,)
+ \pgfoolet{in range obj}\pgf@dv@in@range@obj
+ % Second, the in range surveyor. We do not need to store this
+ % object, it will "do its work in the background"
+ \pgfoonew \pgf@dv@range@obj=new range surveyor(#1,\pgf@dv@in@range@obj)
+ \pgf@dv@range@obj.default connects()
+ \pgfoolet{range surveyor}\pgf@dv@range@obj
+ %
+ %
+ % The interval mapper:
+ %
+ \pgfoonew{interval mapper}=new interval mapper(#1,#2,#4)
+ \pgfoovalueof{interval mapper}.default connects()
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,phase,phase signal)
+ }
+
+
+% % Method
+% %
+% % #1 = a min clip -- everything below this value will be clipped
+% % #2 = a max value -- everything above this value will be clipped
+% %
+% % Sets a clipping for the underlying interval mapper.
+% %
+% \method set clip interval(#1,#2) {
+% \pgfoovalueof{interval mapper}.set clip interval({#1},{#2})%
+% }
+
+ % Getter
+ %
+ % Returns an interval object that stores the range of the in
+ % attribute.
+ \method get in range interval() {
+ \pgfooget{in range obj}\pgfdvinrangeinterval
+ }
+
+
+ % Getter
+ %
+ % Returns the out attribute.
+ %
+ \method get out() {
+ \pgfooget{out}\pgfdvout
+ }
+
+ % Getter
+ %
+ % Returns the function attribute.
+ %
+ \method get function(#1) {
+ \pgfooget{function}#1
+ }
+
+ % Method
+ %
+ % #1 = a included in value
+ %
+ % This method only affects the survey. The value #1 is recorded as
+ % if it were encountered for the in attribute at some point.
+ %
+ \method include in value(#1) {
+ \pgfoovalueof{range surveyor}.include attribute value({#1})
+ }
+
+
+ % Method
+ %
+ % #1 = value for the attribute
+ %
+ % Sets the attribute to the (evaluated) given value (evaluation
+ % using \pgfmathparse). When the value is evaluated, the values of
+ % \pgfdvmin and \pgfdvmax will be set to the minimum and maximum
+ % values of the in interval. (See \pgfdvmathenter with the "!"-notation).
+ %
+ % In case #1 is set to the special value "min", it evaluates to
+ % \pgfdvmin, when set to "max" it evaluates to \pgfdvmax.
+ %
+ \method set in to(#1) {
+ \edef\pgf@temp{#1}
+ \ifx\pgf@temp\pgf@min@text
+ \pgf@dv@lib@set@mm%
+ \let\pgf@dv@value\pgfdvmin
+ \else
+ \ifx\pgf@temp\pgf@max@text
+ \pgf@dv@lib@set@mm%
+ \let\pgf@dv@value\pgfdvmax
+ \else
+ \pgfdvmathenter{\pgf@dv@value}{\pgf@temp}
+ \fi
+ \fi
+ \pgfdvmathexitbyserializing{\pgf@dv@serial}{\pgf@dv@value}
+ \pgfkeyslet{/data point/\pgfoovalueof{in}}\pgf@dv@serial
+ }
+ \def\pgf@dv@lib@set@mm{
+ \pgfooget{in range obj}\pgfdvinrangeinterval
+ \pgfdvinrangeinterval.get min and max()%
+ }
+
+
+ % Slot
+ \method phase(#1) {
+ \ifx#1\pgfdvendsurvey
+ % Ok, we setup the interval mapper.
+ %
+ % We start by computing the interval borders:
+ \pgfoovalueof{in range obj}.get min and max()
+ \ifx\pgfdvmin\pgfutil@empty% undefined, since no data points
+ \else%
+ \pgfooget{scaling spec}\pgf@temp
+ \expandafter\pgf@lib@dv@parse@scaling\pgf@temp\pgf@stop%
+ \pgfoovalueof{interval mapper}.set interval values(%
+ \pgf@lib@dv@min,\pgf@lib@dv@max,%
+ \pgf@lib@dv@min@at,\pgf@lib@dv@max@at)
+ \fi
+ \fi
+ }
+
+
+ % Internal helper
+ \def\pgf@lib@dv@parse@scaling#1 at#2and #3 at#4\pgf@stop{%
+ \def\pgf@lib@dv@min{#1}%
+ \pgfdvmathenter{\pgf@lib@dv@min@at@mv}{#2}
+ \def\pgf@lib@dv@max{#3}%
+ \pgfdvmathenter{\pgf@lib@dv@max@at@mv}{#4}
+ \ifx\pgf@lib@dv@min\pgf@min@text%
+ \let\pgf@lib@dv@min@mv\pgfdvmin
+ \else
+ \pgfdvmathenter{\pgf@lib@dv@min@mv}{\pgf@lib@dv@min}
+ \fi
+ \ifx\pgf@lib@dv@max\pgf@max@text%
+ \let\pgf@lib@dv@max@mv\pgfdvmax
+ \else
+ \pgfdvmathenter{\pgf@lib@dv@max@mv}{\pgf@lib@dv@max}
+ \fi
+ \pgfdvmathexitbyserializing{\pgf@lib@dv@min}{\pgf@lib@dv@min@mv}
+ \pgfdvmathexitbyserializing{\pgf@lib@dv@min@at}{\pgf@lib@dv@min@at@mv}
+ \pgfdvmathexitbyserializing{\pgf@lib@dv@max}{\pgf@lib@dv@max@mv}
+ \pgfdvmathexitbyserializing{\pgf@lib@dv@max@at}{\pgf@lib@dv@max@at@mv}
+ }
+ \def\pgf@min@text{min}
+ \def\pgf@max@text{max}
+}
+
+
+
+
+
+%
+% Surveyors
+%
+
+\pgfooclass{range surveyor}
+{
+ % Class range surveyor
+ %
+ % A range surveyor is used only in the survey phase. Its job is to
+ % determine the minimum and maximum values of an attribute that are
+ % "seen" during the survey phase. Based on this value, the size of,
+ % say, an axis can be detemined later on.
+ %
+ % In case the attribute has the sub-attributes "min" and "max", they
+ % are also taken into account.
+
+ \attribute attribute;
+ % The to-be-surveyed attribute
+
+ \attribute interval obj;
+ % The interval object that protocols the minimum and maximum
+ % values.
+
+
+ % Constructor
+ %
+ % #1 = the attribute
+ % #2 = handle to the interval object
+ %
+ \method range surveyor(#1,#2) {
+ \pgfooset{attribute}{#1}
+ \pgfoolet{interval obj}#2
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,survey,survey datapoint signal)
+ }
+
+ % Method
+ %
+ % #1 = a value
+ %
+ % Adjust the interval as if during the survey this value were
+ % encountered
+ \method include attribute value(#1) {
+ \def\pgf@dv@val{#1}
+ \pgfoovalueof{interval obj}.adjust(\pgf@dv@range@surv)
+ }
+
+ % Slot
+ %
+ % This slot should be connected to the survey datapoint signal. For
+ % each datapoint, this method will call the adjust method of the
+ % interval.
+ %
+ \method survey() {
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}}\pgf@dv@val%
+ \pgfoovalueof{interval obj}.adjust(\pgf@dv@range@surv)
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}/min}\pgf@dv@val%
+ \pgfoovalueof{interval obj}.adjust(\pgf@dv@range@surv)
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}/max}\pgf@dv@val%
+ \pgfoovalueof{interval obj}.adjust(\pgf@dv@range@surv)
+ }
+
+ \def\pgf@dv@range@surv{%
+ \ifx\pgf@dv@val\relax%
+ \else%
+ \edef\pgf@dv@val{\pgf@dv@val}%
+ \ifx\pgf@dv@val\pgfutil@empty%
+ \else%
+ \pgfdvmathenter{\pgf@dv@value}{\pgf@dv@val}%
+ % Now, protocol value
+ \ifx\pgfdvmin\pgfutil@empty%
+ \let\pgfdvmin\pgf@dv@value%
+ \else%
+ \pgfdvmathifless{\pgf@dv@value}{\pgfdvmin}{\let\pgfdvmin\pgf@dv@value}{}%
+ \fi%
+ \ifx\pgfdvmax\pgfutil@empty%
+ \let\pgfdvmax\pgf@dv@value%
+ \else%
+ \pgfdvmathifless{\pgfdvmax}{\pgf@dv@value}{\let\pgfdvmax\pgf@dv@value}{}%
+ \fi%
+ \fi%
+ \fi
+ }
+}
+
+
+
+%
+% Visualizers
+%
+
+\usepgflibrary{plothandlers}
+
+
+
+\pgfooclass{plot handler visualizer}
+{
+ % Class plot handler visualizer
+ %
+ % This visualizer uses one or more plot handlers to visualize data points.
+ % As the data points are processed, the canvas positions of the data
+ % points are recorded. At the end of a group of data points, the
+ % recorded stream of canvas position is visualized (rendered)
+ % using plot handlers. For instance, when the lineto plot handler
+ % is used, the data points are connected by straight lines, when the
+ % curveto plot handler is used, they are connected by smooth curves
+ % and so on.
+ %
+ % Since plot lines are not drawn immediately, but only at the end,
+ % when everything has been collected, multiple plot handlers can
+ % coexist peacefully at the same time.
+ %
+ % You can specify a "filter", which will cause only those data
+ % points to be visualized by the visualizer that pass the test. The
+ % filter should set \pgfdvfilterpassedfalse for to-be-filtered data
+ % point.
+ %
+ % The keys /data point/<name>/execute at begin and /data
+ % point/<name>/execute at end, where <name> is the name of
+ % the visualizer, should store code that is to be executed directly
+ % before and after the stream of coordinates is created. Typically,
+ % these keys will store commands to use the path created by the plot
+ % handler.
+
+ \attribute handlers;
+ % The to-be-used handlers
+
+ \attribute name;
+ % Filter code
+
+ \attribute filter=\pgfdvnamedvisualizerfilter;
+ % Filter code
+
+ \attribute positions;
+ % An internal protocol of the positions on the stream
+
+ \attribute cache;
+ % An internal cache. Positions are first inserted into this
+ % cache. Every 100 steps this cache is moved to positions. The idea
+ % behind this is that it will avoid the quadratic time increase that
+ % is normally caused when a protocol is build in TeX.
+
+
+ % Constructor
+ %
+ % #1 = A name
+ % #2 = A comma-separated list of handlers like
+ % "\pgfplothandlerlineto,\pgfplothandlercurveto"
+ %
+ \method plot handler visualizer(#1,#2) {
+ \pgfooset{name}{#1}
+ \pgfooset{handlers}{#2}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,protocol,visualize datapoint signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,phase,phase signal)
+ }
+
+ % Setter
+ \method set filter(#1) {
+ \pgfooset{filter}{#1}
+ }
+
+ % Slot
+ \method protocol() {
+ \pgfdvfilterpassedtrue
+ \pgfoovalueof{filter}
+ \ifpgfdvfilterpassed%
+ \pgf@dv@line@cache@it
+ \fi%
+ }
+
+ \def\pgf@dv@line@cache@it{
+ % Cache it
+ \pgfooget{cache}\pgf@dv@cache
+ \edef\pgf@dv@add{\noexpand\pgf@dv@ph{\pgfkeysvalueof{/data point/canvas x}}{\pgfkeysvalueof{/data point/canvas y}}}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@dv@cache%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@dv@cache\pgf@dv@add}%
+ % Possibly flush cache
+ \global\advance\pgf@lib@dv@cache@count by1\relax%
+ \ifnum\pgf@lib@dv@cache@count=100\relax%
+ \global\pgf@lib@dv@cache@count=0\relax%
+ % Append cache to positions
+ \pgfooget{positions}\pgf@dv@temp
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@dv@temp%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@dv@temp\pgf@dv@cache}%
+ \pgfoolet{positions}\pgf@dv@temp
+ \let\pgf@dv@cache\pgfutil@empty
+ \fi
+ \pgfoolet{cache}\pgf@dv@cache
+ }
+
+ % Slot
+ \method phase(#1) {%
+ \ifx#1\pgfdvendvisualization%
+ \pgfoothis.render()%
+ \fi%
+ }
+
+ % Internal method
+ \method render() {
+ \pgfscope
+ \pgfooget{handlers}\tikz@dv@temp@list
+ \foreach\tikz@dv@temp in\tikz@dv@temp@list{
+ \ifx\tikz@dv@temp\pgfutil@empty
+ \else
+ \pgfkeysvalueof{/data point/\pgfoovalueof{name}/execute at begin}
+ \tikz@dv@temp
+ \pgfplotstreamstart
+ \pgfoovalueof{positions}
+ \pgfoovalueof{cache}
+ \pgfplotstreamend
+ \pgfkeysvalueof{/data point/\pgfoovalueof{name}/execute at end}
+ \fi
+ }
+ \endpgfscope
+ \pgfoolet{positions}\pgfutil@empty
+ \pgfoolet{cache}\pgfutil@empty
+ }
+
+ \def\pgf@dv@ph#1#2{\pgfplotstreampoint{\pgfqpoint{#1}{#2}}}
+}
+
+\newcount\pgf@lib@dv@cache@count
+
+
+% A possible filter for unnamed visualizers
+%
+% #1 = Text to be compared with key /data point/visualizer
+%
+% Description:
+%
+% In a data visualization with multiple visualizers, data points
+% typically "belong" only to a single visualizer. It is, thus,
+% necessary to filter data points accoring to the current
+% visualizer. This current visualizer is assumed to be stored in /data
+% point/visualizer.
+%
+% When objects allow you to set a filter, you can use this filter to
+% test against /data point/visualizer being equal to #1.
+
+\def\pgfdvvisualizerfilter#1{%
+ \pgfkeysgetvalue{/data point/visualizer}\pgf@dv@visualizer%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@dv@visualizer%
+ \else
+ \pgfdvfilterpassedfalse
+ \fi%
+}
+
+
+
+% A filter for named visualizer
+%
+% Description:
+%
+% This filter works like \pgfdvvisualizerfilter, only it assumes the
+% the object defines a "name" attribute. In this case, the value of
+% /data point/visualizer is tested against this attribute.
+
+\def\pgfdvnamedvisualizerfilter{%
+ \pgfkeysgetvalue{/data point/visualizer}\pgf@dv@visualizer%
+ \pgfooget{name}\pgf@temp%
+ \ifx\pgf@temp\pgf@dv@visualizer%
+ \else
+ \pgfdvfilterpassedfalse
+ \fi%
+}
+
+
+
+\pgfooclass{rectangle visualizer}
+{
+ % Class rectangle visualizer
+ %
+ % This visualizer visualizes a datapoint as a rectangle. It needs
+ % two attributes a1 and a2, each of which must have min and max
+ % subattributes. Then, it draws a rectangle between (a1/min,a2/min)
+ % and (a1/max,a2/max).
+
+ \attribute attribute 1;
+ \attribute attribute 2;
+ % The attributes
+
+ \attribute use path attribute;
+ % The attribute that stores the to-be-taken action
+
+
+ % Constructor
+ %
+ % #1 = first attribute
+ % #2 = second attribute
+ %
+ \method rectangle visualizer(#1,#2,#3) {
+ \pgfooset{attribute 1}{#1}
+ \pgfooset{attribute 2}{#2}
+ \pgfooset{use path attribute}{#3}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,visualize,visualize datapoint signal)
+ }
+
+ % Slot
+ \method visualize() {
+ {
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute 1}/min}\pgf@dv@amin
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute 1}/max}\pgf@dv@amax
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute 2}/min}\pgf@dv@bmin
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute 2}/max}\pgf@dv@bmax
+ \ifx\pgf@dv@amin\relax\else\ifx\pgf@dv@amin\pgfutil@empty\else
+ \ifx\pgf@dv@bmin\relax\else\ifx\pgf@dv@bmin\pgfutil@empty\else
+ \ifx\pgf@dv@amax\relax\else\ifx\pgf@dv@amax\pgfutil@empty\else
+ \ifx\pgf@dv@bmax\relax\else\ifx\pgf@dv@bmax\pgfutil@empty\else
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 1}}{\pgf@dv@amin}
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 2}}{\pgf@dv@bmin}
+ \pgfpathdvmoveto
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 2}}{\pgf@dv@bmax}
+ \pgfpathdvlineto
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 1}}{\pgf@dv@amax}
+ \pgfpathdvlineto
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 2}}{\pgf@dv@bmin}
+ \pgfpathdvlineto
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute 1}}{\pgf@dv@amin}
+ \pgfpathdvlineto
+ \pgfpathclose
+ \pgfkeysvalueof{/data point/\pgfoovalueof{use path attribute}}
+ \fi\fi
+ \fi\fi
+ \fi\fi
+ \fi\fi
+ }
+ }
+}
+
+\newcount\pgf@lib@dv@cache@count
+
+
+
+%
+% Label positioning classes
+%
+
+\pgfooclass{label visualizer}
+{
+ % Class label visualizer
+ %
+ % The job of this class is to visualize a label of a curve or some
+ % other object.
+ %
+ % The idea is as follows: This class monitors a certain
+ % attribute. When this attribute reaches a certain value for the
+ % first time, the following happens: A normalized vector of the line
+ % connecting the current canvas position to the canvas position of
+ % the previous data point is computed and stored in pgf@x/pgf@y. The
+ % coordinate system is shifted so that the current data point is at
+ % the origin. Then, some drawing code is executed.
+
+ \attribute attribute;
+ % The monitored attribute
+
+ \attribute filter;
+ % Filter code, see plot handler visualizer doc.
+
+ \attribute threshold;
+ % When the attribute exceeds this threshold, the drawing code is
+ % executed
+
+ \attribute before canvas position=;
+ % Stores canvas position of the data point before the interesting one
+
+ \attribute canvas position=;
+ % Stores canvas position of the data point
+
+ \attribute code;
+ % To-be-executed code when the label should be drawn
+
+
+ % Constructor
+ %
+ % #1 = attribute
+ % #2 = a macro, storing the threshold
+ % #3 = code
+ % #4 = filter code
+ %
+ \method label visualizer(#1,#2,#3,#4) {
+ \pgfooset{attribute}{#1}
+ \ifx#2\pgfutil@empty
+ \else
+ \pgfdvmathenter{\pgf@temp}{#2}
+ \fi
+ \pgfoolet{threshold}\pgf@temp
+ \pgfooset{code}{#3}
+ \pgfooset{filter}{#4}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,test,visualize datapoint signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,phase,phase signal)
+ }
+
+ % Slot
+ \method test() {
+ \pgfdvfilterpassedtrue
+ \pgfoovalueof{filter}
+ \ifpgfdvfilterpassed%
+ \pgfooget{attribute}\pgf@dv@attribute
+ \ifx\pgf@dv@attribute\pgfutil@empty%
+ % nothing to do (anymore)
+ \else%
+ \pgf@dv@label@vis@record
+ \fi%
+ \fi%
+ }
+
+ \def\pgf@dv@label@vis@record{
+ % Record current position
+ \edef\pgf@dv@pos{%
+ \noexpand\pgfqpoint%
+ {\pgfkeysvalueof{/data point/canvas x}}%
+ {\pgfkeysvalueof{/data point/canvas y}}}%
+ \pgfooget{canvas position}\pgf@dv@temp%
+ \pgfoolet{before canvas position}\pgf@dv@temp%
+ \pgfoolet{canvas position}\pgf@dv@pos%
+ % Now check threshold
+ \pgfooget{threshold}\pgf@dv@thres%
+ \ifx\pgf@dv@thres\pgfutil@empty%
+ \else%
+ % Hmm, have to check, whether the value is, indeed, correct
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}}\pgf@dv@val
+ \ifx\pgf@dv@val\relax%
+ \else\ifx\pgf@dv@val\pgfutil@empty%
+ \else%
+ \pgfdvmathenter{\pgf@dv@value}{\pgf@dv@val}%
+ \pgfooget{threshold}{\pgf@dv@thres}
+ % Now, protocol value
+ \pgfdvmathifless{\pgf@dv@value}{\pgf@dv@thres}{}{%
+ \pgfoolet{attribute}\pgfutil@empty% Stop!
+ }%
+ \fi\fi%
+ \fi%
+ }
+
+ % Slot
+ \method phase(#1) {%
+ \ifx#1\pgfdvendvisualization%
+ \scope
+ \pgfcoordinate{label visualizer coordinate}{\pgfoovalueof{canvas position}}
+ \pgfcoordinate{label visualizer coordinate'}{\pgfoovalueof{before canvas position}}
+ \pgfoovalueof{code}
+ \endscope
+ \fi%
+ }
+
+}
+
+
+
+%
+% Style sheets
+%
+\pgfooclass{style attribute}
+{
+ % Class style attribute
+ %
+ % Instances of this class are used to select a style based on the
+ % current value of an attribute.
+ %
+ % Instances of this class monitor an attribute. Whenever the "style"
+ % signal is raised, the object investigates the current value of the
+ % attribute. It then looks up /pgf/data visualization/style
+ % sheets/<name of style sheet>/<value of the attribute> and executes
+ % this key, provided it is defined. If it not defined, the key
+ % /pgf/data visualization/style sheets/<name of style sheet>/default
+ % style is executed with the value as a parameter.
+
+ \attribute attribute;
+ % The name of the attribute
+
+ \attribute style sheet name;
+ % The styling function
+
+ % Constructor
+ %
+ % #1 = attribute (including, if present, /data point/)
+ % #2 = style sheet name
+ %
+ \method style attribute(#1,#2) {
+ \pgfooset{attribute}{#1}
+ \pgfooset{style sheet name}{#2}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,invoke style,style signal)
+ }
+
+ % Slots
+ \method invoke style() {
+ \pgfooget{attribute}\pgf@dv@temp
+ \pgfkeysgetvalue{\pgf@dv@temp}\pgf@dv@temp@val
+ \ifx\pgf@dv@temp@val\pgfutil@empty%do nothing
+ \else\ifx\pgf@dv@temp@val\relax%do nothing
+ \else%
+ \pgfkeysifdefined{\pgf@dv@temp/\pgf@dv@temp@val}{\pgfkeysgetvalue{\pgf@dv@temp/\pgf@dv@temp@val}\pgf@dv@temp@val}{}% redirect
+ \edef\pgf@temp{/pgf/data visualization/style sheets/\pgfoovalueof{style sheet name}}
+ \pgfkeysifassignable{\pgf@temp/\pgf@dv@temp@val}{%
+ \pgfkeysalso{\pgf@temp/\pgf@dv@temp@val}}{%
+ \pgfkeysalso{\pgf@temp/default style/.expand once=\pgf@dv@temp@val}
+ }
+ \fi\fi%
+ }
+}
+
+
+% Declares a new style sheet
+%
+% #1 = name of style sheet
+% #2 = settings
+%
+% Description:
+%
+% This is a shortcut for doing a /.cd to /pgf/data visualization/style sheets/#1
+
+\def\pgfdvdeclarestylesheet#1#2{
+ \pgfkeys{/pgf/data visualization/style sheets/#1/.cd,#2}
+}
+
+
+
+
+
+
+
+
+
+%
+% Legend container class
+%
+
+\pgfooclass{legend}
+{
+ % Class legend
+ %
+ % This class is used to collect entries into a legend. The idea is
+ % that, say, for each line of a picture you would like to have an
+ % entry in a legend. Then you prepare these entries and send
+ % them to a legend container object. It will collect the entries
+ % and, at the end, arrange them in rows and columns by
+ % separating them using \pgfdvnextcell and \pgfdvendrow.
+ %
+ % By surrounding the resulting arrangement by a call to \pgfmatrix or
+ % a call to \halign you can then create a legend.
+ %
+ % To specify how the entries should be arranged, a size
+ % specification and two directions are needed.
+ %
+ % For the size specification you specify either the ideal number of
+ % columns and the maximum number of rows or you specify the ideal
+ % number of rows and the maximum number of columns. In the first
+ % case, the class first tries to create as many columns as specified
+ % by the "ideal" parameter. If there are less entries than this
+ % parameter, you obviously get less columns, namely as many as there
+ % are entries, each column containing only one entry. If there are
+ % more entries that the ideal number of columns, you get multiple
+ % columns, each containing as many entries to make sure that the
+ % ideal number is met. However, if a column would get more than the
+ % specified maximum number of elements per column, you get more
+ % columns that the ideal number -- to ensure that no column contains
+ % more than the desired number. The case is symmetric, but with the
+ % roles of columns and rows exchanged.
+ %
+ % Here is an example: You specify that you want 2 columns, ideally,
+ % each having a maximum of 4 entries. Here is what you would get:
+ %
+ % Number of entries & Number of resulting columns ... & ... and rows
+ % 1 & 1 & 1
+ % 2 & 2 & 1
+ % 3 & 2 & 2
+ % 4 & 2 & 2
+ % 5 & 2 & 3
+ % 6 & 2 & 3
+ % 7 & 2 & 4
+ % 8 & 2 & 4
+ % 9 & 3 & 4
+ % 10 & 3 & 4
+ % 11 & 3 & 4
+ % 12 & 3 & 4
+ % 13 & 4 & 4
+ %
+ %
+ % Once the number of columns and rows has been computed, the next
+ % step is to "fill" the table. For this, eight strategies may be
+ % specified: right then down, right then up, left then down, left
+ % then up, up then right, up then left, down then right, down then
+ % left. A strategy like "right then up" means the following: Each
+ % new entry should placed right of the previous entry in the
+ % arrangement. However, once the maximum number of elements in a row
+ % has been reached, the a new row should be started that is placed
+ % above ("up") then just-assembled row.
+ %
+ %
+ %
+ %
+ % Example:
+ %
+ % You create an object \legend and then call
+ %
+ % \pgfoofnew \legend=new legend(columns,2,3,down then right)
+ % \legend.add entry(first)
+ % \legend.add entry(second)
+ % \legend.add entry(third)
+ % \legend.add entry(fourth)
+ % \legend.add entry(fifth)
+ % \legend.add entry(sixth)
+ % \legend.add entry(seventh)
+ % \legend.get arrangment(\arrangement)
+ %
+ % Then \arrangment will expand to
+ %
+ % first \pgfdvnextcell fourth \pgfdvnextcell seventh \pgfdvendrow
+ % second \pgfdvnextcell fifth \pgfdvnextcell third \pgfdvendrow
+ % third \pgfdvendrow sixth \pgfdvnextcell \pgfdvendrow
+ %
+ % By saying \let\pgfdvendrow=\\ and \let\pgfdvnextcell=&, you
+ % can use \arrangment inside a table.
+
+
+ \attribute entries;
+ % Collectes the entries
+
+ \attribute columns or rows;
+ % Specifies whether columns or rows are specified
+
+ \attribute ideal;
+ % The ideal number of columns/rows
+
+ \attribute max;
+ % The maximum number of entries per column/row
+
+ \attribute strategy;
+ % Specifies how the matrix should be filled
+
+ \attribute number of entries=0;
+ % Counts the number of entries that have been stored
+
+
+ % Constructor
+ %
+ % #1 = "columns" or "rows" -> specifies whether the ideal number and
+ % the max entries number refer to columns or the row
+ % #2 = the ideal number of #1's
+ % #3 = the maximum number of entries in a #1
+ % #4 = one of the eight strategies
+ %
+ \method legend(#1,#2,#3,#4) {
+ \pgfooset{columns or rows}{#1}
+ \pgfooset{ideal}{#2}
+ \pgfooset{max}{#3}
+ \pgfooset{strategy}{#4}
+ }
+
+ % Method
+ \method add entry(#1) {
+ \pgfooappend{entries}{{#1}}
+ \c@pgf@counta=\pgfoovalueof{number of entries}\relax%
+ \advance\c@pgf@counta by1\relax%
+ \pgfooeset{number of entries}{\the\c@pgf@counta}
+ }
+
+ % Method
+ \method get arrangement(#1) {
+ {
+ %
+ % Step 1: Compute the desired number of rows or columns
+ %
+ %
+ % Compute the ideal number of entries per row/column (called
+ % "target" in the following) and entries per colum/row (called
+ % "per target" in the following)
+ %
+ % if (number of entries > ideal)
+ \ifnum\pgfoovalueof{number of entries}>\pgfoovalueof{ideal}\relax%
+ % {
+ % if (ideal * max > number of entries)
+ \c@pgf@counta=\pgfoovalueof{ideal}\relax%
+ \multiply\c@pgf@counta by\pgfoovalueof{max}\relax%
+ \ifnum\c@pgf@counta>\pgfoovalueof{number of entries}\relax
+ % {
+ % target = ideal;
+ % per target = ceil (number of entries / ideal);
+ \c@pgf@counta=\pgfoovalueof{ideal}\relax%
+ \c@pgf@countb=\pgfoovalueof{number of entries}\relax
+ \advance\c@pgf@countb by-1\relax
+ \divide\c@pgf@countb by\c@pgf@counta\relax%
+ \advance\c@pgf@countb by1\relax%
+ % }
+ % else
+ % {
+ % target = ceil(number of entries / max);
+ % per target = max;
+ \else
+ \c@pgf@countb=\pgfoovalueof{max}\relax%
+ \c@pgf@counta=\pgfoovalueof{number of entries}\relax
+ \advance\c@pgf@counta by-1\relax
+ \divide\c@pgf@counta by\c@pgf@countb\relax%
+ \advance\c@pgf@counta by1\relax%
+ \fi
+ % }
+ % }
+ % else
+ % {
+ % target = number of entries;
+ % per target = 1;
+ % }
+ \else
+ \c@pgf@counta=\pgfoovalueof{number of entries}\relax%
+ \c@pgf@countb=1\relax%
+ \fi%
+ %
+ % Ensure that counta = rows, countb = columns
+ %
+ \pgfooget{columns or rows}\pgf@temp
+ \ifx\pgf@temp\pgf@dv@columnstext%
+ \c@pgf@countc=\c@pgf@counta\relax
+ \c@pgf@counta=\c@pgf@countb\relax
+ \c@pgf@countb=\c@pgf@countc\relax
+ \fi
+ \edef\temp{rows: \the\c@pgf@counta, columns: \the\c@pgf@countb}\temp
+ %
+ % Now arrange the matrix
+ %
+ \csname pgf@dv@legend@init@\pgfoovalueof{strategy}\endcsname
+ \expandafter\let\expandafter\pgf@dv@updater\csname pgf@dv@legend@update@\pgfoovalueof{strategy}\endcsname
+ \pgfooget{entries}\pgf@temp
+ \expandafter\pgf@dv@legend@arrange\pgf@temp\pgf@stop
+ %
+ % Now assemble the matrix
+ %
+ \edef\pgf@dv@row@list{1,...,\the\c@pgf@counta}
+ \edef\pgf@dv@column@list{1,...,\the\c@pgf@countb}
+ \global\let\pgf@dv@matrix\pgfutil@empty
+ \foreach \pgf@dv@row in \pgf@dv@row@list
+ {
+ \global\let\pgf@dv@matrix@row\pgf@dv@first@mark
+ \foreach \pgf@dv@column in \pgf@dv@column@list
+ {
+ \expandafter\let\expandafter\pgf@temp\csname pgf@dv@legend@entry@\pgf@dv@row @\pgf@dv@column\endcsname
+ \ifx\pgf@temp\relax
+ \let\pgf@temp\pgfutil@empty
+ \fi
+ \ifx\pgf@dv@matrix@row\pgf@dv@first@mark
+ \global\let\pgf@dv@matrix@row\pgf@temp
+ \else
+ \expandafter\pgfutil@g@addto@macro\expandafter\pgf@dv@matrix@row\expandafter{\expandafter\pgfdvnextcell\pgf@temp}
+ \fi
+ }
+ \pgfutil@g@addto@macro\pgf@dv@matrix@row{\pgfdvendrow}
+ \expandafter\pgfutil@g@addto@macro\expandafter\pgf@dv@matrix\expandafter{\pgf@dv@matrix@row}
+ }
+ \global\let\pgf@dv@matrix@row\relax
+ }
+ \let#1\pgf@dv@matrix
+ \global\let\pgf@dv@matrix\relax
+ }
+
+ \def\pgf@dv@first@mark{\pgf@dv@first@mark}
+
+ \def\pgf@dv@legend@arrange{%
+ \pgfutil@ifnextchar\pgf@stop{\pgfutil@gobble}{\pgf@dv@legend@handle@entry}
+ }
+
+ \def\pgf@dv@legend@handle@entry#1{
+ \expandafter\def\csname pgf@dv@legend@entry@\the\c@pgf@countc @\the\c@pgf@countd\endcsname{#1}%
+ \pgf@dv@updater%
+ \pgf@dv@legend@arrange%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@down then right\endcsname{%
+ \c@pgf@countc=1\relax%
+ \c@pgf@countd=1\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@down then right\endcsname{%
+ \advance\c@pgf@countc by1\relax
+ \ifnum\c@pgf@countc>\c@pgf@counta\relax%
+ \c@pgf@countc=1\relax%
+ \advance\c@pgf@countd by1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@right then down\endcsname{%
+ \c@pgf@countc=1\relax%
+ \c@pgf@countd=1\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@right then down\endcsname{%
+ \advance\c@pgf@countd by1\relax
+ \ifnum\c@pgf@countd>\c@pgf@countb\relax%
+ \c@pgf@countd=1\relax%
+ \advance\c@pgf@countc by1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@up then right\endcsname{%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \c@pgf@countd=1\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@up then right\endcsname{%
+ \advance\c@pgf@countc by-1\relax
+ \ifnum\c@pgf@countc=0\relax%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \advance\c@pgf@countd by1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@right then up\endcsname{%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \c@pgf@countd=1\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@right then up\endcsname{%
+ \advance\c@pgf@countd by1\relax
+ \ifnum\c@pgf@countd>\c@pgf@countb\relax%
+ \c@pgf@countd=1\relax%
+ \advance\c@pgf@countc by-1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@left then up\endcsname{%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@left then up\endcsname{%
+ \advance\c@pgf@countd by-1\relax
+ \ifnum\c@pgf@countd=0\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ \advance\c@pgf@countc by-1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@up then left\endcsname{%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@up then left\endcsname{%
+ \advance\c@pgf@countc by-1\relax
+ \ifnum\c@pgf@countc=0\relax%
+ \c@pgf@countc=\c@pgf@counta\relax%
+ \advance\c@pgf@countd by-1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@left then down\endcsname{%
+ \c@pgf@countc=1\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@left then down\endcsname{%
+ \advance\c@pgf@countd by-1\relax
+ \ifnum\c@pgf@countd=0\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ \advance\c@pgf@countc by1\relax%
+ \fi%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@init@down then left\endcsname{%
+ \c@pgf@countc=1\relax%
+ \c@pgf@countd=\c@pgf@countb\relax%
+ }
+
+ \expandafter\def\csname pgf@dv@legend@update@down then left\endcsname{%
+ \advance\c@pgf@countc by1\relax
+ \ifnum\c@pgf@countc>\c@pgf@countb\relax%
+ \c@pgf@countc=1\relax%
+ \advance\c@pgf@countd by-1\relax%
+ \fi%
+ }
+
+ \def\pgf@dv@columnstext{columns}
+}
+
+
+
+%
+% Help classes
+%
+
+\pgfooclass{interval}
+{
+ % Class interval
+ %
+ % Instances of this class store intervals. When either the min or
+ % the max value is empty, this corresponds to "not yet set", (not to
+ % "infinity).
+
+ \attribute min;
+ % The minimum value of the interval
+
+ \attribute max;
+ % The maximum value of the interval
+
+ % Constructor
+ %
+ % #1 = initial minimum value
+ % #2 = initial maximum value
+ %
+ \method interval(#1,#2) {
+ \pgfooset{min}{#1}
+ \pgfooset{max}{#2}
+ }
+
+ % Method
+ \method default connects() {
+ }
+
+ % Sets the minimum/maximum to a new value
+ \method set min(#1) {
+ \pgfooset{min}{#1}
+ }
+ \method set max(#1) {
+ \pgfooset{max}{#1}
+ }
+
+ % Getter
+ %
+ % Returns the current values of the minimum and maximum in the
+ % macros \pgfdvmin and \pgfdvmax.
+ \method get min and max() {
+ \pgfooget{min}\pgfdvmin
+ \pgfooget{max}\pgfdvmax
+ }
+
+ % Adjusts the mimum and maximum values
+ %
+ % #1 = some code. When this code is executed, the values of
+ % \pgfdvmin and \pgfdvmax will be set to the current values of
+ % the minimum/maximum. The code may change these values. The
+ % changed values will then be stored.
+ %
+ % This method does nothing that cannot be achieved also by calling
+ % set/get methods, but it is easier to use and faster.
+ \method adjust(#1) {
+ {%
+ \pgfooget{min}\pgfdvmin
+ \pgfooget{max}\pgfdvmax
+ #1%
+ \pgfoolet{min}\pgfdvmin
+ \pgfoolet{max}\pgfdvmax
+ }%
+ }
+}
+
+
+
+\pgfooclass{count}
+{
+ % Class count
+ %
+ % This class can be used to count the number of data points that are
+ % present or that have a certain property. By default, for every
+ % data point a counter is incremented and the value of this counter
+ % is stored in an attribute. You can also specify an increment for
+ % the counter and some action that should be taken when the counter
+ % reaches zero. You can also specify that certain data points should
+ % not have an effect on the counter.
+ %
+ % Counters can serve different purposes.
+ %
+ % 1. For plotting points in a table or sequence, the counter can be
+ % used to provide the position along one axis.
+ % 2. By using the counter as a repetitive count down one can for
+ % instance have only every 10th data point be marked.
+
+ \attribute attribute;
+ % The attribute that will be set to the current value of the counter
+
+ \attribute val=0;
+ % The current value of the counter
+
+ \attribute step=1;
+ % The stepping by which the counter is incremented for each
+ % datapoint
+
+ \attribute start val=0;
+ % The start value of the counter
+
+ \attribute filter=;
+ % This attribute stores some code that is executed for each
+ % data point. If the data point sets the TeX-if ifpgfdvfilterpassed to
+ % true, then the counter is not incremented.
+
+
+ % Constructor
+ %
+ % #1 = The attribute in which the counter value is stored
+ %
+ \method count(#1) {
+ \pgfooset{attribute}{#1}
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,apply,prepare datapoint signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,phase,phase signal)
+ }
+
+ % Setter
+ \method set value(#1) {
+ \pgfooset{val}{#1}
+ \pgfkeyssetvalue{/data point/\pgfoovalueof{attribute}}{#1}%
+ }
+
+ % Setter
+ \method set start value(#1) {
+ \pgfooset{start val}{#1}
+ }
+
+ % Setter
+ \method set filter(#1) {
+ \pgfooset{filter}{#1}
+ }
+
+ % Setter
+ \method set step(#1) {
+ \pgfooset{step}{#1}
+ }
+
+ % Slot
+ \method apply() {
+ \pgfdvfilterpassedtrue%
+ \pgfoovalueof{filter}%
+ \ifpgfdvfilterpassed%
+ \pgfmathparse{\pgfoovalueof{val}+\pgfoovalueof{step}}%
+ \pgfoolet{val}\pgfmathresult%
+ \pgfkeyslet{/data point/\pgfoovalueof{attribute}}\pgfmathresult%
+ \fi%
+ }
+
+ % Slot
+ \method phase(#1) {
+ \ifx#1\pgfdvbeginsurvey
+ \pgfooeset{val}{\pgfoovalueof{start val}}
+ \else \ifx#1\pgfdvbeginvisualization
+ \pgfooeset{val}{\pgfoovalueof{start val}}
+ \fi\fi
+ }
+}
+
+\newif\ifpgfdvfilterpassed
+
+
+
+
+\pgfooclass{accumulator}
+{
+ % Class accumulator
+ %
+ % This class is used to keep track of the sum of the values of some
+ % attribute. When this object is connected to some attribute, the
+ % subkey attribute/sum will always contain the sum of all values in
+ % all previous data points with respect to this
+ % attribute. Furthermore, the subkey attribute/prev key will hold
+ % the previous sum, which is sometimes also useful to have access
+ % to.
+
+ \attribute attribute;
+ % The attribute to-be-accumulated
+
+ \attribute sum;
+ % The initial value of the sum
+
+ % Constructor
+ %
+ % #1 = to-be-accumulated attribute
+ \method accumulator(#1) {
+ \pgfooset{attribute}{#1}
+ \pgfoothis.reset()
+ }
+
+ % Method
+ \method default connects() {
+ \pgfoothis.get handle(\pgf@dv@me)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,apply,prepare datapoint signal)
+ \pgfkeysvalueof{/pgf/data visualization/obj}.connect(\pgf@dv@me,phase,phase signal)
+ }
+
+ % Slot
+ \method apply() {%
+ % Save old sum
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}/sum}\pgf@temp%
+ \pgfkeyslet{/data point/\pgfoovalueof{attribute}/prev sum}\pgf@temp%
+ % Add new attribute...
+ \pgfkeysgetvalue{/data point/\pgfoovalueof{attribute}}{\pgf@temp@b}%
+ \pgfdvmathenter{\pgf@dv@new@val}{\pgf@temp@b}%
+ % ... to sum
+ \pgfooget{sum}\pgf@dv@sum%
+ \pgfdvmathadd{\pgf@dv@sum}{\pgf@dv@new@val}{\pgf@dv@sum}%
+ \pgfoolet{sum}\pgf@dv@sum
+ % Record in attribute
+ \pgfdvmathexitbyscientificformat{\pgf@dv@serial@sum}{\pgf@dv@sum}
+ \pgfkeyslet{/data point/\pgfoovalueof{attribute}/sum}\pgf@dv@serial@sum
+ }
+
+ % Method
+ %
+ % Use this method to reset the sum at any point.
+ %
+ \method reset() {
+ \pgfdvmathenter{\pgf@dv@temp}{0}
+ \pgfoolet{sum}{\pgf@dv@temp}
+ \pgfdvmathexitbyserializing{\pgf@dv@zero}{\pgf@dv@temp}
+ \pgfkeyslet{/data point/\pgfoovalueof{attribute}/prev sum}{\pgf@dv@zero}
+ \pgfkeyslet{/data point/\pgfoovalueof{attribute}/sum}{\pgf@dv@zero}
+ }
+
+ % Slot
+ \method phase(#1) {
+ \ifx#1\pgfdvbeginsurvey
+ \pgfoothis.reset()
+ \else \ifx#1\pgfdvbeginvisualization
+ \pgfoothis.reset()
+ \fi\fi
+ }
+}
+
+
+
+
+
+
+
+%
+%
+% Help keys and, attributes
+%
+%
+
+\pgfkeys{% do not even think of changing the values of the following:
+ /data point/always true/.initial=true,
+ /data point/always false/.initial=false,
+ /data point/always 0/.initial=0,
+ /data point/always 1/.initial=1,
+ /data point/always empty/.initial=,
+ /data point/always pgfusepath stroke/.initial=\pgfusepath{stroke}
+}
+
+\pgfdvmathenter{\pgfdvmathalwaysloge}{0.434294481903252}
+\pgfdvmathenter{\pgfdvmathalwayslnten}{2.302585092994046}
+\pgfdvmathenter{\pgfdvmathalwayszero}{0}
+\pgfdvmathenter{\pgfdvmathalwaysone}{1}
+
+
+\endinput
+
+
+
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
index 739a28395c2..9834e91f0ec 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
@@ -1,4 +1,4 @@
-% Copyright 2008 by Mark Wibrow
+% Copyright 2008 by Mark Wibrow and Till Tantau
%
% This file may be distributed and/or modified
%
@@ -57,10 +57,11 @@
start radius/.initial=2.5pt,
end radius/.initial=2.5pt,
radius/.style={start radius=#1,end radius=#1},
- path has corners/.is if=pgfdecoratepathhascorners
+ path has corners/.is if=pgfdecoratepathhascorners,
+ reverse path/.is if=pgf@decorate@inputsegmentobjects@reverse
}
\newif\ifpgfdecoratepathhascorners
-
+\newif\ifpgf@decorate@inputsegmentobjects@reverse
% Declare a decoration
%
@@ -490,6 +491,7 @@
}
+
% Enviroment \pgfmetadecoration \endpgfmetadecoration
%
% Decorate a path with decoration automatons!
@@ -539,12 +541,12 @@
% \endpgfpicture
%
\def\pgfmetadecoration#1{%
- \begingroup%
- \let\decoration\pgf@metadecoration@decoration%
- \let\beforedecoration\pgf@metadecoration@beforedecoration%
- \let\afterdecoration\pgf@metadecoration@afterdecoration%
- \def\pgf@metadecoration@name{#1}%
- \pgf@decoration@env%
+ \begingroup%
+ \let\decoration\pgf@metadecoration@decoration%
+ \let\beforedecoration\pgf@metadecoration@beforedecoration%
+ \let\afterdecoration\pgf@metadecoration@afterdecoration%
+ \def\pgf@metadecoration@name{#1}%
+ \pgf@decoration@env%
}
\def\endpgfmetadecoration{%
@@ -611,6 +613,21 @@
\bgroup%
}
+\def\pgf@decorate@path@check@moveto#1{%
+ \expandafter\pgf@decorate@path@@check@moveto#1\pgf@decorate@stop\pgf@decorate@@stop}
+
+\def\pgf@decorate@token@stop{\pgf@decorate@stop}%
+\def\pgf@decorate@path@@check@moveto#1#2#3#4\pgf@decorate@@stop#5#6{%
+ \def\pgf@decorate@temp{#4}%
+ \pgf@x=#2\relax%
+ \pgf@y=#3\relax%
+ \ifx\pgf@decorate@temp\pgf@decorate@token@stop%
+ #5%
+ \else%
+ #6%
+ \fi%
+}
+
\def\pgf@decoration@endenv{%
\egroup%
\pgftransformreset%
@@ -623,6 +640,18 @@
\ifx\pgfdecoratedpath\pgfutil@empty%
\PackageError{PGF}{I cannot decorate an empty path}{}%
\else%
+ %
+ % If the path consists of a single moveto token, make it
+ % a very small horizontal line.
+ %
+ \pgf@decorate@path@check@moveto\pgfdecoratedpath{%
+ \advance\pgf@x by0.0001pt\relax%
+ \edef\pgfdecoratedpath{%
+ \expandafter\noexpand\pgfdecoratedpath%
+ \noexpand\pgfsyssoftpath@linetotoken{\the\pgf@x}{\the\pgf@y}%
+ }%
+ }%
+ {}%
%
% Remove special round tokens and get points.
%
@@ -631,6 +660,16 @@
% Parse the soft path into a series of decorated input segment objects.
%
\pgf@decorate@parsesoftpath{\pgfdecoratedpath}{\pgf@decorate@inputsegmentobjects}%
+ %
+ % Setup further options
+ %
+ \pgfkeys{/pgf/every decoration/.try}%
+ %
+ % Reverse objects if necessary.
+ %
+ \ifpgf@decorate@inputsegmentobjects@reverse%
+ \pgf@decorate@inputsegmentobjects@reverse{\pgf@decorate@inputsegmentobjects}{\pgf@decorate@inputsegmentobjects}%
+ \fi%
%
\let\pgf@decorated@remainingdistance\pgf@decorate@totalpathlength%
%
@@ -647,13 +686,8 @@
\pgf@decorate@getnextinputsegmentobject\pgf@decorate@nextinputsegmentobject%
\pgf@decorate@processnextinputsegmentobject%
\pgf@decorate@distancetomove0pt\relax%
- %
- % Setup further options
- %
- \pgfkeys{/pgf/every decoration/.try}%
\fi%
-}%
-
+}%
@@ -1194,25 +1228,24 @@
% Process the next input segment object.
%
\def\pgf@decorate@processnextinputsegmentobject{%
- %
+ \let\pgfdecorationpreviousinputsegment\pgfdecoratecurrentinputsegment%
\let\pgf@decorate@currentinputsegmentobject\pgf@decorate@nextinputsegmentobject%
\pgf@decorate@getnextinputsegmentobject\pgf@decorate@nextinputsegmentobject%
- %
+ %
% If the current input segment object is a moveto, execute the
% object macro and get the next input segment object.
%
- \expandafter\pgfutil@in@\expandafter\pgf@decorate@inputsegmentobject@moveto%
- \expandafter{\pgf@decorate@currentinputsegmentobject}%
- \ifpgfutil@in@%
- \pgf@decorate@currentinputsegmentobject%
+ \pgf@decorate@is@closepath@false%
+ \pgf@decorate@currentinputsegmentobject%
+ \ifx\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentmoveto%
+ \pgfpathmoveto{\pgf@decorate@inputsegment@first}%
+ \let\pgfdecorationpreviousinputsegment\pgfdecorationcurrentinputsegment%
\let\pgf@decorate@currentinputsegmentobject\pgf@decorate@nextinputsegmentobject%
\pgf@decorate@getnextinputsegmentobject\pgf@decorate@nextinputsegmentobject%
- \relax%
+ \pgf@decorate@is@closepath@false%
+ \pgf@decorate@currentinputsegmentobject%
\fi%
%
- \pgf@decorate@is@closepath@false%
- \pgf@decorate@currentinputsegmentobject%
- %
% Teensy hack in case a path goes nowhere.
%
\ifdim\pgfdecoratedinputsegmentlength=0pt\relax%
@@ -1221,8 +1254,41 @@
\pgfdecoratedinputsegmentremainingdistance\pgfdecoratedinputsegmentlength\relax%
\pgfdecoratedinputsegmentcompleteddistance0pt\relax%
\def\pgf@decorate@inputsegmenttime{0}%
- \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@supporta}%
- \let\pgfdecoratedangle\pgfmathresult%
+ %
+ % Get the angle at the start of the input segment.
+ %
+ \ifx\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentcurveto%
+ \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@supporta}%
+ \let\pgfdecoratedangle\pgfmathresult%
+ \let\pgfdecoratedinputsegmentstartangle\pgfmathresult%
+ \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@supportb}{\pgf@decorate@inputsegment@last}%
+ \let\pgfdecoratedinputsegmentendangle\pgfmathresult%
+ \else%
+ \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@last}%
+ \let\pgfdecoratedangle\pgfmathresult%
+ \let\pgfdecoratedinputsegmentstartangle\pgfmathresult%
+ \let\pgfdecoratedinputsegmentendangle\pgfmathresult%
+ \fi%
+ %
+ % Get the angle to the next input segment.
+ %
+ \begingroup%
+ \pgf@decorate@nextinputsegmentobject%
+ \global\let\pgf@decorate@temp\pgfdecorationcurrentinputsegment%
+ \ifx\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentmoveto%
+ \expandafter\pgf@decorate@currentinputsegmentobject%
+ \fi%
+ \ifx\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentcurveto%
+ \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@supporta}%
+ \else%
+ \pgfmathanglebetweenpoints{\pgf@decorate@inputsegment@first}{\pgf@decorate@inputsegment@last}%
+ \fi%
+ \pgf@x-\pgfdecoratedangle pt\relax%
+ \advance\pgf@x\pgfmathresult pt\relax%
+ \edef\pgfdecoratedangletonextinputsegment{\the\pgf@x}%
+ \pgfmath@smuggleone\pgfdecoratedangletonextinputsegment%
+ \endgroup%
+ \let\pgfdecorationnextinputsegmentobject\pgf@decorate@temp%
}
@@ -1232,18 +1298,30 @@
\newif\ifpgf@decorate@is@closepath@%
+% Input segment types.
+%
+% These allow comparison with \ifx using
+%
+% \pgfdecorationcurrentinputsegment
+% \pgfdecorationnextinputsegment
+% \pgfdecorationcurrentprevioussegment
+%
+\def\pgfdecorationinputsegmentmoveto{moveto}
+\def\pgfdecorationinputsegmentlineto{lineto}
+\def\pgfdecorationinputsegmentcurveto{curveto}
+\def\pgfdecorationinputsegmentclosepath{closepath}
+\def\pgfdecorationinputsegmentlast{last}
% Input segment object moveto.
%
\def\pgf@decorate@inputsegmentobject@moveto#1{%
- \pgfpathmoveto{#1}%
\def\pgf@decorate@inputsegment@first{#1}%
\def\pgf@decorate@inputsegment@supporta{#1}%
\def\pgf@decorate@inputsegment@supportb{#1}%
\def\pgf@decorate@inputsegment@last{#1}%
\edef\pgf@decorate@lastmoveto{#1}%
\def\pgfdecoratedinputsegmentlength{0pt}%
- \let\pgf@decorate@splitinputsegmentobject\pgf@decorate@splitinputsegmentobject@move%
+ \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentmoveto%
}
% Input segment object lineto.
@@ -1251,17 +1329,28 @@
\def\pgf@decorate@inputsegmentobject@lineto#1#2#3{%
\def\pgfdecoratedinputsegmentlength{#1}%
\def\pgf@decorate@inputsegment@first{#2}%
+ \def\pgf@decorate@inputsegment@last{#3}%
%
- % OK, lines don't need supports, but this means angle calculations
- % do not have to be done individually for each object.
+ % Supports should be defined like this, so if treated as a curve,
+ % equal time steps will correspond to equal distances.
%
- \def\pgf@decorate@inputsegment@supporta{#3}%
- \def\pgf@decorate@inputsegment@supportb{#2}%
- \def\pgf@decorate@inputsegment@last{#3}%
+ \pgfpointdiff{#2}{#3}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfextract@process\pgf@decorate@inputsegment@supporta{%
+ \pgf@process{#2}%
+ \advance\pgf@x0.333333\pgf@xa%
+ \advance\pgf@y0.333333\pgf@ya%
+ }%
+ \pgfextract@process\pgf@decorate@inputsegment@supportb{%
+ \pgf@process{#2}%
+ \advance\pgf@x0.666666\pgf@xa%
+ \advance\pgf@y0.666666\pgf@ya%
+ }%
%
\let\pgf@decorate@movealonginputsegment\pgf@decorate@movealonginputsegment@line%
\let\pgf@decorate@transformtoinputsegment\pgf@decorate@transformtoinputsegment@line%
- \let\pgf@decorate@splitinputsegmentobject\pgf@decorate@splitinputsegmentobject@line%
+ \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentlineto%
}
% Input segment object curveto.
@@ -1275,7 +1364,7 @@
%
\let\pgf@decorate@movealonginputsegment\pgf@decorate@movealonginputsegment@curve%
\let\pgf@decorate@transformtoinputsegment\pgf@decorate@transformtoinputsegment@curve%
- \let\pgf@decorate@splitinputsegmentobject\pgf@decorate@splitinputsegmentobject@curve%
+ \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentcurveto%
}
% Input segment object closepath.
@@ -1287,18 +1376,33 @@
%
\def\pgfdecoratedinputsegmentlength{#1}%
\def\pgf@decorate@inputsegment@first{#2}%
- \def\pgf@decorate@inputsegment@supporta{#3}%
- \def\pgf@decorate@inputsegment@supportb{#2}%
- \def\pgf@decorate@inputsegment@last{#3}%
- %
+ \def\pgf@decorate@inputsegment@last{#3}%
+ %
+ \pgfpointdiff{#2}{#3}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfextract@process\pgf@decorate@inputsegment@supporta{%
+ \pgf@process{#2}%
+ \advance\pgf@x0.333333\pgf@xa%
+ \advance\pgf@y0.333333\pgf@ya%
+ }%
+ \pgfextract@process\pgf@decorate@inputsegment@supportb{%
+ \pgf@process{#2}%
+ \advance\pgf@x0.666666\pgf@xa%
+ \advance\pgf@y0.666666\pgf@ya%
+ }%
+ %
\let\pgf@decorate@movealonginputsegment\pgf@decorate@movealonginputsegment@line%
\let\pgf@decorate@transformtoinputsegment\pgf@decorate@transformtoinputsegment@line%
- \let\pgf@decorate@splitinputsegmentobject\pgf@decorate@splitinputsegmentobject@line%
+ \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentclosepath%
}
+
% Input segment object endofinputsegments.
%
-\def\pgf@decorate@inputsegmentobject@endofinputsegments{}
+\def\pgf@decorate@inputsegmentobject@endofinputsegments{%
+ \let\pgfdecorationcurrentinputsegment\pgfdecorationinputsegmentlast%
+}
@@ -1493,7 +1597,7 @@
% \pgfpathlineto{\pgfpoint{12pt}{0pt}}
% \pgfgetpath\softpath
%
-% \pgf@decorate@parsesoftpath{\softpath}{\parsedsoftpath}{}
+% \pgf@decorate@parsesoftpath{\softpath}{\parsedsoftpath}
%
% results in:
%
@@ -1855,6 +1959,150 @@
}
+% Macro to reverse a set of input segment objects.
+%
+% #1 - a macro holding the input segment objects.
+% #2 - a macro holding the reversed input segment objects.
+%
+\def\pgf@decorate@inputsegmentobjects@reverse#1#2{%
+ \def\pgf@decorate@path@storein{#2}%
+ \def\pgf@decorate@inputsegments@@temp{}%
+ \expandafter\pgf@decorate@inputsegments@@reverse@pass@first#1\pgf@stop}
+
+\def\pgf@decorate@inputsegments@@reverse@pass@first#1#2\pgf@stop{%
+ \def\pgf@decorate@temp{#1}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgf@decorate@inputsegments@@temp\expandafter\expandafter\expandafter%
+ {\expandafter\pgf@decorate@temp\pgf@decorate@inputsegments@@temp}%
+ \def\pgf@decorate@test{#2}
+ \ifx\pgf@decorate@test\pgfutil@empty%
+ \def\pgf@decorate@next{%
+ \expandafter\pgf@decorate@inputsegmentobjects@reverse@pass@second\pgf@decorate@inputsegments@@temp\pgf@stop%
+ }%
+ \else%
+ \def\pgf@decorate@next{\pgf@decorate@inputsegments@@reverse@pass@first#2\pgf@stop}%
+ \fi%
+ \pgf@decorate@next%
+}
+\def\pgf@decorate@inputsegmentobjects@reverse@pass@second#1#2#3\pgf@stop{%
+ \def\pgf@decorate@inputsegments@temp{#3}%
+ \def\pgf@decorate@inputsegments@@temp{}%
+ \let\pgf@decorate@current@inputsegmentobject=\pgfutil@empty
+ \let\pgf@decorate@last@object=\pgfutil@empty
+ \pgf@decorate@inputsegmentobjects@reverse@moveto@waitingtrue%
+ \pgf@decorate@inputsegmentobjects@reverse@closepath@waitingfalse%
+ \expandafter\pgf@decorate@path@@reverse@pass@second\pgf@decorate@inputsegments@temp\pgf@stop}%
+
+
+\def\pgf@decorate@path@@reverse@pass@second#1{%
+ \ifx#1\pgf@stop%
+ \expandafter\def\expandafter\pgf@decorate@inputsegments@@temp\expandafter{%
+ \pgf@decorate@inputsegments@@temp%
+ {\pgf@decorate@inputsegmentobject@endofinputsegments}%
+ {\pgf@decorate@inputsegmentobject@endofinputsegments}
+ }%
+ \expandafter\let\pgf@decorate@path@storein=\pgf@decorate@inputsegments@@temp%
+ \let\pgf@decorate@next=\relax%
+ \else%
+ \ifx#1\pgf@decorate@inputsegmentobject@moveto%
+ \let\pgf@decorate@next=\pgf@decorate@inputsegmentobjects@reverse@moveto%
+ \else%
+ \ifx#1\pgf@decorate@inputsegmentobject@lineto%
+ \let\pgf@decorate@next=\pgf@decorate@inputsegmentobjects@reverse@lineto%
+ \else%
+ \ifx#1\pgf@decorate@inputsegmentobject@curveto%
+ \let\pgf@decorate@next=\pgf@decorate@inputsegmentobjects@reverse@curveto%
+ \else%
+ \ifx#1\pgf@decorate@inputsegmentobject@closepath%
+ \let\pgf@decorate@next=\pgf@decorate@inputsegmentobjects@reverse@closepath%
+ \else%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgf@decorate@next%
+}
+
+\newif\ifpgf@decorate@inputsegmentobjects@reverse@moveto@waiting
+
+\def\pgf@decorate@inputsegmentobjects@reverse@moveto#1{%
+ \ifpgf@decorate@inputsegmentobjects@reverse@closepath@waiting%
+ \edef\pgf@decorate@current@inputsegmentobject{%
+ {\noexpand\pgf@decorate@inputsegmentobject@closepath%
+ {\pgf@decorate@reverse@closepath@length}%
+ {\pgf@decorate@last}%
+ {#1}%
+ }%
+ }%
+ \pgf@decorate@inputsegmentobjects@reverse@closepath@waitingfalse%
+ \else%
+ \let\pgf@decorate@current@inputsegmentobject=\pgfutil@empty%
+ \fi%
+ \pgf@decorate@inputsegmentobjects@reverse@moveto@waitingtrue%
+ \pgf@decorate@path@@@reverse@pass@second%
+}
+
+\newif\ifpgf@decorate@inputsegmentobjects@reverse@closepath@waiting
+
+\def\pgf@decorate@inputsegmentobjects@reverse@closepath#1#2#3{%
+ \pgf@decorate@inputsegmentobjects@reverse@closepath@waitingtrue%
+ \def\pgf@decorate@reverse@closepath@length{#1}%
+ \def\pgf@decorate@current@inputsegmentobject{}%
+ \pgf@decorate@inputsegmentobjects@reverse@lineto{#1}{#2}{#3}%
+}
+
+\def\pgf@decorate@inputsegmentobjects@reverse@lineto#1#2#3#4{%
+ \ifpgf@decorate@inputsegmentobjects@reverse@moveto@waiting%
+ \def\pgf@decorate@current@inputsegmentobject{{\pgf@decorate@inputsegmentobject@moveto{#3}}}%
+ \pgf@decorate@inputsegmentobjects@reverse@moveto@waitingfalse%
+ \else%
+ \let\pgf@decorate@current@inputsegmentobject=\pgfutil@empty%
+ \fi%
+ \def\pgf@decorate@append@inputsegmentobject{{\pgf@decorate@inputsegmentobject@lineto{#1}{#3}{#2}}}%
+ \ifx#4\pgf@decorate@inputsegmentobject@moveto%
+ \ifpgf@decorate@inputsegmentobjects@reverse@closepath@waiting%
+ \def\pgf@decorate@append@inputsegmentobject{{\pgf@decorate@inputsegmentobject@closepath{#1}{#3}{#2}}}%
+ \pgf@decorate@inputsegmentobjects@reverse@closepath@waitingfalse%
+ \else%
+ \def\pgf@decorate@append@inputsegmentobject{{\pgf@decorate@inputsegmentobject@lineto{#1}{#3}{#2}}}%
+ \fi%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgf@decorate@current@inputsegmentobject\expandafter\expandafter\expandafter%
+ {\expandafter\pgf@decorate@current@inputsegmentobject\pgf@decorate@append@inputsegmentobject}
+ \def\pgf@decorate@last{#2}%
+ \pgf@decorate@path@@@reverse@pass@second#4%
+}
+
+\def\pgf@decorate@inputsegmentobjects@reverse@curveto#1#2#3#4#5{%
+ \ifpgf@decorate@inputsegmentobjects@reverse@moveto@waiting%
+ \def\pgf@decorate@current@inputsegmentobject{%
+ {\pgf@decorate@inputsegmentobject@moveto{#5}}%
+ {\pgf@decorate@inputsegmentobject@curveto{#1}{#5}{#4}{#3}{#2}}%
+ }%
+ \pgf@decorate@inputsegmentobjects@reverse@moveto@waitingfalse%
+ \else%
+ \def\pgf@decorate@current@inputsegmentobject{{\pgf@decorate@inputsegmentobject@curveto{#1}{#5}{#4}{#3}{#2}}}%
+ \fi%
+ \def\pgf@decorate@last{#2}%
+ \pgf@decorate@path@@@reverse@pass@second%
+}
+
+\def\pgf@decorate@path@@@reverse@pass@second{%
+ \ifx\pgf@decorate@current@inputsegmentobject\pgfutil@empty%
+ \else%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ \pgf@decorate@inputsegments@@temp\expandafter\expandafter\expandafter%
+ {\expandafter\pgf@decorate@inputsegments@@temp\pgf@decorate@current@inputsegmentobject}%
+ \fi%
+ \pgf@decorate@path@@reverse@pass@second%
+}%
+
+
+
+
+
\let\startpgfdecoration=\pgfdecoration
\let\stoppgfdecoration=\endpgfdecoration
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
index c808f60d762..32024c047d6 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmodulematrix.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmodulematrix.code.tex,v 1.4 2010/08/24 21:28:58 tantau Exp $
\usepgfmodule{shapes}
@@ -77,7 +77,7 @@
%
% Next, the whole resulting matrix, which is given as #7, is placed
% inside a node whose name is given as #3, whose shape is #1, and
-% whose anchor is #1. This means that the resulting node is shifted
+% whose anchor is #2. This means that the resulting node is shifted
% such that the given anchor lies at the origin. Then, as for a normal
% node, the #4 path usage command is used for the node.
%
@@ -159,6 +159,7 @@
\PackageError{pgf}{You cannot nest pgfmatrix environments, yet}{}
\fi%
\bgroup%
+ \everycr{}%
#6%
\def\pgf@matrix@par@shape{#1}%
\def\pgf@matrix@par@anchor{#2}%
@@ -360,6 +361,9 @@
% Step 4: Collect everything in a cell box
%
\setbox\pgf@matrix@cell=\hbox\bgroup\bgroup%
+ % make sure that cell pictures are not affected if matrizes have
+ % 'overlay' option on:
+ \pgf@relevantforpicturesizetrue
\pgfsys@beginpicture%
\normalbaselines%
% Find out whether the cell is empty:
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex
new file mode 100644
index 00000000000..e80d3ac06bb
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex
@@ -0,0 +1,451 @@
+% Copyright 2006 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleoo.code.tex,v 1.8 2010/02/22 22:49:21 tantau Exp $
+
+
+
+% Support of object-oriented programming in TeX.
+
+
+% The oo support works as follows:
+%
+% The main supported concepts are classes, objects, methods,
+% attributes and signal/slots. A class defines a set of methods, which are,
+% in the end, just normal TeX macros. Once a class has been created,
+% it can be instantiated by calling the \pgfoonew command, resulting
+% in a new object. Objects are local to their group. Given an object,
+% you can send it a message, resulting in the method code of the
+% object's method to be executed. While an object exists, it has a set
+% of attributes whose values can change over time. Attributes values
+% are not local to TeX groups, rather their life-cycle is the same as
+% the object's (which, however, is local to the group in which the
+% object was declared).
+%
+% The implementation is as follows: There is an ID counter that is
+% increased each time an object is created. This counter is local to
+% the group, which means that when a group ends the counter will
+% revert to the previous value, allowing objects to the reused in
+% subsequent groups.
+%
+% A method is just a normal \TeX macro, but to call it you write
+% \objecthandle.methodname(parameters). The \objecthandle is a macro
+% that is created when you say \pgfoonew. The special object
+% \pgfoothis is the current object.
+%
+% Attributes are stored globally in internal TeX macros whose name is
+% composed of the object number and the attribute name.
+
+
+
+
+% Declares a class
+%
+% #1 = class name
+% #2 = methods
+%
+% Description:
+%
+% This command declares a class for futurue use. Inside #2, the macro
+% \method can be used to declare a method. The \method macro takes a
+% method name, parameters (methods are normal TeX macros, after all)
+% and body.
+
+\long\def\pgfooclass#1#2{%
+ \def\pgfoo@classname{#1}%
+ \let\pgfoo@origmethod=\method%
+ \let\pgfoo@origattribute=\attribute%
+ \let\method=\pgfoo@declaremethod%
+ \let\attribute=\pgfoo@declareattribute%
+ \let\pgfoo@attribute@collection=\pgfutil@empty%
+ \let\pgfoo@attribute@collection@gc=\pgfutil@empty%
+ #2%
+ % Attribute initializer:
+ \expandafter\let\csname pgfooY\pgfoo@classname.@pgfooinit\endcsname\pgfoo@attribute@collection%
+ \expandafter\let\csname pgfooY\pgfoo@classname.@pgfoogc\endcsname\pgfoo@attribute@collection@gc%
+ % Always persent methods:
+ \expandafter\let\csname pgfooY\pgfoo@classname.get handle\endcsname\pgfoo@obj%
+ \expandafter\let\csname pgfooY\pgfoo@classname.get id\endcsname\pgfoo@id%
+ \let\method=\pgfoo@origmethod%
+ \let\attribute=\pgfoo@origattribute%
+}
+
+
+
+% Declare a method
+%
+% Description:
+%
+% Defines a method. To use/invoke this method for an object \object,
+% you write \object.methodname(parameters). This will cause the method
+% body to be invoked with the argument "(parameters)".
+%
+% To define the method \method should be directly followed by the
+% method name and, then, by (, followed by a parameter pattern,
+% followed by ), followed by the message body. Spaces are allowed only
+% after "\method" and after the closing ).
+%
+% Example:
+%
+% \pgfooclass{MyPlot}{
+%
+% \attribute x=0;
+% \attribute y=0;
+%
+% \method MyPlot() {
+% }
+%
+% \method getX(#1) {
+% \pgfooget{x}{#1}
+% }
+%
+% \method setPoint(#1,#2) {
+% \pgfooset{x}{#1}
+% \pgfooset{y}{#2}
+% }
+% }
+
+\def\pgfoo@declaremethod#1(#2)#3{%
+ \expandafter\long\expandafter\def\csname pgfooY\pgfoo@classname.#1\endcsname(#2){#3}%
+}
+
+
+% Declare an attribute
+%
+% #1 = attribute name
+% #2 = optional default value
+%
+% Description:
+%
+% Declares the attribute #1 for the current class. If the attribute
+% name is followed by =, the text following the equal sign is the
+% default value.
+
+\def\pgfoo@declareattribute#1;{%
+ \pgfutil@in@{ =}{#1}%
+ \ifpgfutil@in@%
+ \pgfoo@declareunpackspace#1;%
+ \else%
+ \pgfutil@in@={#1}%
+ \ifpgfutil@in@%
+ \pgfoo@declareunpack#1;%
+ \else%
+ \expandafter\def\expandafter\pgfoo@attribute@collection\expandafter{\pgfoo@attribute@collection\pgfoolet{#1}\pgfutil@empty}%
+ \expandafter\def\expandafter\pgfoo@attribute@collection@gc\expandafter{\pgfoo@attribute@collection@gc\pgfoolet{#1}\relax}%
+ \fi%
+ \fi%
+}
+\def\pgfoo@declareunpack#1=#2;{%
+ \expandafter\def\expandafter\pgfoo@attribute@collection\expandafter{\pgfoo@attribute@collection\pgfooset{#1}{#2}}%
+ \expandafter\def\expandafter\pgfoo@attribute@collection@gc\expandafter{\pgfoo@attribute@collection@gc\pgfoolet{#1}\relax}%
+}
+\def\pgfoo@declareunpackspace#1 =#2;{%
+ \expandafter\def\expandafter\pgfoo@attribute@collection\expandafter{\pgfoo@attribute@collection\pgfooset{#1}{#2}}%
+ \expandafter\def\expandafter\pgfoo@attribute@collection@gc\expandafter{\pgfoo@attribute@collection@gc\pgfoolet{#1}\relax}%
+}
+
+
+\newcount\pgfoo@objectcount
+\newcount\pgfoothis@count
+
+% The attribute value method
+%
+% #1 = attr
+%
+% This method inserts the current value of the given attribute for the
+% current object.
+
+\def\pgfoovalueof#1{%
+ \csname pgfooX\the\pgfoothis@count @#1\endcsname%
+}
+
+
+% The attribute get method
+%
+% #1 = attr
+% #2 = macro
+%
+% This method makes the macro equal to the current value of the
+% attribute for the current object.
+
+\def\pgfooget#1#2{%
+ \expandafter\let\expandafter#2\csname pgfooX\the\pgfoothis@count @#1\endcsname%
+}
+
+
+% The attribute set method
+%
+% #1 = attr
+% #2 = value
+%
+% This method sets the given attribute for the current object to the
+% given value.
+
+\long\def\pgfooset#1#2{%
+ \expandafter\gdef\csname pgfooX\the\pgfoothis@count @#1\endcsname{#2}%
+}
+
+
+% The attribute set method (expanded version)
+%
+% #1 = attr
+% #2 = value
+%
+% This method sets the given attribute for the current object to the
+% expanded version of the given value.
+
+\long\def\pgfooeset#1#2{%
+ \expandafter\xdef\csname pgfooX\the\pgfoothis@count @#1\endcsname{#2}%
+}
+
+
+% The attribute let method
+%
+% #1 = attr
+% #2 = value
+%
+% This method sets the given attribute for the current object to the
+% given value using \let.
+
+\def\pgfoolet#1#2{%
+ \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @#1\endcsname#2%
+}
+
+
+% Add something to an attribute at the end
+%
+% #1 = attr
+% #2 = code
+%
+% This method adds the give code to the attr at the end.
+
+\def\pgfooappend#1#2{%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@oo@temp\expandafter\expandafter\expandafter{\csname pgfooX\the\pgfoothis@count @#1\endcsname#2}%
+ \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @#1\endcsname\pgf@oo@temp%
+}
+
+
+% Add something to an attribute at the beginning
+%
+% #1 = attr
+% #2 = code
+%
+% This method adds the give code to the attr at the beginning.
+
+\def\pgfooprefix#1#2{%
+ \pgfooget{#1}\pgf@oo@temp%
+ \def\pgf@oo@@temp{#2}%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@oo@temp%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@oo@@temp\pgf@oo@temp}%
+ \pgfoolet{#1}\pgf@oo@temp%
+}
+
+
+
+% Instantiate an object
+%
+% Possible syntax:
+%
+% 1) \pgfoonew new <class name>(<constructor parameters)
+% 2) \pgfoonew \<objectname>=new <class name>(<constructor parameters)
+% 3) \pgfoonew{attribute}=new <class name>(<constructor parameters)
+%
+% Description:
+%
+% Creates an object. After the object has been created, the method
+% called <class name> (the constructor) is invoked. If the
+% \<objectname>= part is present, the macro is assigned to the newly
+% created object.
+
+\def\pgfoonew{%
+ \pgfutil@ifnextchar n{%
+ \pgfoo@new\pgfoo@dummy=%
+ }{%
+ \pgfutil@ifnextchar\bgroup{%
+ \pgfoo@new@attribute%
+ }{%
+ \pgfoo@new%
+ }%
+ }%
+}
+\def\pgfoo@new#1=new #2(#3){%
+ \expandafter\ifx\csname pgfooY#2.get id\endcsname\relax%
+ \PackageError{pgfoo}{Unknown class '#2'}{}%
+ \else%
+ \advance\pgfoo@objectcount by 1\relax%
+ \edef\pgfoolastobj{\noexpand\pgfoo@caller{\the\pgfoo@objectcount}}%
+ \expandafter\gdef\csname pgfooX\the\pgfoo@objectcount @class\endcsname{#2}%
+ \let#1\pgfoolastobj%
+ {%
+ \pgfoothis@count\pgfoo@objectcount%
+ \csname pgfooY\csname pgfooX\the\pgfoothis@count @class\endcsname.@pgfooinit\endcsname%
+ }%
+ \pgfoolastobj.#2(#3)%
+ \aftergroup\pgfoogc% cleanup after group
+ \fi%
+}
+\def\pgfoo@new@attribute#1=new #2(#3){%
+ \pgfoo@new\pgf@oo@temp=new #2(#3)%
+ \pgfoolet{#1}\pgf@oo@temp%
+}
+
+
+\def\pgfoo@caller#1.#2(#3){%
+ \def\pgf@marshal{%
+ \pgfoothis@count=#1\relax%
+ \csname pgfooY\csname pgfooX\the\pgfoothis@count @class\endcsname.#2\endcsname(#3)%
+ }%
+ \expandafter\pgf@marshal\expandafter\pgfoothis@count\the\pgfoothis@count\relax%
+}
+\let\pgfoo@orig@caller=\pgfoo@caller
+
+% The special "this" object
+
+\def\pgfoothis.#1(#2){%
+ \csname pgfooY\csname pgfooX\the\pgfoothis@count @class\endcsname.#1\endcsname(#2)%
+}
+
+
+
+
+
+% Get the object id
+%
+% #1 = macro to store the id
+%
+% Description:
+%
+% This special method allows you to access the object id. You can then
+% use \pgfoocall to call a method using this id. This is mainly useful
+% when you wish to store the id for a longer time.
+
+\def\pgfoo@id(#1){%
+ \edef#1{\the\pgfoothis@count}%
+}
+
+% Yields the object with the given id
+%
+% #1 = id
+%
+% Description:
+%
+% Given an object id, \pgfooobj{<id>} will yield the object having
+% this id.
+
+\def\pgfooobj#1{%
+ \pgfoo@caller{#1}%
+}
+
+
+% Get the object
+%
+% #1 = macro to store the object
+%
+% Description:
+%
+% This special method allows you to get a new handle to a given
+% object. If \obj is an object, you could normally just say
+% \let#1=\obj. However, if \obj happens to be \pgfoothis, then you may
+% wish to get a handle to the object itself, not to the special macro
+% \pgfoothis. In this case you can say \obj.get handle(#1).
+
+\def\pgfoo@obj(#1){%
+ \edef#1{\noexpand\pgfoo@caller{\the\pgfoothis@count}}%
+}
+
+
+
+% The garbage collector
+%
+% Description:
+%
+% This method frees space ocupied by unused objects. Garbage are
+% objects that have been destroyed because of the end of the scope in
+% which they were created. In this case, however, the memory used by
+% this object is not immediately reused because the attributes of the
+% object are actually stored in global variables. When the garbage
+% collector is called, it will set all these global variables to
+% \relax, thereby ensuring that no memory is needed for them.
+
+\def\pgfoogc{%
+ {%
+ % We do this in a group...
+ \pgfoothis@count\pgfoo@objectcount% this is temporary...
+ \let\pgfoo@next=\pgfoo@dogc%
+ \pgfoo@next%
+ }%
+}
+\def\pgfoo@dogc{%
+ \advance\pgfoothis@count by 1\relax%
+ \expandafter\ifx\csname pgfooX\the\pgfoothis@count @class\endcsname\relax%
+ \let\pgfoo@next=\relax%
+ \else%
+ % Cleanup this object:
+ % The following is the fast version of \pgfooobj{\the\pgfoo@objectcount}.@pgfoogc:
+ \csname pgfooY\csname pgfooX\the\pgfoothis@count @class\endcsname.@pgfoogc\endcsname%
+ \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @class\endcsname\relax%
+ \fi%
+ \pgfoo@next%
+}
+
+
+
+
+%
+%
+% Signal class
+%
+%
+
+\pgfooclass{signal}
+{
+ %
+ % This class implements signals.
+ %
+ % After you have created a signal object, you can call
+ % connect to connect a slot. Then, whenever the emit method is
+ % called, all connected methods get called.
+
+ % Attribute
+ \attribute emitter;
+ % Collects the objects that should be called.
+
+ % Constructor
+ \method signal() {}
+
+ % Connect a slot (method) #2 of object #1
+ \method connect(#1,#2) {%
+ {%
+ #1.get id(\pgf@tempid)%
+ % Save in emmiter
+ \pgfooget{emitter}\pgf@temp%
+ \let\pgfoo@signal@call=\relax% avoid expansion
+ \edef\pgf@temp{\pgf@temp\pgfoo@signal@call{\pgf@tempid}{#2}}%
+ \pgfoolet{emitter}\pgf@temp%
+ }%
+ }
+
+ \def\pgfoo@signal@call#1#2{%
+ \def\pgf@temp{\pgfooobj{#1}.#2}%
+ \expandafter\pgf@temp\expandafter(\pgfoo@signal@args)%
+ }
+
+ % Emit a signal
+ \method emit(#1) {%
+ \def\pgfoo@signal@args{#1}%
+ \pgfoovalueof{emitter}
+ }
+}
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex
new file mode 100644
index 00000000000..ed13b25324c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex
@@ -0,0 +1,111 @@
+% Copyright 2009 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleparser.code.tex,v 1.1 2009/01/12 12:56:09 tantau Exp $
+
+%
+% This file defines commands for defining a letter-by-letter parser
+% based on a dfa.
+%
+
+
+
+
+% Parse the following text
+%
+% #1 = parser
+%
+% Description:
+%
+% This command starts the parser #1 in the initial state "initial". It
+% will parse the following text, stopping when the state "final" has
+% been reached.
+
+\def\pgfparserparse#1{%
+ \def\pgf@parser{#1}%
+ \def\pgf@parser@state{initial}%
+ \pgf@parser@parse%
+}
+\def\pgf@parser@parse{%
+ \futurelet\pgf@parser@symbol\pgf@parser@cont%
+}
+\def\pgf@parser@cont{%
+ % Ok, defined?
+ \expandafter\let\expandafter\pgf@parser@action%
+ \csname pgf@parser@a@\pgf@parser @\pgf@parser@state @\meaning\pgf@parser@symbol\endcsname%
+ \ifx\pgf@parser@action\relax%
+ \expandafter\let\expandafter\pgf@parser@action%
+ \csname pgf@parser@a@\pgf@parser @all@\meaning\pgf@parser@symbol\endcsname%
+ \ifx\pgf@parser@action\relax%
+ \PackageError{pgfparse}{Unexpected character
+ '\meaning\pgf@parser@symbol' in parser '\pgf@parser' in state
+ '\pgf@parser@state'}{}%
+ \fi%
+ \fi%
+ \pgf@parser@action%
+ \ifx\pgf@parser@symbol\pgfutil@sptoken%
+ \expandafter\pgf@parser@rid@space%
+ \else%
+ \expandafter\pgf@parser@rid@other%
+ \fi%
+}
+
+\def\pgf@parser@ridded{%
+ \ifx\pgf@parser@state\pgf@parser@final@text%
+ % done
+ \else%
+ \expandafter\pgf@parser@parse%
+ \fi%
+}
+
+\def\pgf@parser@final@text{final}
+
+{%
+ \def\:{\pgf@parser@rid@space} \expandafter\gdef\: {\futurelet\pgf@parser@ignore\pgf@parser@ridded}
+ \gdef\pgf@parser@rid@other{\afterassignment\pgf@parser@ridded\let\pgf@parser@ignore=}
+}
+
+
+
+% Switches the state
+%
+% #1 = new state
+%
+% Description:
+%
+% This command can be used inside a state action to switch to a
+% different state.
+
+\def\pgfparserswitch#1{\def\pgf@parser@state{#1}}
+
+
+
+
+% Defines an action to be taken in a state for some symbol
+%
+% #1 = parser
+% #2 = state
+% #3 = symbol text (result of saying \meaning on the symbol)
+% #4 = action
+%
+% Description:
+%
+% When the parser encounters #3 while being in state #2, then code #4
+% is executed.
+%
+% When #2 is set to the special text "all", then the symbol is handled
+% in all states by #4, except when a state defines something special
+% for this symbol
+
+\def\pgfparserdef#1#2#3#4{%
+ \expandafter\def\csname pgf@parser@a@#1@#2@#3\endcsname{#4}
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
index 5e7a703fd37..ea55ca8517b 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleplot.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleplot.code.tex,v 1.8 2010/10/22 17:34:17 ludewich Exp $
% PGF's plotting interface works as follows:
@@ -33,7 +33,7 @@
% \pgfplotstreamend
%
% By themselves, the \pgfplotstreamxxxx commands do not do anything by
-% default. Rather, the ``use'' such a stream, you must first install a
+% default. Rather, to ``use'' such a stream, you must first install a
% stream handler. For example, the ``lineto'' handler will simply
% translate every \pgfplotstreampoint into a \pgfpathlineto.
%
@@ -118,6 +118,29 @@
+% This handler turns creates a series of lineto commands, with the
+% last command being a closepath, resulting in a closed path.
+%
+% Example:
+%
+% \pgfplothandlerpolygon
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlerpolygon{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@line@handler@close%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfpathclose%
+ }%
+}
+
+\def\pgf@plot@line@handler@close#1{%
+ \pgfpathmoveto{#1}%
+ \global\let\pgf@plotstreampoint=\pgfpathlineto%
+}
+
+
+
% More handlers are defined in pgflibraryplothandlers
@@ -187,8 +210,8 @@
\def\pgfplotxyfile#1{%
\begingroup%
\pgfplotstreamstart%
- \openin1=#1
- \ifeof1
+ \openin\r@pgf@reada=#1
+ \ifeof\r@pgf@reada
\PackageWarning{pgf}{Plot data file `#1' not found.}
\else
\catcode`\#=14
@@ -201,7 +224,7 @@
\let\pgf@savedpar=\par%
\def\pgf@partext{\par}
\def\pgf@readxyfile{%
- \read1 to \pgf@temp%
+ \pgfutil@read\r@pgf@reada to \pgf@temp%
\let\par=\pgf@savedpar%
\edef\pgf@temp{\pgf@temp}%
\ifx\pgf@temp\pgfutil@empty%
@@ -209,7 +232,7 @@
\else%
\expandafter\pgf@parsexyline\pgf@temp\pgf@stop%
\fi\fi%
- \ifeof1\else\expandafter\pgf@readxyfile\fi%
+ \ifeof\r@pgf@reada\else\expandafter\pgf@readxyfile\fi%
}
\def\pgf@parsexyline#1 #2 #3\pgf@stop{%
@@ -236,8 +259,8 @@
\def\pgfplotxyzfile#1{%
\begingroup%
\pgfplotstreamstart%
- \openin1=#1
- \ifeof1
+ \openin\r@pgf@reada=#1
+ \ifeof\r@pgf@reada
\PackageWarning{pgf}{Plot data file `#1' not found.}
\else
\catcode`\#=14
@@ -248,13 +271,13 @@
}
\def\pgf@readxyzfile{%
- \read1 to \pgf@temp%
+ \pgfutil@read\r@pgf@reada to \pgf@temp%
\ifx\pgf@temp\pgfutil@empty%
\else\ifx\pgf@temp\pgf@partext%
\else%
\expandafter\pgf@parsexyzline\pgf@temp\pgf@stop%
\fi\fi%
- \ifeof1\else\expandafter\pgf@readxyzfile\fi%
+ \ifeof\r@pgf@reada\else\expandafter\pgf@readxyzfile\fi%
}
\def\pgf@parsexyzline#1 #2 #3 #4\pgf@stop{%
@@ -285,38 +308,58 @@
{
\catcode`\%=12
\catcode`\"=12
- \xdef\pgf@gnuplot@head#1{set terminal table; set output "#1.table"; set format "%.5f"}
+ \xdef\pgf@gnuplot@head{set table \noexpand\pgf@plottablefile@quoted; set format "%.5f"}
}
-\newwrite\pgf@plotwrite
+\let\pgf@plotwrite=\w@pgf@writea
\newif\ifpgf@resample@plot
\def\pgfplotgnuplot{\pgfutil@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%}
\def\pgf@plotgnuplot[#1]#2{%
\pgf@resample@plottrue%
+ \pgfutilpreparefilename{#1.gnuplot}%
+ \let\pgf@plotgnuplotfile=\pgfretval
+ \pgfutilpreparefilename{#1.table}%
+ \let\pgf@plottablefile=\pgfretval
+ \let\pgf@plottablefile@quoted=\pgfretvalquoted
% Check, whether it is up-to-date
- \openin\pgfutil@inputcheck=#1.gnuplot
+ \openin\pgfutil@inputcheck=\pgf@plotgnuplotfile\relax
\ifeof\pgfutil@inputcheck%
\else%
- \read\pgfutil@inputcheck to\pgf@temp% ignored
- \read\pgfutil@inputcheck to\pgf@plot@line%
+ \pgfutil@read\pgfutil@inputcheck to\pgf@temp% ignored
+ \pgfutil@read\pgfutil@inputcheck to\pgf@plot@line%
+ \closein\pgfutil@inputcheck
\edef\pgf@plot@code{#2\space}%
\ifx\pgf@plot@code\pgf@plot@line%
- \openin\pgfutil@inputcheck=#1.table
+ \openin\pgfutil@inputcheck=\pgfretval\relax
\ifeof\pgfutil@inputcheck%
\else%
+ \closein\pgfutil@inputcheck
\pgf@resample@plotfalse%
\fi%
\fi%
\fi
\ifpgf@resample@plot%
- \immediate\openout\pgf@plotwrite=#1.gnuplot
- \immediate\write\pgf@plotwrite{\pgf@gnuplot@head{#1}}%
- \immediate\write\pgf@plotwrite{#2}%
+ \immediate\openout\pgf@plotwrite=\pgf@plotgnuplotfile\relax
+ \immediate\pgfutil@write\pgf@plotwrite{\pgf@gnuplot@head}%
+ \immediate\pgfutil@write\pgf@plotwrite{#2}%
\immediate\closeout\pgf@plotwrite%
- \immediate\write18{gnuplot #1.gnuplot}
+ \immediate\pgfutil@write18{gnuplot \pgf@plotgnuplotfile}%
+ \fi%
+ % temporarily redefine \pgf@parsexyline
+ \let\pgf@savedparsexyline=\pgf@parsexyline%
+ \let\pgf@parsexyline=\pgf@parsegnuplotxyline%
+ \pgfplotxyfile{\pgf@plottablefile}%
+ \let\pgf@parsexyline=\pgf@savedparsexyline%
+}
+
+\def\pgf@parsegnuplotxyline#1 #2 #3\pgf@stop{%
+ \edef\pgf@xyline@flag@val{#3}%
+ \edef\pgf@xyline@flag@undef{u\space}%
+ \ifx\pgf@xyline@flag@val\pgf@xyline@flag@undef%
+ \else%
+ \pgfplotstreampoint{\pgfpointxy{#1}{#2}}%
\fi%
- \pgfplotxyfile{#1.table}
}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
index 63f6bf5be9b..da75b3e2e43 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleshapes.code.tex,v 1.4 2008/02/13 15:10:06 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmoduleshapes.code.tex,v 1.13 2010/09/09 13:52:57 cjorssen Exp $
@@ -43,6 +43,7 @@
{%
\let\pgf@sh@savedmacros=\pgfutil@empty% MW
\let\pgf@sh@savedpoints=\pgfutil@empty%
+ \def\shape@name{#1}% CJ
\csname pgf@sh@s@#1\endcsname%
\pgf@sh@savedpoints%
\pgf@sh@savedmacros% MW
@@ -52,20 +53,30 @@
\pgf@y=-\pgf@y%
}%
\expandafter\pgfsavepgf@process\csname pgf@sh@sa@#3\endcsname{%
- \pgf@sh@reanchor{#1}{#2}%
+ \pgf@sh@reanchor{#1}{#2}% FIXME : this is double work!
}%
% Save the saved points and the transformation matrix
- \edef\pgf@test{#3}%
- \ifx\pgf@test\pgfutil@empty%
+ \edef\pgf@node@name{#3}%
+ \ifx\pgf@positionnodelater@macro\relax%
\else%
- \expandafter\xdef\csname pgf@sh@ns@#3\endcsname{#1}%
- \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@np@#3\endcsname}%
+ % Rename node
+ \edef\pgf@node@name{not yet positioned@\pgf@node@name}%
+ % Interrupt bounding box!
+ \pgfinterruptboundingbox%
+ % Put everything in our box:
+ \setbox\pgfpositionnodelaterbox=\hbox\bgroup%
+ %
+ \fi%
+ \ifx\pgf@node@name\pgfutil@empty%
+ \else%
+ \expandafter\xdef\csname pgf@sh@ns@\pgf@node@name\endcsname{#1}%
+ \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@np@\pgf@node@name\endcsname}%
\expandafter\pgf@sh@@temp\expandafter{\pgf@sh@savedpoints}%
- \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@ma@#3\endcsname}% MW
+ \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@ma@\pgf@node@name\endcsname}% MW
\expandafter\pgf@sh@@temp\expandafter{\pgf@sh@savedmacros}% MW
\pgfgettransform\pgf@temp
- \expandafter\xdef\csname pgf@sh@nt@#3\endcsname{\pgf@temp}%
- \expandafter\xdef\csname pgf@sh@pi@#3\endcsname{\pgfpictureid}%
+ \expandafter\xdef\csname pgf@sh@nt@\pgf@node@name\endcsname{\pgf@temp}%
+ \expandafter\xdef\csname pgf@sh@pi@\pgf@node@name\endcsname{\pgfpictureid}%
\fi%
\pgfutil@ifundefined{pgf@sh@bbg@#1}{}
{{\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope}}%
@@ -87,7 +98,18 @@
{\csname pgf@sh@fg@#1\endcsname#4}%
\pgfutil@ifundefined{pgf@sh@ffg@#1}{}%
{{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}%
- \pgf@nodecallback{#3}%
+ \ifx\pgf@positionnodelater@macro\relax%
+ \expandafter\pgf@nodecallback\expandafter{\pgf@node@name}%
+ \else%
+ \egroup% Close box
+ \edef\pgfpositionnodelaterminx{\the\pgf@picminx}%
+ \edef\pgfpositionnodelaterminy{\the\pgf@picminy}%
+ \edef\pgfpositionnodelatermaxx{\the\pgf@picmaxx}%
+ \edef\pgfpositionnodelatermaxy{\the\pgf@picmaxy}%
+ \let\pgfpositionnodelatername=\pgf@node@name%
+ \pgf@positionnodelater@macro%
+ \endpgfinterruptboundingbox%
+ \fi%
}%
}%
}
@@ -144,6 +166,109 @@
}
}
+
+
+% Create a node that is positioned later
+%
+% #1 = macro to be called after the next node has been created
+%
+% Description:
+%
+% You can use this command to create a node that is "positioned
+% later". The idea is the following: Normally, when a node is created
+% using a command like \pgfnode, the node is immediately inserted into
+% the current picture. In particular, you have no chance to change the
+% position of a created node after it has been create.
+%
+% Using \pgfpositionnodelater, you can change the default
+% behaviour. This command is not a replacement for \pgfnode, but is
+% called before such a command and will cause the following to happen:
+% The node is created, but not inserted into the picture. Instead, it
+% is stored in the box \pgfpositionnodelaterbox. Furthermore, the node
+% is not relevant for the picture's bounding box, but a bounding box
+% for the node is computed and stored in the macros
+% \pgfpositionnodelaterboundboxminx to
+% \pgfpositionnodelaterboundboxmaxy. Finally, the
+% macro #1 is called with the following macros setup:
+%
+% \pgfpositionnodelaterbox
+% A box register (box 0 by default) that stores the node's paths and
+% texts. You should move the contents of this box to a box of your
+% choice.
+%
+% \pgfpositionnodelatername
+% The name of the just-created-node. This name will be the
+% originally "desired" name of the box plus the prefix "not yet
+% positioned box@".
+%
+% \pgfpositionnodelaterminx
+% \pgfpositionnodelatermaxx
+% \pgfpositionnodelaterminy
+% \pgfpositionnodelatermaxy
+% These four macros store the bounding box as dimensions that are
+% guarenteed to end with "pt".
+%
+% By setting #1 to \relax (which is the default), you can switch off
+% the whole mechanism
+%
+% Once a late node has been created, you can add arbitrary code in the
+% same picture. Then, at some later point, you call
+% \pgfpositionnodenow to finally position the node at a given position.
+%
+% When \pgfpositionnodenow is called, the macros mentioned above
+% should have the exact same values they had when #1 is called.
+
+\def\pgfpositionnodelater#1{\let\pgf@positionnodelater@macro=#1\relax}
+\pgfpositionnodelater{\relax}
+\def\pgfpositionnodelaterbox{0}
+
+
+% Position a node that has been scheduled for later insertion
+%
+% #1 = position in the picture, where the original anchor should go,
+% now
+%
+% Description:
+%
+% This command works in concert with \pgfpositionnodelater, see the
+% description there. When \pgfpositionnodenow is called, the macros
+% \pgfpositionnodelaterbox and so one should be set to the values they
+% had when the macro given to \pgfpositionnodelater was called. Then,
+% the box described by these macros will be inserted into the picture
+% at the position given #1. More precisely, the original node will
+% have been positioned such that the anchor given upon invocation is
+% at (0,0) and the node is now shifted by #1 before being inserted
+% into the actual picture.
+
+\def\pgfpositionnodenow#1{%
+ {%
+ \pgfpointtransformed{#1}%
+ \edef\pgf@temp@shift{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \pgftransformreset%
+ \pgftransformshift{\pgf@temp@shift}%
+ \setbox\pgfpositionnodelaterbox=\hbox{\pgfsys@beginpicture\box\pgfpositionnodelaterbox\pgfsys@endpicture}%
+ \pgfqboxsynced{\pgfpositionnodelaterbox}%
+ \pgf@shift@node{\pgfpositionnodelatername}{\pgf@temp@shift}%
+ % Bounding box update...
+ \pgfpointtransformed{\pgfqpoint{\pgfpositionnodelaterminx}{\pgfpositionnodelaterminy}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}
+ \pgfpointtransformed{\pgfqpoint{\pgfpositionnodelatermaxx}{\pgfpositionnodelatermaxy}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}
+ % Naming and callbacks
+ \expandafter\pgfpositionnodenow@rename\pgfpositionnodelatername\relax%
+ }%
+}
+
+\def\pgfpositionnodenow@rename not yet positioned@#1\relax{%
+ \pgfnoderename{#1}{not yet positioned@#1}
+ \pgf@nodecallback{#1}%
+}
+
+
+
+
+
+
% Alias a node
%
% #1 = new node name
@@ -165,12 +290,68 @@
\pgf@node@gnamelet{pgf@sh@nt@#1}{pgf@sh@nt@#2}%
\pgf@node@gnamelet{pgf@sh@pi@#1}{pgf@sh@pi@#2}%
\pgf@node@gnamelet{pgf@sh@ma@#1}{pgf@sh@ma@#2}%
+ \pgf@nodecallback{#1}%
}
\def\pgf@node@gnamelet#1#2{%
\expandafter\let\expandafter\pgf@temp\csname #2\endcsname%
\expandafter\global\expandafter\let\csname #1\endcsname=\pgf@temp%
}
+% Rename a node
+%
+% #1 = new name
+% #2 = old name
+%
+% Description:
+%
+% Renames a node. This is like an alias, only the memory used for the
+% old name is freed.
+
+\def\pgfnoderename#1#2{%
+ \pgfnodealias{#1}{#2}%
+ \expandafter\global\expandafter\let\csname pgf@sh@ns@#2\endcsname\relax
+ \expandafter\global\expandafter\let\csname pgf@sh@np@#2\endcsname\relax
+ \expandafter\global\expandafter\let\csname pgf@sh@nt@#2\endcsname\relax
+ \expandafter\global\expandafter\let\csname pgf@sh@pi@#2\endcsname\relax
+ \expandafter\global\expandafter\let\csname pgf@sh@ma@#2\endcsname\relax
+}
+
+
+% Quickly create a coordinate node
+%
+% #1 = name
+% #2 = coordinate
+%
+% Description:
+%
+% Creates a node of shape coordinate. The following have the same
+% effect, only the second is much faster:
+%
+% { \pgftransformshift{\pgfpoint{1cm}{2cm} \pgfnode{coordinate}{center}{}{foo}{} }
+% \pgfcoordinate{foo}{\pgfpoint{1cm}{2cm}}
+
+\def\pgfcoordinate#1#2{%
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty% do nothing
+ \else%
+ \pgf@process{\pgfpointtransformed{#2}}%
+ \expandafter\gdef\csname pgf@sh@ns@#1\endcsname{coordinate}%
+ \expandafter\xdef\csname pgf@sh@np@#1\endcsname{%
+ \noexpand\def\noexpand\centerpoint{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ }
+ \expandafter\gdef\csname pgf@sh@nt@#1\endcsname{{1}{0}{0}{1}{0pt}{0pt}}%
+ \expandafter\global\expandafter\let\csname pgf@sh@ma@#1\endcsname\pgfutil@empty%
+ \expandafter\gdef\csname pgf@sh@pi@#1\endcsname{\pgfpictureid}%
+ \fi%
+}
+
+\def\pgf@sh@redeferredanchor#1#2{% CJ
+ \expandafter\gdef\csname pgf@anchor@\shape@name @#1\endcsname{#2}}% CJ
+
+
+
+
+
\def\pgf@sh@resavedanchor#1#2{%
\pgf@process{#2}%
@@ -191,14 +372,12 @@
\pgf@sh@marshal%
}
-% MW
-\newtoks\toks@savedmacro
\def\pgf@sh@resavedmacro#1#2{%
\let#1\pgfutil@empty%
\def\addtosavedmacro##1{%
\expandafter\def\expandafter\pgf@sh@addtomacro@temp\expandafter{#1\noexpand\def\noexpand##1{##1}}%
- \expandafter\toks@savedmacro\expandafter{\pgf@sh@addtomacro@temp}%
- \expandafter\def\expandafter#1\expandafter{\the\toks@savedmacro}%
+ {\expandafter\pgfutil@toks@\expandafter{\pgf@sh@addtomacro@temp}\expandafter}%
+ \expandafter\def\expandafter#1\expandafter{\the\pgfutil@toks@}%
}%
#2\relax%
\edef\pgf@sh@marshal{%
@@ -212,12 +391,31 @@
\def\pgf@sh@reanchor#1#2{%
\pgfutil@ifundefined{pgf@anchor@#1@#2}%
{%
- \pgfmathsetcounter{pgf@counta}{#2}%
- \csname pgf@anchor@#1@border\endcsname{\pgfqpointpolar{\c@pgf@counta}{1pt}}%
+ \pgfutil@ifundefined{pgf@anchor@generic@#2}{%
+ \pgfmathsetcounter{pgf@counta}{#2}%
+ \csname pgf@anchor@#1@border\endcsname{\pgfqpointpolar{\c@pgf@counta}{1pt}}%
+ }{%
+ \csname pgf@anchor@generic@#2\endcsname{#1}%
+ }%
}%
{\csname pgf@anchor@#1@#2\endcsname}%
}
+% Defines a generic anchor, i.e. one which gets the associated shape
+% as first argument.
+%
+% #1: the anchor name.
+% #2: the code of the anchor. It may depend upon '##1', the shape's
+% name.
+%
+% The anchor will be defined locally in the current TeX scope.
+%
+% If the anchor will be referenced later by \pgfpointanchor, the macro \pgfreferencednodename
+% can be used to query the referenced node's name.
+% This macro is not defined during node creation.
+\def\pgfdeclaregenericanchor#1#2{%
+ \expandafter\def\csname pgf@anchor@generic@#1\endcsname##1{#2}%
+}%
% Retrieves an anchor of a shape
@@ -241,6 +439,7 @@
\pgfpointorigin}%
{%
\pgf@process{%
+ \edef\pgfreferencednodename{#1}% for use inside of anchors.
% MW install special macros
\csname pgf@sh@ma@#1\endcsname% MW
% install special coordinates
@@ -305,6 +504,7 @@
\pgfpointorigin}%
{%
\pgf@process{%
+ \edef\pgfreferencednodename{#1}% for use inside of anchors.
% MW install special macros
\csname pgf@sh@ma@#1\endcsname% MW
% install special coordinates
@@ -409,6 +609,7 @@
\let\savedanchor=\pgf@sh@savedanchor
\let\saveddimen=\pgf@sh@saveddimen
\let\savedmacro=\pgf@sh@savedmacro% MW
+ \let\deferredanchor=\pgf@sh@deferredanchor% CJ
\let\anchor=\pgf@sh@anchor
\let\anchorborder=\pgf@sh@anchorborder
\let\behindbackgroundpath=\pgf@sh@behindbgpath
@@ -443,6 +644,9 @@
\def\pgf@sh@savedmacro#1#2{% MW
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedmacro{#1}{#2}}}% MW
\def\pgf@sh@anchor#1#2{\expandafter\gdef\csname pgf@anchor@\shape@name @#1\endcsname{#2}}
+\def\pgf@sh@deferredanchor#1#2{% CJ
+ \expandafter\pgfutil@g@addto@macro
+ \csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@redeferredanchor{#1}{#2}}}% CJ
\def\pgf@sh@anchorborder#1{\expandafter\gdef\csname pgf@anchor@\shape@name @border\endcsname##1{\pgf@process{##1}#1}}
\long\def\pgf@sh@behindbgpath#1{\expandafter\gdef\csname pgf@sh@bbg@\shape@name\endcsname{#1}}
\long\def\pgf@sh@bgpath#1{\expandafter\gdef\csname pgf@sh@bg@\shape@name\endcsname{#1}}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex
new file mode 100644
index 00000000000..b85fde14501
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex
@@ -0,0 +1,69 @@
+% Copyright 2008 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmodulesorting.code.tex,v 1.1 2008/11/12 23:39:37 tantau Exp $
+
+%
+% This file defines commands for sorting data. This is useful for 3d plots,
+% but also for drawing things in the correct order.
+%
+
+
+\newcount\pgfsortingbuckets
+
+
+% Init the sorting
+%
+% #1 = number of buckets
+%
+% Description:
+%
+% This macro inits a sorting. At any time there can be only one active
+% sorting. When you init the sorting, #1 should be a number of
+% buckets. You can then call \pgfsortinginsert to insert code into the
+% buckets. Once you are done, calling \pgfsortingexecute will execute
+% first the code in buckets 0, then the code in bucket 1, and so on to
+% bucket number #1-1.
+%
+\def\pgfsortinginit#1{
+ \pgfsortingbuckets#1\relax%
+ \c@pgf@counta=0\relax
+ \pgfutil@loop
+ \ifnum\c@pgf@counta<\c@pgf@countb\relax%
+ \expandafter\global\expandafter\let\csname pgf@sort@\the\c@pgf@counta\endcsname\pgfutil@empty%
+ \advance\c@pgf@counta by1\relax%
+ \pgfutil@repeat
+}
+
+% Insert code into some bucket
+%
+% #1 = the bucket
+% #2 = the code
+%
+\def\pgfsortinginsert#1#1{
+ \expandafter\let\expandafter\pgf@temp\csname pgf@lib@sort@#1\endcsname%
+ \expandafter\def\expandafter\pgf@temp\expandafter{\pgf@temp#2}%
+ \expandafter\global\expandafter\let\csname pgf@lib@sort@\the\c@pgf@counta\endcsname\pgf@temp%
+}
+
+
+% After all code has been inserted into the buckets, you can call
+% this method to execute the code in the order of the buckets.
+\def\pgfsortingexecute{
+ \c@pgf@countb=\pgfoovalueof{buckets}\relax
+ \c@pgf@counta=0\relax
+ \pgfutil@loop
+ \ifnum\c@pgf@counta<\c@pgf@countb\relax%
+ \csname pgf@lib@sort@\the\c@pgf@counta\endcsname%
+ \advance\c@pgf@counta by1\relax%
+ \pgfutil@repeat
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex
new file mode 100644
index 00000000000..48d36bae8bf
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex
@@ -0,0 +1,138 @@
+% Copyright 2006 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/rendering/pgfrenderpoints.code.tex,v 1.2 2007/03/09 17:49:33 tantau Exp $
+
+
+
+
+
+% Create a 3D point
+%
+% #1 = macro name in which the point object should be stored
+% #2 to #4 = x-, y- and z-coordinate of the point
+%
+% Note:
+%
+% The quick version does not call \setlength and is faster.
+%
+% Example:
+%
+% \pgfrenderpointcreate{\pgfpoint{2pt+3cm}{3cm}}
+
+\def\pgfrenderpointcreate#1#2#3#4{%
+ \pgfmathsetlength\pgf@xa{#2}%
+ \pgfmathsetlength\pgf@xb{#3}%
+ \pgfmathsetlength\pgf@xc{#4}%
+ \pgfqrenderpointcreate{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}%
+}
+
+\def\pgfqrenderpointcreate#1#2#3#4{%
+ \edef#1{\pgf@xa=#2\relax\pgf@xb=#3\pgf@xc=#4\relax}%
+}
+
+\def\pgf@render@unpack#1{%
+ #1%
+}
+
+
+% The origin point object
+%
+% Description:
+%
+% This object is always the origin.
+%
+
+\pgfqrenderpointcreate\pgfrenderobjorigin{0pt}{0pt}{0pt}
+
+
+
+
+% Add two 3D vectors
+%
+% #1 = name of new vector (may be one of the input)
+% #2 = name of first vector
+% #3 = name of second vector
+%
+% Description:
+%
+% The points #2 and #3 are added and the result is stored in #1. If #1
+% equals either #2 or #3, to point is overwritten.
+%
+% Example:
+%
+% \pgfrenderpointcreate{\myvec}{1cm}{2cm}{3cm}
+% \pgfrenderpointcreate{\offset}{1cm}{0cm}{0cm}
+% \pgfrenderpointadd{\myvec}{\myvec}{\offset}
+
+\def\pgfrenderpointadd#1#2#3{%
+ \pgf@render@unpack#2%
+ \pgf@ya=\pgf@xa%
+ \pgf@yb=\pgf@xb%
+ \pgf@yc=\pgf@xc%
+ \pgf@render@unpack#3%
+ \advance\pgf@xa by\pgf@ya%
+ \advance\pgf@xb by\pgf@yb%
+ \advance\pgf@xc by\pgf@yc%
+ \pgfqrenderpointcreate#1{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}%
+}
+
+
+% Scale a 3D vectors
+%
+% #1 = name of new vector (may be one of the input)
+% #2 = scale
+% #3 = name of vector to be scaled
+%
+% Description:
+%
+% Sets #1 := #2*#3.
+%
+% Example:
+%
+% \pgfrenderpointcreate{\myvec}{1cm}{2cm}{3cm}
+% \pgfrenderpointscale{\myvec}{2}{\myvec}
+
+\def\pgfrenderpointscale#1#2#3{%
+ \pgf@render@unpack#3%
+ \pgf@xa=#2\pgf@xa%
+ \pgf@xb=#2\pgf@xb%
+ \pgf@xc=#2\pgf@xc%
+ \pgfqrenderpointcreate#1{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}%
+}
+
+
+
+
+% Project a 3D point to 2D
+%
+% #1 = 3D point object
+%
+% Description:
+%
+% This command takes a 3D point object and sets \pgf@x to the x-value
+% of the point and \pgf@y to the y-value.
+%
+% Example:
+%
+% \pgfpointprojection{\mypoint}
+
+\def\pgfpointprojection#1{%
+ \pgf@render@unpack{#1}%
+ \pgf@x=\pgf@xa%
+ \pgf@y=\pgf@ya%
+}
+
+
+
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/rendering/pgfrendertransform.code.tex b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrendertransform.code.tex
new file mode 100644
index 00000000000..fb6802e9f1c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrendertransform.code.tex
@@ -0,0 +1,117 @@
+% Copyright 2006 by Till Tantau
+%
+% 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/rendering/pgfrendertransform.code.tex,v 1.1 2006/11/12 14:18:46 tantau Exp $
+
+
+
+
+% Create a 3D transformation matrix
+%
+% #1 = macro name in which the transformation matrix should be stored
+% #2 = three comma-separated numbers, representing the first line of
+% the matrix.
+% #3 = three numbers, representing the second line of the matrix.
+% #4 = three numbers, representing the thrid line of the matrix.
+% #5 = 3D point object, used for the offset.
+%
+% Example:
+%
+% \pgfrendertransformcreate{\mymatrix}{1,0,0}{0,1,0}{0,0,1}{\pgfrenderobjorigin}
+
+\def\pgfrendertransformcreate#1#2#3#4#5{%
+ \pgf@render@unpack#5%
+ \edef#1{{#2}{#3}{#4}{\pgf@xa=\the\pgf@xa\pgf@xb=\the\pgf@xb\pgf@xc=\the\pgf@xc}}%
+}
+
+
+
+% Apply a 3D transformation matrix to a 3D point
+%
+% #1 = new point (may be the old point) (#1 := #2*#3)
+% #2 = transformation matrix object
+% #3 = point to be transformed
+%
+% Example:
+%
+% \pgfrendertransform{\newvec}{\mymatrix}{\oldvec}
+
+\def\pgfrendertransform#1#2#3{%
+ \pgf@render@unpack#3%
+ \expandafter\pgf@rendertransform#2%
+ \pgf@xa=\pgf@ya%
+ \pgf@xb=\pgf@yb%
+ \pgf@xc=\pgf@yc%
+}
+
+\def\pgf@rendertransform#1#2#3#4{%
+ \pgf@@rendertransform\pgf@ya#1\relax%
+ \pgf@@rendertransform\pgf@yb#2\relax%
+ \pgf@@rendertransform\pgf@yc#3\relax%
+ #4%
+ \advance\pgf@ya by \pgf@xa%
+ \advance\pgf@yb by \pgf@xb%
+ \advance\pgf@yc by \pgf@xc%
+}
+
+\def\pgf@@rendertransform#1#2,#3,#4\relax{%
+ #1=#2\pgf@xa%
+ \advance#1by#3\pgf@xb%
+ \advance#1by#4\pgf@xc%
+}
+
+
+
+% Concatenate two 3D transformation matrices
+%
+% #1 = new matrix, (#1 := #2*#3)
+% #2 = first matrix
+% #3 = second matrix
+%
+% Example:
+%
+% \pgfrendertransformconcat{\mymatrix}{\rotationmatrix}{\mymatrix}
+
+\def\pgfrendertransformconcat#1#2#3{%
+ \expandafter\pgf@render@extract@columns#3%
+ \pgfrendertransform\pgf@render@temp@a#2\pgf@render@temp@a%
+ \pgfrendertransform\pgf@render@temp@b#2\pgf@render@temp@b%
+ \pgfrendertransform\pgf@render@temp@c#2\pgf@render@temp@c%
+ \pgfrendertransform\pgf@render@temp@d#2\pgf@render@temp@d%
+ \pgf@render@unpack\pgf@render@temp@a%
+ \edef\pgf@temp@a{\pgf@sys@tonumber\pgf@xa}%
+ \edef\pgf@temp@b{\pgf@sys@tonumber\pgf@xb}%
+ \edef\pgf@temp@c{\pgf@sys@tonumber\pgf@xc}%
+ \pgf@render@unpack\pgf@render@temp@b%
+ \edef\pgf@temp@a{\pgf@temp@a,\pgf@sys@tonumber\pgf@xa}%
+ \edef\pgf@temp@b{\pgf@temp@b,\pgf@sys@tonumber\pgf@xb}%
+ \edef\pgf@temp@c{\pgf@temp@c,\pgf@sys@tonumber\pgf@xc}%
+ \pgf@render@unpack\pgf@render@temp@c%
+ \edef\pgf@temp@a{\pgf@temp@a,\pgf@sys@tonumber\pgf@xa}%
+ \edef\pgf@temp@b{\pgf@temp@b,\pgf@sys@tonumber\pgf@xb}%
+ \edef\pgf@temp@c{\pgf@temp@c,\pgf@sys@tonumber\pgf@xc}%
+ \pgfrendertransformcreate#1{\pgf@temp@a}{\pgf@temp@b}{\pgf@temp@c}{\pgf@render@temp@c}%
+}
+
+\def\pgf@render@extract@columns#1#2#3#4{%
+ \pgf@@render@extract@columns#1,#2,#3\relax%
+ \def\pgf@render@temp@d{#4}%
+}
+
+\def\pgf@@render@extract@columns#1,#2,#3,#4,#5,#6,#7,#8,#9\relax{%
+ \pgfqrenderpointcreate\pgf@render@temp@a{#1pt}{#4pt}{#7pt}%
+ \pgfqrenderpointcreate\pgf@render@temp@b{#2pt}{#5pt}{#8pt}%
+ \pgfqrenderpointcreate\pgf@render@temp@c{#3pt}{#6pt}{#9pt}%
+}
+
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
index 659b541c539..38b32e39b57 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
@@ -7,16 +7,23 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.6 2008/01/13 15:30:04 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.7 2008/05/14 22:01:48 tantau Exp $
-% Default driver:
-\ifx\pgfsysdriver\@undefined
- \edef\pgfsysdriver{pgfsys-\Gin@driver}
-\fi
+% Copy this file to somewhere local and uncomment one of the following
+% if you do not trust/use/like the automatic driver selection
+% algorithms:
-
-% Uncomment the following if you use dvipdfm and plain tex:
+% \def\pgfsysdriver{pgfsys-dvi.def}
% \def\pgfsysdriver{pgfsys-dvipdfm.def}
+% \def\pgfsysdriver{pgfsys-dvipdfmx.def}
+% \def\pgfsysdriver{pgfsys-dvips.def}
+% \def\pgfsysdriver{pgfsys-pdftex.def}
+% \def\pgfsysdriver{pgfsys-tex4ht.def}
+% \def\pgfsysdriver{pgfsys-textures.def}
+% \def\pgfsysdriver{pgfsys-vtex.def}
+% \def\pgfsysdriver{pgfsys-xetex.def}
+
+% Alternatively, use one of the above commands in your own files.
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
index 03c1821639f..5cbf2fd66ca 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
@@ -7,63 +7,81 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def,v 1.4 2008/02/05 10:25:36 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def,v 1.7 2008/05/19 12:52:49 tantau Exp $
% Common driver commands for all drivers that produce pdf via the
% detour of a dvi file
-\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}}
+
+
+% Hboxes
\def\pgfsys@hbox#1{%
- \special{pdf: content Q q -1 0 0 -1 0 0 cm q}%
+ \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
\special{pdf: content -1 0 0 -1 0 0 cm 3 Tr q}% translate to
% original coordinate system and do
% not show anything
{\hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}}% enforce font change
- \special{pdf: content Q 0 Tr q}% end of font change enforcement.
+ \pgfsys@invoke{0 Tr}%
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\box#1
- \special{pdf: content Q n Q}%
+ \pgfsys@invoke{n Q Q}%
}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \pgfsys@beginscope%
+ \setbox\pgf@hbox=\hbox{%
+ \hskip\pgf@pt@x%
+ \raise\pgf@pt@y\hbox{%
+ \pgf@pt@x=0pt%
+ \pgf@pt@y=0pt%
+ \special{pdf: content q}%
+ \pgflowlevelsynccm%
+ \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
+ \special{pdf: content -1 0 0 -1 0 0 cm q}% translate to original coordinate system
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \box#1%
+ \pgfsys@invoke{n Q Q Q}%
+ }%
+ \hss%
+ }%
+ \wd\pgf@hbox=0pt%
+ \ht\pgf@hbox=0pt%
+ \dp\pgf@hbox=0pt%
+ \pgfsys@hbox\pgf@hbox%
+ \pgfsys@endscope%
+ }%
+}
+
\def\pgfsys@beginpicture{%
- \special{pdf: content Q 3 Tr q}% do not show anything
+ \pgfsys@invoke{3 Tr}%
\hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
- \special{pdf: content Q 0 Tr q}% end of font change enforcement.
+ \pgfsys@invoke{0 Tr}%
\special{pdf: content q}}
\def\pgfsys@endpicture{%
- \special{pdf: content n Q}%
+ \pgfsys@invoke{n Q}%
}
\def\pgfsys@beginpurepicture{\special{pdf: content q}}
-\def\pgf@sys@pdf@addtopageresources@extgs#1{%
- \ifx\pgf@sys@pdf@obj\@undefined%
- \global\let\pgf@sys@pdf@obj=\relax%
- \special{pdf: obj @pgfopacities << >>}% <<
- \fi%
- \special{pdf: put @pgfopacities << #1 >>}% <<
- \special{pdf: put @resources << /ExtGState @pgfopacities >>}% <<
-}
-\def\pgf@sys@pdf@readdtopageresources@extgs#1{%
- \special{pdf: put @resources << /ExtGState @pgfopacities >>}% <<
-}
-
\def\pgfsys@imagesuffixlist{.pdf:.jpg:.jpeg:.png:}
\def\pgfsys@horishading#1#2#3{%
{%
\pgf@parsefunc{#3}%
\pgf@process{\pgfpoint{\pgf@max}{#2}}%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@max\space height \the\pgf@y}}}\@temp%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources <<
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@max\space height \the\pgf@y}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 2
/ColorSpace /DeviceRGB
/Domain [\pgf@pdfparseddomain]
/Coords [\pgf@doma\space0 \pgf@domb\space0]
/Function \pgf@pdfparsedfunction
/Extend [false false] >> >> >>}}}\@temp% <<
- \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
\expandafter\xdef\csname @pgfshading#1!\endcsname{%
\hbox to\the\pgf@max{\vbox to#2{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
@@ -73,15 +91,15 @@
{%
\pgf@parsefunc{#3}%
\pgf@process{\pgfpoint{\pgf@max}{#2}}%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@y\space height \the\pgf@max\space}}}\@temp%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources <<
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@y\space height \the\pgf@max\space}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 2
/ColorSpace /DeviceRGB
/Domain [\pgf@pdfparseddomain]
/Coords [0 \pgf@doma\space0 \pgf@domb]
/Function \pgf@pdfparsedfunction
/Extend [false false] >> >> >>}}}\@temp% <<
- \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
\expandafter\xdef\csname @pgfshading#1!\endcsname{%
\hbox to#2{\vbox to\the\pgf@max{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
@@ -101,42 +119,21 @@
\pgf@sys@bp@correct{\pgf@xa}%
\pgf@sys@bp@correct{\pgf@ya}%
\pgfutil@tempdima=2\pgf@max\relax%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp%
- \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources <<
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 3
/ColorSpace /DeviceRGB
/Domain [\pgf@pdfparseddomain]
/Coords [\pgf@sys@tonumber{\pgf@xa} \pgf@sys@tonumber{\pgf@ya} \pgf@doma\space \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@y} \pgf@domb]
/Function \pgf@pdfparsedfunction
/Extend [true false] >> >> >>}}}\@temp% <<
- \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
\expandafter\xdef\csname @pgfshading#1!\endcsname{%
\hbox to\the\pgfutil@tempdima{\vbox to\the\pgfutil@tempdima{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
}%
}%
-% The following is an ugly hack. We need something like
-% "everyshipout".
-% But it should be ultra-portable...
-\def\pgf@sys@atbeginpage#1{\AtBeginDvi{#1}}
-\AtBeginDocument{% hack for old hyperref
- \ifx\Hy@begindvi\@undefined%
- \let\pgf@sys@continue@hyper=\pgfutil@empty%
- \else%
- \pgf@sys@test@hyper%
- \fi%
- \def\@begindvi{\unvbox\@begindvibox\pgf@sys@continue@hyper}
-}
-
-\def\pgf@sys@test@hyper{%
- \ifHy@implicit%
- \let\pgf@sys@continue@hyper=\Hy@begindvi%
- \else%
- \let\pgf@sys@continue@hyper=\HyPL@EveryPage%
- \fi%
-}
-
\def\pgf@sys@pdf@dvi@tracker{
\def\pgfsys@markposition##1{%
\pdfsavepos%
@@ -154,6 +151,61 @@
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
}
+
+
+%
+% Resource management
+%
+
+\newif\ifpgf@sys@pdf@colorspaces@exists
+\newif\ifpgf@sys@pdf@patterns@exists
+\newif\ifpgf@sys@pdf@extgs@exists
+\newif\ifpgf@sys@pdf@colorspaces@created
+\newif\ifpgf@sys@pdf@patterns@created
+\newif\ifpgf@sys@pdf@extgs@created
+\newif\ifpgf@sys@pdf@any@resources
+
+\def\pgf@sys@setuppdfresources@plain{%
+ % This command will setup pdf resource in plain and in latex
+ % mode. ConTeXt has its own handler
+ \pgfutil@insertatbegineverypage{%
+ \pgf@sys@pdf@any@resourcesfalse%
+ \ifpgf@sys@pdf@extgs@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@extgs@created \else \special{pdf: obj @pgfextgs <<>>} \global\pgf@sys@pdf@extgs@createdtrue \fi% <<
+ \fi%
+ \ifpgf@sys@pdf@colorspaces@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@colorspaces@created \else \special{pdf: obj @pgfcolorspaces <<>>} \global\pgf@sys@pdf@colorspaces@createdtrue \fi% <<
+ \fi%
+ \ifpgf@sys@pdf@patterns@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@patterns@created \else \special{pdf: obj @pgfpatterns <<>>} \global\pgf@sys@pdf@patterns@createdtrue \fi% <<
+ \fi%
+ \ifpgf@sys@pdf@any@resources%
+ \special{pdf: put @resources <<
+ \ifpgf@sys@pdf@extgs@exists /ExtGState @pgfextgs \fi
+ \ifpgf@sys@pdf@patterns@exists /Pattern @pgfpattern \fi
+ \ifpgf@sys@pdf@colorspaces@exists /ColorSpace @pgfcolorspaces \fi
+ >>}% <<
+ \fi%
+ }
+ \def\pgf@sys@addpdfresource@extgs@plain##1{%
+ \global\pgf@sys@pdf@extgs@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfextgs << ##1 >>}}% <<
+ }
+ \def\pgf@sys@addpdfresource@colorspaces@plain##1{%
+ \global\pgf@sys@pdf@colorspaces@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfcolorspaces << ##1 >>}}% <<
+ }
+ \def\pgf@sys@addpdfresource@patterns@plain##1{%
+ \global\pgf@sys@pdf@patterns@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfpatterns << ##1 >>}}% <<
+ }
+}
+\pgfutil@setuppdfresources % possibly call the above
+
+
\endinput
%%% Local Variables:
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
index 3a88a236de5..c48d1c15238 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
@@ -7,11 +7,12 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf.def,v 1.8 2007/12/17 14:52:31 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf.def,v 1.10 2008/05/19 12:52:49 tantau Exp $
% Common driver commands for all drivers that produce pdf
+
% Path construction:
\def\pgfsys@lineto#1#2{\pgf@sys@bp{#1}\pgf@sys@bp{#2}\pgfsysprotocol@literal{l}}
\def\pgfsys@moveto#1#2{\pgf@sys@bp{#1}\pgf@sys@bp{#2}\pgfsysprotocol@literal{m}}
@@ -60,15 +61,11 @@
\def\pgfsys@color@gray@fill#1{\pgfsysprotocol@literal{#1 g}}
% Opacity
-\def\pgf@sys@pdf@addtopageresources@extgs#1{\pgf@sys@fail{adding to page resources}}
-\def\pgf@sys@pdf@readdtopageresources@extgs#1{}% not always used
\def\pgfsys@stroke@opacity#1{%
\expandafter\ifx\csname pgf@sys@pdf@so@#1\endcsname\relax%
% Hmm... define...
\expandafter\gdef\csname pgf@sys@pdf@so@#1\endcsname{/pgf@CA#1}%
- \pgf@sys@pdf@addtopageresources@extgs{/pgf@CA#1 << /CA #1 >>}%
- \else%
- \pgf@sys@pdf@readdtopageresources@extgs{/pgf@CA#1 << /CA #1 >>}%
+ \pgfutil@addpdfresource@extgs{/pgf@CA#1 << /CA #1 >>}%<<
\fi%
\pgfsysprotocol@literal{\csname pgf@sys@pdf@so@#1\endcsname\space gs}%
}
@@ -76,9 +73,7 @@
\expandafter\ifx\csname pgf@sys@pdf@fo@#1\endcsname\relax%
% Hmm... define...
\expandafter\gdef\csname pgf@sys@pdf@fo@#1\endcsname{/pgf@ca#1}%
- \pgf@sys@pdf@addtopageresources@extgs{/pgf@ca#1 << /ca #1 >>}%
- \else%
- \pgf@sys@pdf@readdtopageresources@extgs{/pgf@ca#1 << /ca #1 >>}%
+ \pgfutil@addpdfresource@extgs{/pgf@ca#1 << /ca #1 >>}%<<
\fi%
\pgfsysprotocol@literal{\csname pgf@sys@pdf@fo@#1\endcsname\space gs}%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
index 75d06305bb1..52e0ef9b224 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.18 2008/02/07 19:25:41 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.22 2008/10/01 14:19:33 tantau Exp $
% Driver commands for postscript
@@ -263,7 +263,8 @@
{
\pgf@sys@tonumber{\pgf@xa} 1 \pgf@sys@tonumber{\pgf@xb}
{ 1 index 2 copy pgfproc setrgbcolor moveto 1.1 0 rlineto stroke }
- for
+ for
+ pop
}
for
}%
@@ -292,7 +293,8 @@
\pgf@sys@bp@correct\pgf@yb%
\pgf@sys@bp@correct\pgf@xc%
\pgf@sys@bp@correct\pgf@yc%
- \pgfsys@outerinvoke{
+ \edef\pgf@sys@marshal{%
+ \noexpand\pgfutil@insertatbegincurrentpage{\noexpand\pgfsys@outerinvoke{
save true setglobal globaldict begin /pgfpat#1
{
\ifnum#9=0 [/Pattern /DeviceRGB] \else /Pattern \fi\space
@@ -316,7 +318,9 @@
grestore
setcolor
} bind def end restore
- }% <<
+ }}% <<
+ }%
+ \pgf@sys@marshal%
}
\def\pgfsys@setpatternuncolored#1#2#3#4{%
@@ -354,7 +358,7 @@
/pgfdiff 8 index round cvi 8 index round cvi sub 2 mul 1 add def
2 index 6 index sub pgfdiff div % put red-step on stack
2 index 6 index sub pgfdiff div % put green-step on stack
- 2 index 6 index sub pgfdiff div % put green-step on stack
+ 2 index 6 index sub pgfdiff div % put blue-step on stack
pgfheight 9 index 9 index 9 index 14 index
pgfdiff {
3 index 3 index 3 index setrgbcolor % Set color
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
index fdf16a61210..fa1cf889bd4 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-svg.def,v 1.20 2008/02/07 19:25:41 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-svg.def,v 1.21 2009/03/20 10:31:30 tantau Exp $
% Driver commands for svg
@@ -19,8 +19,8 @@
{%
\pgf@x=#1\relax%
\edef\temp{\expandafter\Pgf@geT\the\pgf@x\space}%
- \toks@\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svgpath\temp}%
- \xdef\pgf@sys@svgpath{\the\toks@}%
+ \pgfutil@toks@\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svgpath\temp}%
+ \xdef\pgf@sys@svgpath{\the\pgfutil@toks@}%
}%
}
\def\pgf@sys@addtosvgpath#1{\pgfutil@g@addto@macro\pgf@sys@svgpath{#1\space}}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
index 16edebc350b..4124784d999 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfm.def,v 1.18 2007/12/17 14:52:31 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfm.def,v 1.19 2008/05/14 16:05:56 tantau Exp $
% Driver commands for dvipdfm
@@ -21,6 +21,7 @@
% dvipdfm-specific stuff:
%
+\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}} % ugly, but necessary...
%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
index 57ccbab304d..b9669434a4a 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
@@ -7,21 +7,409 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfmx.def,v 1.1 2008/02/05 10:57:46 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfmx.def,v 1.3 2009/05/22 07:25:48 jinhwancho Exp $
-% Driver commands for dvipdfm
+% Driver commands for dvipdfmx
+%
+% Modified by Jin-Hwan Cho <chofchof@ktug.or.kr> on April 18, 2009.
+% This driver requires the version DVIPDFMX-20080605 that is contained
+% in texlive 2008 or later.
%
% Load common pdf and pdf in dvi commands:
%
\input pgfsys-common-pdf.def
-\input pgfsys-common-pdf-via-dvi.def
+% For unique object name:
+\newcount\pgfsys@objnum\pgfsys@objnum\@ne
+
+% `pdf:code' is an abbreviation of `pdf:literal direct', the idea of which
+% came from pdfTeX's primitive \pdfliteral direct.
+\def\pgfsys@invoke#1{\special{pdf:code #1}}
+
+% If color is changed by \pgfsys@invoke explicitly, the color
+% optimization routine in dvipdfmx does not work correctly
+% because the routine checks color specials only. For example,
+%
+% \special{color push 0}\pgfsys@invoke{1 g 1 G}\special{color push 0}
%
-% dvipdfm-specific stuff:
+% the last color special will be ignored the optimization routine
+% thinks that the color has changed to the same color.
+% To avoid this problem, we need to change the color temporarily to another.
%
+% We assume that black is the default color when no color is specified.
+\def\start@force@reset@color{%
+ \special{pdf:bcolor [1]}%
+ \special{pdf:bcolor [0]}%
+}
+\def\stop@force@reset@color{%
+ \special{pdf:ecolor}%
+ \special{pdf:ecolor}%
+}
+
+% We cannot use many codes in pgfsys-common-pdf-via-dvi.def.
+% So it is rewritten here (with some bugs fixed).
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \pgfsys@beginscope%
+ \setbox\pgf@hbox=\hbox{%
+ \hskip\pgf@pt@x%
+ \raise\pgf@pt@y\hbox{%
+ \pgf@pt@x=0pt%
+ \pgf@pt@y=0pt%
+ % The order of `pdf:bcontent' is important here. It should be
+ % followed by \pgflowlevelsynccm, not reverse order.
+ \special{pdf:bcontent}%
+ \pgflowlevelsynccm%
+ \start@force@reset@color%
+ \pgfsys@hbox#1%
+ \stop@force@reset@color%
+ \special{pdf:econtent}}%
+ \hss%
+ }%
+ \wd\pgf@hbox=0pt%
+ \ht\pgf@hbox=0pt%
+ \dp\pgf@hbox=0pt%
+ \box\pgf@hbox%
+ \pgfsys@endscope%
+ }%
+}
+
+% All text materials between `pdf:bcontent' and `pdf:econtent' are
+% treated in the relative coordinate.
+\def\pgfsys@beginpicture{\special{pdf:bcontent}}
+\def\pgfsys@endpicture{\special{pdf:econtent}}
+
+\def\pgfsys@imagesuffixlist{.pdf:.jpg:.jpeg:.png:.bmp:}
+
+% Shaidng came from pgfsys-pdftex.def
+\def\pgfsys@horishading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \pgfmathparse{#2}%
+ \pgf@process{\pgfpoint{\pgf@max}{#2}}%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgfshade\the\pgfsys@objnum\space width \the\pgf@max\space height \pgfmathresult pt}%
+ \special{pdf:put @resources
+ <<
+ /Shading << /Sh << /ShadingType 2
+ /ColorSpace /DeviceRGB
+ /Domain [\pgf@pdfparseddomain]
+ /Coords [\pgf@doma\space0 \pgf@domb\space0]
+ /Function \pgf@pdfparsedfunction
+ /Extend [false false] >> >>
+ >>}%
+ \pgfsys@invoke{/Sh sh}%
+ \special{pdf:exobj}}}\@tempa% <<
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+ \hbox to\the\pgf@max{\vbox to\pgfmathresult pt{\vfil\special{pdf:uxobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+}
+\def\pgfsys@vertshading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \pgfmathparse{#2}%
+ \pgf@process{\pgfpoint{\pgf@max}{#2}}%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgfshade\the\pgfsys@objnum\space width \pgfmathresult pt\space height \the\pgf@max}%
+ \special{pdf:put @resources
+ <<
+ /Shading << /Sh << /ShadingType 2
+ /ColorSpace /DeviceRGB
+ /Domain [\pgf@pdfparseddomain]
+ /Coords [0 \pgf@doma\space0 \pgf@domb]
+ /Function \pgf@pdfparsedfunction
+ /Extend [false false] >> >>
+ >>}%
+ \pgfsys@invoke{/Sh sh}%
+ \special{pdf:exobj}}}\@tempa% <<
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+ \hbox to\pgfmathresult pt{\vbox to\the\pgf@max{\vfil\special{pdf:uxobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+}
+\def\pgfsys@radialshading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \pgf@process{#2}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgfpoint{\pgf@max}{\pgf@max}}%
+ \advance\pgf@xa by \pgf@x%
+ \advance\pgf@ya by \pgf@y%
+ \pgf@sys@bp@correct{\pgf@x}%
+ \pgf@sys@bp@correct{\pgf@y}%
+ \pgf@sys@bp@correct{\pgf@xa}%
+ \pgf@sys@bp@correct{\pgf@ya}%
+ \pgfutil@tempdima=2\pgf@max%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgfshade\the\pgfsys@objnum\space width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}%
+ \special{pdf:put @resources
+ <<
+ /Shading << /Sh << /ShadingType 3
+ /ColorSpace /DeviceRGB
+ /Domain [\pgf@pdfparseddomain]
+ /Coords [\pgf@sys@tonumber{\pgf@xa} \pgf@sys@tonumber{\pgf@ya} \pgf@doma\space \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@y} \pgf@domb]
+ /Function \pgf@pdfparsedfunction
+ /Extend [true false] >> >>
+ >>}%
+ \pgfsys@invoke{/Sh sh}%
+ \special{pdf:exobj}}}\@tempa% <<
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+ \hbox to\the\pgfutil@tempdima{\vbox to\the\pgfutil@tempdima{\vfil\special{pdf:uxobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+}
+\def\pgfsys@functionalshading#1#2#3#4{%
+ {%
+ \pgf@process{#2}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#3}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \pgf@sys@bp@correct{\pgf@xa}%
+ \pgf@sys@bp@correct{\pgf@ya}%
+ \pgf@sys@bp@correct{\pgf@xb}%
+ \pgf@sys@bp@correct{\pgf@yb}%
+ \pgf@xc=-\pgf@xa%
+ \pgf@yc=-\pgf@ya%
+ % Now build the function
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:stream @pgfstream\the\pgfsys@objnum\space({#4}) <</FunctionType 4
+ /Domain [\pgf@sys@tonumber{\pgf@xa}\space\pgf@sys@tonumber{\pgf@xb}\space\pgf@sys@tonumber{\pgf@ya}\space\pgf@sys@tonumber{\pgf@yb}]
+ /Range [0 1 0 1 0 1]>>}}}\@tempa%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgfshade\the\pgfsys@objnum\space width \the\pgf@x\space height \the\pgf@y}%
+ \special{pdf:put @resources <</Shading <</Sh <</ShadingType 1
+ /ColorSpace /DeviceRGB
+ /Matrix [1 0 0 1 \pgf@sys@tonumber{\pgf@xc}\space\pgf@sys@tonumber{\pgf@yc}]
+ /Domain [\pgf@sys@tonumber{\pgf@xa}\space\pgf@sys@tonumber{\pgf@xb}\space\pgf@sys@tonumber{\pgf@ya}\space\pgf@sys@tonumber{\pgf@yb}]
+ /Function @pgfstream\the\pgfsys@objnum>> >> >>}%
+ \pgfsys@invoke{/Sh sh}%
+ \special{pdf:exobj}}}\@tempa% <<
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+ \leavevmode\hbox to\the\pgf@x{\vbox to\the\pgf@y{\vfil\special{pdf:uxobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+}
+% \pgf@sys@pdf@dvi@tracker was not touched!
+\def\pgf@sys@pdf@dvi@tracker{
+ \def\pgfsys@markposition##1{%
+ \pdfsavepos%
+ \edef\pgf@temp{##1}%
+ \expandafter\write\expandafter\pgfutil@auxout\expandafter{%
+ \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pdflastxpos}{\the\pdflastypos}}%
+ }
+ \def\pgfsyspdfmark##1##2##3{%
+ \expandafter\gdef\csname pgf@sys@pdf@mark@pos@##1\endcsname{\pgfqpoint{##2sp}{##3sp}}%
+ }
+ \def\pgfsys@getposition##1##2{%
+ \edef\pgf@marshal{\let\noexpand##2=\expandafter\noexpand\csname pgf@sys@pdf@mark@pos@##1\endcsname}%
+ \pgf@marshal%
+ }
+ \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
+}
+
+% Resource management: bugs were fixed.
+\newif\ifpgf@sys@pdf@colorspaces@exists
+\newif\ifpgf@sys@pdf@patterns@exists
+\newif\ifpgf@sys@pdf@extgs@exists
+\newif\ifpgf@sys@pdf@colorspaces@created
+\newif\ifpgf@sys@pdf@patterns@created
+\newif\ifpgf@sys@pdf@extgs@created
+\newif\ifpgf@sys@pdf@any@resources
+
+\def\pgf@sys@setuppdfresources@plain{%
+ % This command will setup pdf resource in plain and in latex
+ % mode. ConTeXt has its own handler
+ \pgfutil@insertatbegineverypage{%
+ \pgf@sys@pdf@any@resourcesfalse%
+ \ifpgf@sys@pdf@extgs@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@extgs@created\else\special{pdf:obj @pgfextgs <<>>}\global\pgf@sys@pdf@extgs@createdtrue\fi% <<
+ \fi%
+ \ifpgf@sys@pdf@colorspaces@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@colorspaces@created\else\special{pdf:obj @pgfcolorspaces <<>>}\global\pgf@sys@pdf@colorspaces@createdtrue\fi% <<
+ \fi%
+ \ifpgf@sys@pdf@patterns@exists%
+ \pgf@sys@pdf@any@resourcestrue%
+ \ifpgf@sys@pdf@patterns@created\else\special{pdf:obj @pgfpatterns <<>>}\global\pgf@sys@pdf@patterns@createdtrue\fi% <<
+ \fi%
+ \ifpgf@sys@pdf@any@resources%
+ \special{pdf:put @resources
+ <<
+ \ifpgf@sys@pdf@extgs@exists /ExtGState @pgfextgs \fi
+ \ifpgf@sys@pdf@patterns@exists /Pattern @pgfpatterns \fi
+ \ifpgf@sys@pdf@colorspaces@exists /ColorSpace @pgfcolorspaces \fi
+ >>}% <<
+ \fi%
+ }
+ \def\pgf@sys@addpdfresource@extgs@plain##1{%
+ \global\pgf@sys@pdf@extgs@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf:put @pgfextgs << ##1 >>}}% <<
+ }
+ \def\pgf@sys@addpdfresource@colorspaces@plain##1{%
+ \global\pgf@sys@pdf@colorspaces@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf:put @pgfcolorspaces << ##1 >>}}% <<
+ }
+ \def\pgf@sys@addpdfresource@patterns@plain##1{%
+ \global\pgf@sys@pdf@patterns@existstrue%
+ \pgfutil@insertatbegincurrentpage{\special{pdf:put @pgfpatterns << ##1 >>}}% <<
+ }
+}
+\pgfutil@setuppdfresources % possibly call the above
+
+% As pgfsys-pdftex.def, the following code is required
+% to give colors on pattern objects.
+\pgfutil@addpdfresource@colorspaces{ /pgfprgb [/Pattern /DeviceRGB] }
+
+% Image Mask came from pgfsys-pdftex.def
+% generic/pgf/basiclayer/pgfcoreimage.code.tex must be modified!
+\def\pgfsys@defineimage{% width, height, page number
+ \ifx\includegraphics\relax
+ \ifx\pgf@imagewidth\pgfutil@empty\edef\pgf@imagewidth{1bp}\fi% width?
+ \ifx\pgf@imageheight\pgfutil@empty\edef\pgf@imageheight{1bp}\fi% height?
+ \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepage{ page \pgf@imagepage}\fi%
+ \ifx\pgf@imageinterpolate\pgfutil@empty\else\edef\pgf@imageinterpolate{ /Interpolate\space\pgf@imageinterpolate}\fi%
+ \ifx\pgf@imagemask\pgfutil@empty\else\xdef\pgf@imagemask{ /SMask @\pgf@imagemask}\fi%
+ \edef\pgf@image{\noexpand\hbox to \pgf@imagewidth{\vbox to \pgf@imageheight{\vfil\special{pdf:image width \pgf@imagewidth\space height \pgf@imageheight\space\pgf@imagepage\space(\pgf@filename) <<\pgf@imageinterpolate\pgf@imagemask\space>>}}\hfil}}%
+ \else
+ \ifx\pgf@imagewidth\pgfutil@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi%
+ \ifx\pgf@imageheight\pgfutil@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi%
+ \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi%
+ \ifx\pgf@imageinterpolate\pgfutil@empty\else\edef\pgf@imageinterpolate{interpolate=\pgf@imageinterpolate,}\fi%
+ \ifx\pgf@imagemask\pgfutil@empty\else\xdef\pgf@imagemask{mask=\pgf@imagemask,}\fi%
+ \edef\pgf@image{\noexpand\includegraphics[\pgf@imageheight\pgf@imagewidth\pgf@imagepage\pgf@imageinterpolate\pgf@imagemask]{\pgf@filename}}%
+ \fi%
+}
+\def\pgfsys@definemask#1{%
+ \ifx\pgf@maskmatte\pgfutil@empty%
+ \else%
+ \edef\pgf@maskmatte{/Matte [\pgf@maskmatte]}%
+ \fi%
+ \edef\pgf@attr{\pgf@maskmatte\space /Decode [1 0]}%
+ \special{pdf:image @pgfmask\the\pgfsys@objnum\space hide (\pgf@filename) << \pgf@attr >>}%
+ \edef\pgf@mask{pgfmask\the\pgfsys@objnum}%
+ \global\advance\pgfsys@objnum\@ne%
+}
+
+% Patterns came from pgfsys-pdftex.def
+% dvipdfmx provides a new special `pdf:stream' for a stream object.
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
+ % Start building the pattern dictionary:
+ \pgf@xa=#2\relax%
+ \pgf@ya=#3\relax%
+ \pgf@xb=#4\relax%
+ \pgf@yb=#5\relax%
+ \pgf@xc=#6\relax%
+ \pgf@yc=#7\relax%
+ \pgf@sys@bp@correct\pgf@xa%
+ \pgf@sys@bp@correct\pgf@ya%
+ \pgf@sys@bp@correct\pgf@xb%
+ \pgf@sys@bp@correct\pgf@yb%
+ \pgf@sys@bp@correct\pgf@xc%
+ \pgf@sys@bp@correct\pgf@yc%
+ % Now create the pattern object:
+ \special{pdf:stream @pgf@patternobject@#1 (#8)
+ << /Type /Pattern
+ /PatternType 1
+ /PaintType \ifnum#9=0 2 \else 1 \fi
+ /TilingType 1
+ /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb]
+ /XStep \pgf@sys@tonumber\pgf@xc\space
+ /YStep \pgf@sys@tonumber\pgf@yc\space
+ /Resources << >> %<<
+ >>}%
+ \pgfutil@addpdfresource@patterns{/pgfpat#1\space @pgf@patternobject@#1}%
+}
+\def\pgfsys@setpatternuncolored#1#2#3#4{%
+ \pgfsysprotocol@literal{/pgfprgb cs #2 #3 #4 /pgfpat#1\space scn}%
+}
+\def\pgfsys@setpatterncolored#1{%
+ \pgfsysprotocol@literal{/Pattern cs /pgfpat#1\space scn}%
+}
+
+% Opacity masks (fadings) came from pgfsys-pdftex.def
+%
+% One problem was that the second argument of \pgfsys@fadingfrombox
+% is a box so that \pgfutil@insertatbegincurrentpage cannot be used.
+% So, the new command \pgfutil@insertatbegincurrentpagefrombox is written
+% in generic/pgf/utilities/pgfutil-[context,latex,plain].def.
+\def\pgfsys@fadingfrombox#1#2{%
+ \expandafter\ifx\csname pgfsmaskxform@#1\endcsname\relax%
+ {%
+ \pgf@x=-.5\wd#2%
+ \pgf@y=-.5\ht#2%
+ \advance\pgf@y by.5\dp#2%
+ \expandafter\xdef\csname pgfsmasktrans@#1\endcsname{%
+ \noexpand\pgftransformcm{1}{0}{0}{1}{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgfsmask\the\pgfsys@objnum\space%
+ width \the\wd#2\space height \the\ht#2\space depth \the\dp#2}%
+ \wd#2=0pt%
+ \ht#2=0pt%
+ \dp#2=0pt%
+ \box#2%
+ \special{pdf:exobj <</Group <</S/Transparency /CS/DeviceGray>> >>}}}\@tempa%
+ \expandafter\xdef\csname pgfsmaskxform@#1\endcsname{\the\pgfsys@objnum}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+ \fi%
+}
+\def\pgfsys@usefading#1#2#3#4#5#6#7{%
+ \expandafter\ifx\csname pgfsmaskxform@#1\endcsname\relax%
+ \PackageError{pgf}{Undefined fading '#1'}{}%
+ \else%
+ {%
+ \expandafter\ifx\csname pgfsmask@#1\endcsname\relax%
+ \pgf@sys@pdf@install@mask{#1}%
+ \fi%
+ \pgftransformreset%
+ \pgftransformcm{#2}{#3}{#4}{#5}{\pgfpoint{#6}{#7}}%
+ \csname pgfsmasktrans@#1\endcsname%
+ {%
+ \pgflowlevelsynccm%
+ \pgfsys@invoke{/pgfsmask\csname pgfsmaskxform@#1\endcsname\space gs}%
+ }%
+ \pgftransforminvert%
+ \pgflowlevelsynccm%
+ }%
+ \fi
+}
+\def\pgf@sys@pdf@install@mask#1{%
+ \pgfutil@addpdfresource@extgs{%
+ /pgfsmask\csname pgfsmaskxform@#1\endcsname\space <<
+ /SMask <<
+ /S /Luminosity
+ /G @pgfsmask\csname pgfsmaskxform@#1\endcsname
+ >> >>}%<<
+ \expandafter\let\csname pgfsmask@#1\endcsname\expandafter\csname pgfsmaskxform@#1\endcsname%
+}
+% Transparency groups came from pgfsys-pdftex.def
+\def\pgfsys@transparencygroupfrombox#1{%
+ {%
+ \pgf@sys@bp@correct\pgf@picminx%
+ \pgf@sys@bp@correct\pgf@picmaxx%
+ \pgf@sys@bp@correct\pgf@picminy%
+ \pgf@sys@bp@correct\pgf@picmaxy%
+ \edef\@tempa{\noexpand\pgfutil@insertatbegincurrentpagefrombox{%
+ \special{pdf:bxobj @pgftransgroup\the\pgfsys@objnum\space bbox \pgf@sys@tonumber\pgf@picminx\space\pgf@sys@tonumber\pgf@picminy\space\pgf@sys@tonumber\pgf@picmaxx\space\pgf@sys@tonumber\pgf@picmaxy}%
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \hskip\pgf@picminx bp\box#1\hskip-\pgf@picminx bp%
+ \special{pdf:exobj <</Group <</S/Transparency>> >>}}}\@tempa%
+ \special{pdf:uxobj @pgftransgroup\the\pgfsys@objnum}%
+ }%
+ \global\advance\pgfsys@objnum\@ne%
+}
%
% Position tracking (needs pdftex >= 1.40.0-alpha-20051205 in dvi mode)
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
index af868df5fc4..cec3fa14fda 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
@@ -7,13 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.19 2007/12/12 16:57:17 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.20 2008/04/03 17:04:45 tantau Exp $
% Driver commands for dvips
\def\pgfsys@invoke#1{\special{ps:: #1}}
\def\pgfsys@outerinvoke#1{\special{ps: #1}}
-\def\pgf@sys@postscript@header#1{\AtBeginDvi{\special{! #1}}}
+\def\pgf@sys@postscript@header#1{\pgfutil@insertatbegincurrentpage{\special{! #1}}}
\def\pgf@sys@postscript@object#1{\special{! #1}}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
index c9881df5737..8627a611077 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.20 2007/12/20 10:56:53 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.26 2009/05/22 07:25:48 jinhwancho Exp $
% Driver commands for pdf
@@ -22,6 +22,7 @@
%
\def\pgfsys@invoke#1{\pdfliteral{#1}}
+% Synced hboxes
\def\pgfsys@hboxsynced#1{%
{%
\pgfsys@beginscope%
@@ -43,48 +44,6 @@
}
-% Page resources (they are kept in objects and only written at the
-% very end)
-
-\pdfobj reserveobjnum
-\edef\pgf@sys@pdf@extgs@objnum{\the\pdflastobj}
-
-\pdfobj reserveobjnum
-\edef\pgf@sys@pdf@pattern@objnum{\the\pdflastobj}
-
-\immediate \pdfobj {<< /pgfprgb [/Pattern /DeviceRGB] >>}%<<
-\edef\pgf@sys@pdf@cs@objnum{\the\pdflastobj}
-
-\def\pgf@sys@pdf@possible@resources{%
- /ColorSpace \pgf@sys@pdf@cs@objnum\space 0 R
- /Pattern \pgf@sys@pdf@pattern@objnum\space 0 R
- /ExtGState \pgf@sys@pdf@extgs@objnum\space 0 R
-}
-
-{
- \edef\temp{
- \pgf@sys@pdf@possible@resources
- }
- \expandafter\global\expandafter\pdfpageresources\expandafter{\temp}
-}
-
-\expandafter\pgfutil@everybye\expandafter{%
- \the\pgfutil@everybye%
- \immediate \pdfobj useobjnum \pgf@sys@pdf@extgs@objnum {<<\pgf@sys@pgf@resource@list@extgs>>}%<<
- \immediate \pdfobj useobjnum \pgf@sys@pdf@pattern@objnum {<<\pgf@sys@pgf@resource@list@patterns>>}%<<
-}
-
-\let\pgf@sys@pgf@resource@list@extgs=\pgfutil@empty%
-\let\pgf@sys@pgf@resource@list@patterns=\pgfutil@empty%
-
-\def\pgf@sys@pdf@addtopageresources@extgs#1{%
- \xdef\pgf@sys@pgf@resource@list@extgs{\pgf@sys@pgf@resource@list@extgs\space#1}%
-}
-
-\def\pgf@sys@pdf@addtopageresources@patterns#1{%
- \xdef\pgf@sys@pgf@resource@list@patterns{\pgf@sys@pgf@resource@list@patterns\space#1}%
-}
-
\def\pgfsys@imagesuffixlist{.pdf:.jpg:.jpeg:.png:}
\def\pgfsys@defineimage{% width, height, page number
@@ -102,19 +61,19 @@
\edef\pgf@image{\noexpand\pdfrefform\the\pdflastform}%
\else% new version
{\pdfximage \pgf@imageheight \pgf@imagewidth attr
- {\pgf@imageinterpolate\space\pgf@imagemask} \pgf@imagepage
+ {/Interpolate \pgf@imageinterpolate\space\pgf@imagemask} \pgf@imagepage
{\pgf@filename}}%
\edef\pgf@image{\noexpand\pdfrefximage\the\pdflastximage}%
\fi
}%
-\def\pgfsys@definemask{%
+\def\pgfsys@definemask#1{%
\ifx\pgf@maskmatte\pgfutil@empty%
\else%
\edef\pgf@maskmatte{/Matte [\pgf@maskmatte]}%
\fi%
\edef\pgf@attr{{\pgf@maskmatte\space /Decode [1 0]}}%
\immediate\pdfximage attr \pgf@attr {\pgf@filename}%
- \edef\pgf@mask{\the\pdflastximage}%
+ \edef\pgf@mask{/SMask \the\pdflastximage\space 0 R}%
}
\def\pgfsys@horishading#1#2#3{%
{%
@@ -247,7 +206,7 @@
/Resources << >> %<<
}
{#8}%
- \pgf@sys@pdf@addtopageresources@patterns{/pgfpat#1\space \the\pdflastobj\space 0 R}%
+ \pgfutil@addpdfresource@patterns{/pgfpat#1\space \the\pdflastobj\space 0 R}%
}
\def\pgfsys@setpatternuncolored#1#2#3#4{%
@@ -323,6 +282,7 @@
%
\def\pgfsys@fadingfrombox#1#2{%
{%
+ \pgf@sys@pdf@check@resources%
\pgf@x=-.5\wd#2%
\pgf@y=-.5\ht#2%
\advance\pgf@y by.5\dp#2%
@@ -364,7 +324,7 @@
>>
}% <<
\pgfutil@tempboxa%
- \pgf@sys@pdf@addtopageresources@extgs{%
+ \pgfutil@addpdfresource@extgs{%
/pgfsmask\the\pdflastxform\space
<<
/SMask
@@ -380,6 +340,7 @@
% Transparency groups
%
\def\pgfsys@transparencygroupfrombox#1{%
+ \pgf@sys@pdf@check@resources%
\pdfxform
attr { /Group << /S /Transparency >> } %<<
resources { \pgf@sys@pdf@possible@resources }
@@ -387,6 +348,53 @@
\setbox#1=\hbox{\pdfrefxform\pdflastxform}%
}
+
+
+
+%
+% Resource management
+%
+
+\def\pgf@sys@setuppdfresources@plain{%
+ % This command will setup pdf resource in plain and in latex
+ % mode. ConTeXt has its own handler
+ % Page resources (they are kept in objects and only written at the
+ % very end)
+ \pdfobj reserveobjnum \edef\pgf@sys@pdf@extgs@objnum{\the\pdflastobj}
+ \pdfobj reserveobjnum \edef\pgf@sys@pdf@pattern@objnum{\the\pdflastobj}
+ \pdfobj reserveobjnum \edef\pgf@sys@pdf@colrospaces@objnum{\the\pdflastobj}
+ \def\pgf@sys@pdf@possible@resources{%
+ /ColorSpace \pgf@sys@pdf@colrospaces@objnum\space 0 R
+ /Pattern \pgf@sys@pdf@pattern@objnum\space 0 R
+ /ExtGState \pgf@sys@pdf@extgs@objnum\space 0 R
+ }
+ \let\pgf@sys@pdf@check@resources=\relax%
+ \def\pgf@sys@pdf@install@pageresources{
+ {
+ \edef\temp{
+ \pgf@sys@pdf@possible@resources
+ }
+ \expandafter\global\expandafter\pdfpageresources\expandafter{\temp}
+ }
+ }
+ \pgf@sys@pdf@install@pageresources
+ \expandafter\pgfutil@everybye\expandafter{%
+ \the\pgfutil@everybye%
+ \immediate \pdfobj useobjnum \pgf@sys@pdf@extgs@objnum {<<\pgf@sys@pgf@resource@list@extgs>>}%<<
+ \immediate \pdfobj useobjnum \pgf@sys@pdf@pattern@objnum {<<\pgf@sys@pgf@resource@list@patterns>>}%<<
+ \immediate \pdfobj useobjnum \pgf@sys@pdf@colrospaces@objnum {<<\pgf@sys@pgf@resource@list@colorspaces>>}%<<
+ }
+ \let\pgf@sys@pgf@resource@list@extgs=\pgfutil@empty%
+ \let\pgf@sys@pgf@resource@list@patterns=\pgfutil@empty%
+ \let\pgf@sys@pgf@resource@list@colorspaces=\pgfutil@empty%
+ \def\pgf@sys@addpdfresource@extgs@plain##1{\xdef\pgf@sys@pgf@resource@list@extgs{\pgf@sys@pgf@resource@list@extgs\space##1}}
+ \def\pgf@sys@addpdfresource@patterns@plain##1{\xdef\pgf@sys@pgf@resource@list@patterns{\pgf@sys@pgf@resource@list@patterns\space##1}}
+ \def\pgf@sys@addpdfresource@colorspaces@plain##1{\xdef\pgf@sys@pgf@resource@list@colorspaces{\pgf@sys@pgf@resource@list@colorspaces\space##1}}
+}
+\pgfutil@setuppdfresources % possibly call the above
+
+\pgfutil@addpdfresource@colorspaces{ /pgfprgb [/Pattern /DeviceRGB] }
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
index 76202d4c842..71f819cc2bc 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-tex4ht.def,v 1.16 2008/02/07 19:25:41 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-tex4ht.def,v 1.23 2010/08/18 12:14:47 ludewich Exp $
\RequirePackage{xcolor}
@@ -28,26 +28,104 @@
\newcount\pgf@sys@svg@picnum
+%%
+%% initial support of Mathml and xhtml inside svg through the svg:foreignelement tag
+%%
+%% it'll allow us to have complicated text nodes in the tex4ht driver
+%%
+
+
+%Example (to improve the display, you have to use css)
+%
+%\tikzpicture[svg text only=false]
+%\draw (0,0) node[inner sep=0pt,draw] {tight}
+%(0cm,2em) node[inner sep=5pt,draw] {loose}
+%(0cm,4em) node[fill=red!20] {default};
+%\draw (3,0) node[inner sep=0pt,draw] {TIGHT}
+%(3cm,2em) node[inner sep=5pt,draw] {LOOSE}
+%(3cm,4em) node[fill=red!20] {DEFAULT};
+%\draw (6,0) node[inner sep=0pt,draw] {$tight$}
+%(6cm,2em) node[inner sep=5pt,draw] {$loose$}
+%(6cm,4em) node[fill=red!20] {$default$};
+%\draw (9,0) node[inner sep=0pt,draw] {$TIGHT$}
+%(9cm,2em) node[inner sep=5pt,draw] {$LOOSE$}
+%(9cm,4em) node[fill=red!20] {$Default$};
+%\endtikzpicture
+%
+% you can use the options "svg text css=filename", "svg text id=idname", "svg text class=classname" to customize the display through the use of css
+%
+
+
+
+
+
+
+
+%\def\pgfsys@beginpicture{%
+% % \Configure{[]}{$}{$} these two lines aren't needed for tex4ht and moreother they produce errors with plain tex !
+% % \Configure{()}{$}{$}
+% \Configure{$$}{}{}{}%$$
+% \Configure{$}{}{}{}%$
+% \Configure{SUB}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}
+% \Configure{SUP}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}
+% \Configure{SUBSUP}{}{}{}
+% \Configure{htf}
+% {0}{+}{<tspan font-family="}
+% {\%s}{" font-size="\%s}{}{}
+% {">}{</tspan>}
+%}
+
+
+
+%\def\pgfsys@endpicture{%
+% % undo:
+% \Configure{htf}{0}{+}{<span\Hnewline
+% class="}{\%s}{-\%s}{x-x-\%d}{}{">}{</span>}
+%}
+
+% we don't want tex4ht putting <p> and </p> tags automatically in our svg code and causing invalid xhtml in our svg pictures
+\newif\ifpgfsys@CssIncluded@\pgfsys@CssIncluded@false
+\def\pgfsys@beginpicture{%
+ \EndP\HtmlParOff
+ \pgfkeys{/tikz/tex4ht node/escape=false}% text only nodes are the default. Advantage : pure svg pictures are the default, nicer for text only nodes.
+ % Disadvantages : this rendering methods produce more invalid or degraded svg pictures than with the foreignelement tag
+ %% we use css to control the display of foreignelement rendered text nodes
+ \ifpgfsys@CssIncluded@
+ \else
+ \Css{
+ .foreignobject {%
+ line-height:100\%;
+ font-size:120\%; % this is the trick....a font of size 100% in a box scaled down to half size makes it a half size font.
+% you'll have to double the size of things that you want to have a regular size in this half-scaled box though
+ font-family:STIXgeneral,Times,Symbol,cmr10,CMSY10,CMEX10;% can't wait for the stix font...the cmr10, etc font are available from the mozilla site, times and symbols should be okey
+ padding:0;
+ margin:0;
+% background-color:\#12ff55; usefull for debugging positioning
+ text-align:center; % good for centered text nodes...will have to improve that later on...with more integration with tikz options for text nodes
+ }
+ }%
+ \Css{%
+ math {%, math[mode="inline"] {
+ vertical-align:baseline;
+ line-height:100\%;
+ font-size:100\%;
+ font-family:STIXGeneral,Times,Symbol, cmr10,cmsy10,cmex10,cmmi10;
+ font-style: normal;
+ margin:0;
+% background-color:\#99ff99;
+ padding:0;
+ }%
+ }%
+ \pgfsys@CssIncluded@true
+ \fi
+}%
-\def\pgfsys@beginpicture{%
- \Configure{[]}{$}{$}
- \Configure{()}{$}{$}
- \Configure{$$}{}{}{}%$$
- \Configure{$}{}{}{}%$
- \Configure{SUB}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}
- \Configure{SUP}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}
- \Configure{SUBSUP}{}{}{}
- \Configure{htf}
- {0}{+}{<tspan font-family="}
- {\%s}{" font-size="\%s}{}{}
- {">}{</tspan>}
-}
\def\pgfsys@endpicture{%
- % undo:
- \Configure{htf}{0}{+}{<span\Hnewline
- class="}{\%s}{-\%s}{x-x-\%d}{}{">}{</span>}
-}
-
+ \HtmlParOn
+ \par% FIXME : was '\Par' but that seems to be undefined!?
+}%
+
+% this is okey for both rendering methods for text nodes (mtext or foreignelement)...
\def\pgfsys@typesetpicturebox#1{%
\global\advance\pgf@sys@svg@picnum by 1\relax%
% Ok, compute width/height
@@ -81,6 +159,13 @@
\pgfsysprotocol@flushcurrentprotocol%
\pgfsys@invoke{" type="image/svg+xml"><p>SVG-Viewer needed.</p></object>}%
\special{t4ht>\jobname-\the\pgf@sys@svg@picnum.svg}%
+%%%%%%%% This is necessary to control the svg through css
+ \pgfkeys{%
+ /tikz/tex4ht node/css/.get=\pgfsys@foreignobject@css
+ }%
+ \pgfsys@invoke{<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>\Hnewline% added that
+ <?xml-stylesheet href="\pgfsys@foreignobject@css.css" type="text/css"?>\Hnewline}% added that
+%%%%%%%%%%%%%%% maybee I should add an option to change the css, for the whole picture
\pgfsys@invoke{<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="\the\pgf@xc"
height="\the\pgf@yc" viewBox="}%
@@ -92,19 +177,26 @@
\pgfsys@invoke{) scale(1,-1) translate(0,}%
\pgf@sys@pt\pgf@ya\pgfsysprotocol@flushcurrentprotocol%
\pgfsys@invoke{)">\Hnewline }%
- \pgfmathsetlength\pgf@x{\pgf@shift@baseline}%
- \advance\pgf@x by-\pgf@picminy\relax%
+ %
+ \pgf@ya=\pgf@shift@baseline\relax%
+ \advance\pgf@ya by-\pgf@picminy\relax%
+ %
+ %
\advance\pgf@picmaxy by-\pgf@picminy\relax% maxy is now the height
\advance\pgf@picmaxx by-\pgf@picminx\relax% maxx is now the width
\setbox#1=\hbox{\hskip-\pgf@picminx\lower\pgf@picminy\box#1}%
\ht#1=\pgf@picmaxy%
\wd#1=\pgf@picmaxx%
\dp#1=0pt%
- \leavevmode\raise-\pgf@x\box#1%
+ \leavevmode
+ \pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
+ \raise-\pgf@ya\box#1%
+ \pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
\pgfsys@invoke{</g>\Hnewline </svg>\Hnewline }%
\special{t4ht<\jobname-\the\pgf@sys@svg@picnum.svg}%
-}
+}%
+%% we'll use this hbox for the mtext rendering method (the "text only=true" option)
\def\pgfsys@hbox#1{%
\pgf@x=.5\wd#1%
\ifx\tikz@textcolor\relax%
@@ -130,7 +222,171 @@
\dp#1=0pt%
\box#1
\HCode{</text>\Hnewline }%
-}
+}%
+
+%% we save this definition
+\let\pgfsys@mtext@hbox\pgfsys@hbox
+
+%% we have to use some "evil" ^^ tex4ht hackery
+% tex4ht hackery
+{% grouping necessary cause we change the catcode of ":"
+ \catcode`:=11\relax
+ %%% this is necessary to calculate the size of text nodes with inline maths
+ % (it is an improvement of tex4ht, got to ask eitan gurary if he could put it in the tex4ht code)
+ \gdef\DviMathAlt{%
+ \a:DviMath\leavevmode \MathClass \ht:special{t4ht@(}\hbox\bgroup{\expandafter\ifx\csname ht:everypar\endcsname\relax\expandafter\everypar\else \expandafter\ht:everypar\fi{}\leavevmode\ht:special{t4ht@)}}\DviSend
+ }%
+% these are configures for the foreignelement rendering method of text nodes : we let tex4ht write xhtml and mathml in the svg picture
+%
+ \gdef\pgfsys@foreignobject@configure{%
+ \Configure{$}{\Configure{@math}{%\a:mathml
+ display="inline" }\DviMathAlt}{\EndDviMath}{}%%% we REALLY need to use \DviMathAlt here instead of \DviMath see above remark
+ \Configure{$$}{\Configure{@math}{%\a:mathml
+ display="block" }\IgnorePar
+ \ifvmode\else \HCode{<!--tex4ht:inline-->}\fi\EndP
+ \DviMath}{\EndDviMath\ShowPar\pgfsys@foreignobject@par{\csname HCondtrue\endcsname\noindent}
+ }{\DisplayMathtrue}%
+ \Configure{SUB}{\Send{BACK}{<\a:mathml msub><\a:mathml mrow\Hnewline>}%
+ \Tg</\a:mathml mrow>\Tg<\a:mathml mrow\Hnewline>\trap:base}{\Tg</\a:mathml mrow>\TG</\a:mathml msub\Hnewline>}%
+ \Configure{SUP}{\Send{BACK}{<\a:mathml msup><\a:mathml mrow\Hnewline>}%
+ \Tg</\a:mathml mrow>\Tg<\a:mathml mrow\Hnewline>\trap:base}{\Tg</\a:mathml mrow>\TG</\a:mathml msup\Hnewline>}%
+ \Configure{SUBSUP}{\Send{BACK}{<\a:mathml msubsup><\a:mathml mrow\Hnewline>}%
+ \Tg</\a:mathml mrow>\Tg<\a:mathml mrow\Hnewline>\trap:base}{\Tg</\a:mathml mrow>\Tg<\a:mathml mrow\Hnewline>\trap:base}{\Tg</\a:mathml mrow>\TG</\a:mathml msubsup\Hnewline>}%
+ \Configure{htf}{0}{+}{<span\Hnewline
+ class="}{\%s}{-\%s}{x-x-\%d}{}{">}{</span>}%
+ }%
+ \global\let\pgfsys@foreignobject@par=\par % use this instead of \par -- \Configure is no \long macro (at least in one of the older versions).
+
+% these are the configures for the mtext rendering method of text nodes : we turn everything into regular character (don't want math modes or subsup)
+% and we hope it works (it doesn't if the text nodes aren't simple)
+ \gdef\pgfsys@mtext@configure{%
+ % no configures for \(\) and \[\] those might be needed for context or Latex. Let me know !
+ \Configure{$$}{}{}{}% no block maths
+ \Configure{$}{}{}{}%$ no inline maths
+ \Configure{SUB}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}%
+ \Configure{SUP}{\HCode{<tspan baseline-shift="sub">}}{\HCode{</tspan>}}%
+ \Configure{SUBSUP}{}{}{}% not both sub and sup
+ \Configure{htf} {0}{+}{<tspan font-family="}{\%s}{" font-size="\%s}{}{}{">}{</tspan>}%
+ }%
+}%
+
+% a counter to produce unique ids for each text node rendered with foreign element
+\newcount\pgf@sys@svg@nodenum
+
+
+% pgfutil@minipage
+%
+% I had to change it to make it play nice with the way tex4ht puts <p> and <\p> tags
+%
+
+\newif\ifpgfsys@textonly
+\def\pgfutil@minipage[#1]#2{%
+ \hbox to#2\bgroup
+ \hsize=#2\relax
+ \vbox\bgroup
+% though it works, I'm desabling the above mentioned hack to make tex4ht behave with <p> <\p>, because it blurps the positioning
+% (I''l try to fix that later, it's a css thing)
+%
+% \ifpgfsys@textonly\else\HtmlParOn\fi
+%
+% \noindent is better as it doesn't produce indentation AND it makes you leave vertical mode
+ \noindent%\leavevmode
+}%
+\def\pgfutil@endminipage{%
+% same thing here
+%
+% \ifpgfsys@textonly\else\EndP\HtmlParOff\fi
+ \egroup\egroup
+}%
+
+
+% I'll have to fix those names later
+\newbox\pgfsys@foreignobject@Box
+\newdimen\pgf@s
+\newdimen\pgf@t
+% this is the alternate hbox routine that renders text nodes through the foreignobject tag
+\def\pgfsys@foreignobject@hbox#1{%
+ % Compute box y translation (x translation is correct).
+ \pgf@y=-\ht#1\relax
+ \HCode{<g transform="scale(1,-1) translate(0,\pgf@sys@tonumber{\pgf@y}) % got to translate in y
+ scale(0.5,0.5)">\Hnewline}% scaling work around (damn dumb browsers !)
+ % Compute box size (scaled 2 times)
+ % this is necessary to make the browser scale the font down 50% (the STUPID browsers won't make font-size:50% happen,
+ % so we have to work around this by making svg scale the things down 50%, doubling the size of the text node frame (i.e. no changement there)
+ \pgf@x=2\wd#1\relax
+ \pgf@y=2\ht#1\relax
+ \advance\pgf@y by 2\dp#1\relax
+ % this is to adjust the y translation to compensate for the differences between the TeX and the Html models for lines
+ \setbox\pgfsys@foreignobject@Box=\hbox{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+ $abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZf_1^1\overline D)_1^1\vec i\vec j$}%
+ \pgf@t=\ht#1\relax
+ \advance\pgf@t by -\ht\pgfsys@foreignobject@Box\relax
+ \pgf@s=\pgf@t\relax
+ \advance\pgf@s by \dp#1\relax
+ \advance\pgf@s by -\dp\pgfsys@foreignobject@Box\relax
+ \ifnum\pgf@s>0\relax
+ \pgf@s=0pt
+ \pgf@t=0pt
+ \else
+ \advance \pgf@y by -2\pgf@s\relax
+ \pgf@t=2\pgf@t\relax
+ \fi
+ %
+ \HCode{<foreignObject x="0" y="\pgf@sys@tonumber{\pgf@t}"
+ width="\pgf@sys@tonumber{\pgf@x}" height="\pgf@sys@tonumber{\pgf@y}">}%
+ % this is to make use of the css, class and id options through which you can control the way things display
+ \pgfkeys{%
+ /tikz/tex4ht node/css/.get=\pgfsys@foreignobject@css,%
+ /tikz/tex4ht node/class/.get=\pgfsys@foreignobject@class,%
+ /tikz/tex4ht node/id/.get=\pgfsys@foreignobject@id
+ }%
+ \HCode{<head>\Hnewline
+ <link rel="stylesheet" type="text/css" href="\pgfsys@foreignobject@css.css" />\Hnewline
+ </head>\Hnewline
+% I'll have to look into this, perhaps there are better doctype....&nbsp; aren't recognised and produces invalid svg pictures
+% a workaround (not implemented yet) would be to make them into entities of the svg picture.
+ <body id="\pgfsys@foreignobject@id" class="\pgfsys@foreignobject@class" xmlns="http://www.w3.org/1999/xhtml" >\Hnewline
+ <div>\Hnewline
+ }%
+ \box#1%
+ \HCode{%
+ </div>\Hnewline
+ </body>\Hnewline
+ </foreignObject>\Hnewline
+ }%
+% debug positioning not needed but it would be nice to let it there to control things later on
+% \HCode{<rect x="0" y="0" width="\pgf@sys@tonumber{\pgf@x}" height="\pgf@sys@tonumber{\pgf@y}"
+% style="fill:yellow;stroke:red; fill-opacity:0.5;stroke-opacity:0.5"/>}
+ \HCode{</g>\Hnewline}%
+ \global\advance\pgf@sys@svg@nodenum by 1\relax
+}%
+
+% the options and the code that controls it all (switches between \pgfsys@mtext@hbox and \pgfsys@foreignelement@hbox)
+
+\pgfkeys{%
+ /tikz/.cd,
+ tex4ht node/escape/.is choice,
+ tex4ht node/escape/false/.code={\let\pgfsys@hbox\pgfsys@mtext@hbox\pgfsys@mtext@configure\pgfsys@textonlytrue},
+ tex4ht node/escape/true/.code={\let\pgfsys@hbox\pgfsys@foreignobject@hbox\pgfsys@foreignobject@configure\pgfsys@textonlyfalse},
+ tex4ht node/css/.initial=\jobname,
+ tex4ht node/class/.initial=foreignobject,
+ tex4ht node/id/.initial=\jobname\the\pgf@sys@svg@picnum-\the\pgf@sys@svg@nodenum
+}%
+
+
+
+
+
+
+% this might be needed
+%\font\SvgText=cmr10\relax
+
+
+
+
+% There is something rellay wrong with the way "%" chars are used in here... you should code "}%" to avoid unnecessary spaces
+% and it is unnecessary to code \cs%
+% got to be carefull with numbers though, cf the texbook...2\relax and 2 % are okey
\def\pgfsys@outerinvoke{\ifpgfpicture\expandafter\pgfsys@invoke\else\expandafter\pgfutil@gobble\fi}
@@ -182,8 +438,9 @@
\let\pgf@texht@undeclaredcolor=\@undeclaredcolor
\def\@declaredcolor{\ifpgfpicture\expandafter\pgf@xcolor@declaredcolor\else\expandafter\pgf@texht@declaredcolor\fi}
\def\@undeclaredcolor{\ifpgfpicture\expandafter\pgf@xcolor@undeclaredcolor\else\expandafter\pgf@texht@undeclaredcolor\fi}
- \ConfigureEnv{pgfpicture}{}{}{}{}
-}
+ %\ConfigureEnv{pgfpicture}{}{}{}{} there is no environment in plain TeX and this produces errors
+ % this might be needed for context or latex though....let me know !
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
index 08a26fdcef0..feaa7f77bae 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-xetex.def,v 1.1 2007/12/17 14:52:31 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-xetex.def,v 1.3 2010/02/16 10:56:09 tantau Exp $
% Driver commands for dvipdfm
@@ -18,8 +18,12 @@
\input pgfsys-common-pdf-via-dvi.def
%
-% dvipdfm-specific stuff:
+% dvipdfmx-specific stuff:
%
+
+\def\pgfsys@invoke#1{\special{pdf:literal direct #1 }}
+
+
\ifx\XeTeXversion\@undefined
\PackageError{pgfsys}{XeTeX is not running, but it should. Somehow
the wrong driver got selected}{}
@@ -31,6 +35,12 @@
%
\pgf@sys@pdf@dvi@tracker
+%
+% Page size stuff
+%
+\def\pgfsys@papersize#1#2{%
+ \pdfpageheight#2%
+ \pdfpagewidth#1}
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
index e568c4c8c90..3cd39c48645 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.31 2008/02/07 19:25:41 tantau Exp $
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.37 2010/06/30 13:06:37 ludewich Exp $
% Load key mechanism
@@ -32,16 +32,16 @@
\pgf@x=#1\relax%
\pgf@x=0.99627\pgf@x%
\edef\temp{\expandafter\Pgf@geT\the\pgf@x\space}%
- \toks@\expandafter\expandafter\expandafter{\expandafter\pgfsysprotocol@currentprotocol\temp}%
- \xdef\pgfsysprotocol@currentprotocol{\the\toks@}%
+ \pgfutil@toks@\expandafter\expandafter\expandafter{\expandafter\pgfsysprotocol@currentprotocol\temp}%
+ \xdef\pgfsysprotocol@currentprotocol{\the\pgfutil@toks@}%
}%
}
\def\pgf@sys@pt#1{%
{%
\pgf@x=#1\relax%
\edef\temp{\expandafter\Pgf@geT\the\pgf@x\space}%
- \toks@\expandafter\expandafter\expandafter{\expandafter\pgfsysprotocol@currentprotocol\temp}%
- \xdef\pgfsysprotocol@currentprotocol{\the\toks@}%
+ \pgfutil@toks@\expandafter\expandafter\expandafter{\expandafter\pgfsysprotocol@currentprotocol\temp}%
+ \xdef\pgfsysprotocol@currentprotocol{\the\pgfutil@toks@}%
}%
}
@@ -56,6 +56,10 @@
\newdimen\pgf@xc
\newdimen\pgf@yc
+\newwrite\w@pgf@writea
+\newread\r@pgf@reada
+\let\pgfutil@inputcheck=\r@pgf@reada
+
% internal counters that are alwyas present when pgfsys is loaded
\newcount\c@pgf@counta
\newcount\c@pgf@countb
@@ -742,15 +746,20 @@
% Called at the end of a pgfpicture.
\def\pgfsys@typesetpicturebox#1{%
- \pgfmathsetlength\pgf@x{\pgf@shift@baseline}%
- \advance\pgf@x by-\pgf@picminy\relax%
+ \pgf@ya=\pgf@shift@baseline\relax%
+ \advance\pgf@ya by-\pgf@picminy\relax%
+ %
+ %
\advance\pgf@picmaxy by-\pgf@picminy\relax% maxy is now the height
\advance\pgf@picmaxx by-\pgf@picminx\relax% maxx is now the width
\setbox#1=\hbox{\hskip-\pgf@picminx\lower\pgf@picminy\box#1}%
\ht#1=\pgf@picmaxy%
\wd#1=\pgf@picmaxx%
\dp#1=0pt%
- \leavevmode\raise-\pgf@x\box#1%
+ \leavevmode%
+ \pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
+ \raise-\pgf@ya\box#1%
+ \pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
}
% Called after a picture has been typeset in box #1. This
% command should insert the box into the normal TeX code. The box #1
@@ -880,6 +889,12 @@
% Discern the driver:
+
+% Default driver:
+\ifx\pgfsysdriver\@undefined
+ \pgfutil@guessdriver
+\fi
+
\input pgf.cfg
\PackageInfo{pgfsys}{Driver file for pgf: \pgfsysdriver}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
index 86c7e5691b4..96fe6db490a 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsyssoftpath.code.tex,v 1.6 2008/01/23 13:15:28 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsyssoftpath.code.tex,v 1.7 2008/07/18 19:06:58 ludewich Exp $
% This package provides the pgf system path abstraction layer. This
@@ -113,7 +113,7 @@
}
\def\pgfsyssoftpath@smalloverflow#1{%
\global\advance\pgfsyssoftpath@bigbuffer@items by1\relax%
- \ifnum\pgfsyssoftpath@smallbuffer@items<30\relax% good number?
+ \ifnum\pgfsyssoftpath@bigbuffer@items<30\relax% good number?
\expandafter\expandafter\expandafter\gdef%
\expandafter\expandafter\expandafter\pgfsyssoftpath@bigbuffer%
\expandafter\expandafter\expandafter{\expandafter\pgfsyssoftpath@bigbuffer\pgfsyssoftpath@smallbuffer#1}%
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
new file mode 100644
index 00000000000..38eeb306855
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
@@ -0,0 +1,43 @@
+% Copyright 2007 by Till Tantau
+%
+% 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.
+%
+% In addition to the above licenses, this particular file may also be
+% directly inlined into other documents and this copyright notice may
+% be removed. Additionally, when you inline this file, you may modify
+% it as needed and you may remove comments.
+%
+% This file is intended to be distributed or even inlined into a file
+% when a document needs to be typeset on a system that does not have
+% pgf/TikZ installed.
+
+% "environment" for reading an external graphic. Note that there are
+% no (!) braces around the "name" of the environment
+%
+% #1 = name of the graphics file
+%
+% Example:
+%
+% \beginpgfgraphicnamed{mygraph}
+% \begin{tikzpicture}
+% ...
+% \end{tikzpicture}
+% \endpgfgraphicnamed
+
+\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{%
+ \begingroup
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \openin1=#1.dpth
+ \ifeof1 \box1
+ \else
+ \read1 to\pgfincludeexternalgraphicsdp \closein1
+ \dimen0=\pgfincludeexternalgraphicsdp\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
index 46a62f31767..d31ddedfe26 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
@@ -1,4 +1,4 @@
-% Copyright 2006 by Till Tantau
+% Copyright 2008 by Till Tantau and Mark Wibrow
%
% This file may be distributed and/or modified
%
@@ -7,23 +7,72 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgffor.code.tex,v 1.8 2007/11/07 23:21:48 tantau Exp $
-
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgffor.code.tex,v 1.18 2010/03/23 14:47:45 vibrovski Exp $
\newdimen\pgffor@iter
\newdimen\pgffor@skip
\newif\ifpgffor@continue
+
\let\pgffor@beginhook=\pgfutil@empty
\let\pgffor@endhook=\pgfutil@empty
\let\pgffor@afterhook=\pgfutil@empty
+% Stack emulation
+%
+\newtoks\pgffor@stack
+\pgffor@stack={{}{}{}}
+
+\def\pgffor@stackpush#1{%
+ \def\pgffor@stacktemp{#1}%
+ \expandafter\expandafter\expandafter\pgffor@stack\expandafter\expandafter\expandafter=%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter%
+ {\expandafter\pgffor@stacktemp\expandafter}\the\pgffor@stack}%
+}
+
+\def\pgffor@stackpop{\expandafter\pgffor@@stackpop\the\pgffor@stack\pgffor@stackstop}
+\def\pgffor@@stackpop#1#2\pgffor@stackstop{\pgffor@stack{#2}#1}
+
\def\pgffor@emptyvalues{, \pgffor@stop,}%
-\def\foreach#1in{%
- \def\pgffor@var{#1}%
- \pgfutil@ifnextchar\bgroup{\pgffor@normal@list}{\pgffor@macro@list}}
+\def\pgffor@foreach{%
+ \pgffor@atbeginforeach%
+ \let\pgffor@assign@before@code=\pgfutil@empty%
+ \let\pgffor@assign@after@code=\pgfutil@empty%
+ \let\pgffor@assign@once@code=\pgfutil@empty%
+ \let\pgffor@remember@code=\pgfutil@empty%
+ \let\pgffor@remember@once@code=\pgfutil@empty%
+ \pgffor@alphabeticsequencefalse%
+ \pgffor@contextfalse%
+ %
+ \let\pgffor@var=\pgfutil@empty
+ %
+ \pgffor@vars%
+}
+
+\let\foreach=\pgffor@foreach
+
+\def\pgffor@vars{%
+ \pgfutil@ifnextchar i{\pgffor@@vars@end}{%
+ \pgfutil@ifnextchar[{\pgffor@@vars@opt}{%]
+ \pgfutil@ifnextchar/{\pgffor@@vars@slash@gobble}{%
+ \pgffor@@vars}}}}%
+
+\def\pgffor@@vars@end in{\pgfutil@ifnextchar\bgroup{\pgffor@normal@list}{\pgffor@macro@list}}
+\def\pgffor@@vars@opt[#1]{\pgfkeys{/pgf/foreach/.cd,#1}\pgffor@vars}
+\def\pgffor@@vars#1{\pgffor@var@add#1\pgffor@stop\pgffor@vars}
+\def\pgffor@@vars@slash@gobble/{\pgffor@@vars}
+
+\def\pgffor@var@add#1#2\pgffor@stop{%
+ \ifx\pgffor@var\pgfutil@empty%
+ \def\pgffor@var{#1}%
+ \def\pgffor@mainvar{#1}%
+ \else%
+ \expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@var/#1}%
+ \fi%
+}
+
\def\pgffor@macro@list#1{%
\expandafter\pgffor@normal@list\expandafter{#1}}
\def\pgffor@normal@list#1{%
@@ -31,10 +80,9 @@
\ifx\pgffor@values\pgffor@emptyvalues
\def\pgffor@values{\pgffor@stop,}%
\fi%
- \let\pgffor@body\pgfutil@empty%
+ \let\pgffor@body=\pgfutil@empty%
\global\pgffor@continuetrue%
\pgffor@collectbody}
-
\def\pgffor@collectbody{%
\pgfutil@ifnextchar\foreach{\pgffor@collectforeach}{%
\pgfutil@ifnextchar\bgroup{\pgffor@collectargument}{\pgffor@collectsemicolon}}%
@@ -50,13 +98,18 @@
\expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter{\pgffor@body\foreach#1in{#2}}%
\pgffor@collectbody%
}
-
\long\def\pgffor@collectargument#1{%
- \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter{\pgffor@body{#1}}%
+ \expandafter\pgfutil@in@\expandafter\foreach\expandafter{\pgffor@body}%
+ \ifpgfutil@in@%
+ \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter%
+ {\pgffor@body{#1}}%
+ \else%
+ \expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter%
+ {\pgffor@body#1}%
+ \fi%
\pgffor@iterate%
}
-
\def\pgffor@collectsemicolon{%
\let\pgffor@next=\pgffor@collectnormalsemicolon%
\ifnum\the\catcode`\;=\active\relax%
@@ -77,12 +130,17 @@
\expandafter\long\expandafter\def\expandafter\pgffor@body\expandafter{\pgffor@body#1;}%
\pgffor@iterate%
}
-}
+}
\def\pgffor@iterate{%
- \let\pgffor@last\pgfutil@empty%
- \let\pgffor@prevlast\pgfutil@empty%
- \expandafter\pgffor@scan\pgffor@values}
+ % Must do all of these in case the internal stack is used.
+ \let\pgffor@last=\pgfutil@empty%
+ \let\pgffor@prevlast=\pgfutil@empty%
+ \let\pgffor@dotsend=\pgfutil@empty%
+ \let\pgffor@dots@pre=\pgfutil@empty%
+ \let\pgffor@dots@post=\pgfutil@empty%
+ %
+ \expandafter\pgffor@scan\pgffor@values}
\def\pgffor@stop{\pgffor@stop}%
\def\pgffor@dots{...}%
@@ -91,35 +149,54 @@
\def\pgffor@scanround(#1)#2,{\def\pgffor@value{(#1)}\pgffor@scanned}
\def\pgffor@scanone#1,{\def\pgffor@value{#1}\pgffor@scanned}
+
+% Check for dots.
+\newif\ifpgffor@dots@in@
+\def\pgffor@dots@in@#1...#2#3\pgffor@stop{%
+ \ifx\pgffor@dots@@#2%
+ \pgffor@dots@in@false%
+ \else%
+ \pgffor@dots@in@true%
+ \fi%
+}
+
+\def\pgffor@dots@@{\pgffor@dots@@}
+
\def\pgffor@scanned{%
\ifx\pgffor@value\pgffor@stop%
- \let\pgffor@next=\pgffor@after% done!
+ \let\pgffor@next=\pgffor@after% Done!
\else%
- \ifx\pgffor@value\pgffor@dots%
+ % Check for dots. Quicker than \pgfutil@in@ and not suceptable
+ % to false-positives when a token sequence ends in a single full-stop.
+ \expandafter\pgffor@dots@in@\pgffor@value\pgffor@dots@...\pgffor@dots@@\pgffor@stop%
+ \ifpgffor@dots@in@%
\let\pgffor@next=\pgffor@handledots%
\else%
\let\pgffor@next=\pgffor@handlevalue%
\fi%
\ifpgffor@continue%
\else%
- \let\pgffor@next=\pgffor@scan% done!
+ \let\pgffor@next=\pgffor@scan% Done!
\fi%
\fi%
\pgffor@next}
+
\def\pgffor@after{%
\global\pgffor@continuetrue%
+ \pgffor@atendforeach%
\pgffor@afterhook}
-
+
\def\pgffor@handlevalue{%
- \let\pgffor@prevlast\pgffor@last%
- \let\pgffor@last\pgffor@value%
+ \let\pgffor@prevlast=\pgffor@last%
+ \let\pgffor@last=\pgffor@value%
\pgffor@invokebody%
\pgffor@scan%
}
+
\def\pgffor@invokebody{%
- \begingroup%
+ \pgffor@begingroup%
\expandafter\pgfutil@in@\expandafter/\expandafter{\pgffor@var}%
\ifpgfutil@in@%
\expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@value//\relax}%
@@ -127,8 +204,25 @@
\else%
\expandafter\expandafter\expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@value}%
\fi%
+ % Execute assign once code.
+ \ifx\pgffor@assign@once@code\pgfutil@empty%
+ \else%
+ \pgffor@assign@once@code%
+ \fi%
+ % Execute assign before code.
+ \ifx\pgffor@assign@before@code\pgfutil@empty%
+ \else%
+ \pgffor@assign@before@code%
+ \fi%
+ %
\expandafter\pgffor@beginhook\pgffor@body\pgffor@endhook%
- \endgroup%
+ % Execute assign after code.
+ \ifx\pgffor@assign@after@code\pgfutil@empty%
+ \else%
+ \pgffor@assign@after@code%
+ \fi%
+ %
+ \pgffor@endgroup%
}
@@ -145,27 +239,60 @@
\def\pgffor@multiassignrest{\expandafter\pgffor@multiassignfinal\pgffor@valuerest}
\def\pgffor@multiassignfinal#1/#2/\relax{%
+ \def\pgffor@temp{#1}%
+ \ifx\pgffor@currentvar\pgffor@mainvar%
+ \ifpgffor@alphabeticsequence%
+ \pgffor@makealphabetic\pgffor@temp%
+ \fi%
+ \fi%
\def\pgffor@test{#2}%
\ifx\pgffor@test\pgfutil@empty%
- \def\pgffor@valuerest{#1//\relax}% repeat
+ \expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@temp//\relax}% repeat
\else%
\def\pgffor@valuerest{#2/\relax}%
\fi%
- \expandafter\def\pgffor@currentvar{#1}%
+ \expandafter\expandafter\expandafter\def\expandafter\pgffor@currentvar\expandafter{\pgffor@temp}%
+ %
\expandafter\pgffor@multiassign\pgffor@rest/\relax%
-}
-
-
+}
+\def\pgffor@gobblespaces#1{\pgfutil@ifnextchar x{#1}{#1}}
\def\pgffor@handledots{%
- \ifx\pgffor@last\pgfutil@empty%
- \PackageError{pgffor}{``...'' not allowed without prior value}{}%
- \fi%
- \pgffor@dotsscanend%
+ \pgffor@gobblespaces{\expandafter\pgffor@@handledots\pgffor@value\pgffor@@stop}%
+}
+
+\newif\ifpgffor@context
+
+\def\pgffor@@handledots#1...#2\pgffor@@stop{%
+ % Define the context if any.
+ \def\pgffor@dots@pre{#1}%
+ \def\pgffor@dots@post{#2}%
+ \def\pgffor@dots@stripcontext#1##1#2\pgffor@@stop{\def\pgffor@dotsvalue{##1}}%
+ \pgffor@contexttrue%
+ \ifx\pgffor@dots@pre\pgfutil@empty%
+ \ifx\pgffor@dots@post\pgfutil@empty%
+ \pgffor@contextfalse%
+ \def\pgffor@dots@stripcontext##1\pgffor@@stop{\def\pgffor@dotsvalue{##1}}%
+ \fi%
+ \fi%
+ \pgffor@gobblespaces{\pgffor@dotsscanend}%
}
+
+\def\pgffor@dots@value@process#1{%
+ \expandafter\pgffor@dots@stripcontext#1\pgffor@@stop%
+ \expandafter\pgffor@dots@charcheck\pgffor@dotsvalue\pgffor@@stop%
+ \let#1=\pgffor@dotsvalue%
+}
+
\def\pgffor@dotsscanend#1,{%
- \def\pgffor@dotsend{#1}%
+ \pgffor@alphabeticsequencefalse%
+ % Strip context and check for a character sequence.
+ \def\pgffor@dotsend{#1}%
+ \pgffor@dots@value@process{\pgffor@dotsend}%
+ %
+ \pgffor@dots@value@process{\pgffor@last}%
+ %
% calculate skip%
\ifx\pgffor@prevlast\pgfutil@empty%
\ifdim\pgffor@dotsend pt>\pgffor@last pt%
@@ -174,6 +301,7 @@
\pgffor@skip=-1pt%
\fi%
\else%
+ \pgffor@dots@value@process{\pgffor@prevlast}%
\pgffor@skip=\pgffor@last pt%
\pgffor@iter=\pgffor@prevlast pt%
\advance\pgffor@skip by-\pgffor@iter%
@@ -197,19 +325,20 @@
\fi%
\ifpgffor@continue%
\else%
- \let\pgffor@next=\pgffor@endloop% done!
+ \let\pgffor@next=\pgffor@endloop% Done!
\fi%
\pgffor@next%
}
\def\pgffor@endloop{%
- \pgffor@scan%
+ \pgffor@alphabeticsequencefalse%
+ \pgffor@scan%
}
{\catcode`\p=12\catcode`\t=12\gdef\Pgffor@geT#1pt{#1}}
\def\pgffor@doloop{%
- \begingroup%
+ \pgffor@begingroup
\edef\pgffor@temp{\expandafter\Pgffor@geT\the\pgffor@iter}%
\edef\pgffor@incheck{{.0/}{\pgffor@temp/}}%
\expandafter\pgfutil@in@\pgffor@incheck%
@@ -221,16 +350,392 @@
\expandafter\def\expandafter\pgffor@valuerest\expandafter{\pgffor@temp//\relax}%
\expandafter\pgffor@multiassign\pgffor@var/\pgffor@stop/\pgffor@stop/\relax%
\else%
- \expandafter\expandafter\expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@temp}%
+ % Convert to alphabetic sequence, if necessary.
+ \ifpgffor@alphabeticsequence%
+ \pgffor@makealphabetic\pgffor@temp%
+ \expandafter\let\pgffor@var=\pgffor@temp%
+ \else%
+ \expandafter\expandafter\expandafter\def\expandafter\pgffor@var\expandafter{\pgffor@temp}%
+ \fi%
\fi%
+ % Insert any context, if any.
+ \ifpgffor@context%
+ \let\pgffor@temp=\pgffor@dots@pre%
+ \expandafter\pgfutil@append@macrotomacro\expandafter%
+ {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@var}%
+ \expandafter\pgfutil@append@macrotomacro\expandafter%
+ {\expandafter\pgffor@temp\expandafter}\expandafter{\pgffor@dots@post}%
+ \expandafter\let\pgffor@var=\pgffor@temp%
+ \fi%
+ % Perform assignments before loop body.
+ \ifx\pgffor@assign@before@code\pgfutil@empty%
+ \else%
+ \pgffor@assign@before@code%
+ \fi%
+ %
\expandafter\pgffor@beginhook\pgffor@body\pgffor@endhook%
- \endgroup%
+ %
+ % Perform assignments after loop body.
+ \ifx\pgffor@assign@after@code\pgfutil@empty%
+ \else%
+ \pgffor@assign@after@code%
+ \fi%
+ \pgffor@endgroup%
\pgffor@loop%
}
\def\pgffor@strip#1.0{\def\pgffor@temp{#1}}
-
\def\breakforeach{\global\pgffor@continuefalse}
+\def\pgffor@gobbletil@pgffor@@stop#1\pgffor@@stop{}
+
+
+\newif\ifpgffor@registeriscount
+
+\def\pgffor@ifcsregister#1{%
+ \expandafter\pgffor@@ifcsregister\meaning#1\pgffor@stop}
+
+\def\pgffor@@ifcsregister#1#2#3#4#5\pgffor@stop{%
+ \if#1m% It is an ordinary (m)acro.
+ \pgffor@registeriscountfalse%
+ \let\pgffor@csnext=\pgfutil@secondoftwo%
+ \else%
+ \if#1u% It is (u)ndefined.
+ \let\pgffor@csnext=\pgfutil@secondoftwo%
+ \pgffor@registeriscountfalse%
+ \else%
+ \let\pgffor@csnext=\pgfutil@firstoftwo%
+ \if#4u% It is a co(u)nt
+ \pgffor@registeriscounttrue%
+ \else% Assume it is a dimen or skip (bad assumption in the general case).
+ \pgffor@registeriscountfalse%
+ \let\pgffor@csnext=\pgfutil@firstoftwo%
+ \fi%
+ \fi%
+ \fi%
+ \pgffor@csnext}
+
+\newif\ifpgffor@alphabeticsequence
+
+%
+\def\pgffor@dots@charcheck#1\pgffor@@stop{%
+ \edef\pgffor@dots@charcheck@temp{#1}%
+ \expandafter\expandafter\expandafter\pgffor@@dotscharcheck\expandafter\meaning\pgffor@dots@charcheck@temp\pgffor@@stop%
+}
+\def\pgffor@@dotscharcheck#1#2\pgffor@@stop{%
+ \if#1t%
+ \afterassignment\pgffor@gobbletil@pgffor@@stop%
+ \expandafter\chardef\expandafter\pgffor@char\expandafter=\expandafter`\pgffor@dots@charcheck@temp\relax\pgffor@@stop%
+ \edef\pgffor@char{\the\pgffor@char}%
+ \ifnum\pgffor@char>64\relax% From A-Z?
+ \ifnum\pgffor@char<91\relax%
+ \let\pgffor@dotsvalue=\pgffor@char%
+ \pgffor@alphabeticsequencetrue%
+ \else%
+ \ifnum\pgffor@char>96\relax% From a-z?
+ \ifnum\pgffor@char<123\relax%
+ \let\pgffor@dotsvalue=\pgffor@char%
+ \pgffor@alphabeticsequencetrue%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgffor@makealphabetic#1{%
+ % Convert the number in the macro passed as #1 to a-z or A-Z.
+ \pgfutil@tempcnta=#1\relax%
+ \ifnum\pgfutil@tempcnta>95\relax%
+ \advance\pgfutil@tempcnta by-96%
+ \expandafter\def\expandafter#1\expandafter%
+ {\pgffor@alpha\pgfutil@tempcnta}%
+ \else%
+ \advance\pgfutil@tempcnta by-64%
+ \expandafter\def\expandafter#1\expandafter%
+ {\pgffor@Alpha\pgfutil@tempcnta}%
+ \fi%
+}
+
+\def\pgffor@Alpha#1{%
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
+ \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else?\fi%
+}
+
+\def\pgffor@alpha#1{%
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
+ \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else?\fi%
+}
+
+\newtoks\pgffor@toks
+
+\def\pgffor@addcstotoks#1{%
+ \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter\def\expandafter#1\expandafter{#1}}%
+ \pgffor@@addcstotoks}
+
+\def\pgffor@addregtotoks#1{%
+ \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\expandafter#1\expandafter=\the#1}%
+ \pgffor@@addcstotoks}
+
+\def\pgffor@addiftotoks#1{%
+ \begingroup%
+ \escapechar=-1\relax%
+ \expandafter\pgffor@@addiftotoks\string#1\pgffor@stop}
+\def\pgffor@@addiftotoks#1#2#3#4#5\pgffor@stop{%
+ \endgroup
+ \csname if#4#5\endcsname%
+ \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#4#5true\endcsname}%
+ \else%
+ \expandafter\def\expandafter\pgffor@tokstemp\expandafter{\csname#4#5false\endcsname}%
+ \fi%
+ \pgffor@@addcstotoks%
+}
+
+\def\pgffor@@addcstotoks{%
+ \expandafter\expandafter\expandafter\pgffor@toks\expandafter\expandafter\expandafter=%
+ \expandafter\expandafter\expandafter{\expandafter\pgffor@tokstemp\the\pgffor@toks}%
+}
+
+% Set up the pgffor scopes.
+
+\def\pgffor@atbeginforeach{%
+ \begingroup%
+}
+
+\def\pgffor@atendforeach{%
+ \global\edef\pgffor@remember@expanded{\pgffor@remember@code}%
+ \endgroup%
+ \ifx\pgffor@remember@expanded\pgfutil@empty%
+ \else%
+ \pgffor@remember@expanded%
+ \global\let\pgffor@remember@expanded=\pgfutil@empty%
+ \fi%
+}
+\def\pgffor@default@begingroup{%
+ \begingroup%
+}
+
+\let\pgffor@remember@once@expanded=\pgfutil@empty
+\let\pgffor@remember@expanded=\pgfutil@empty
+
+\def\pgffor@default@endgroup{%
+ \ifx\pgffor@assign@once@code\pgfutil@empty%
+ \else%
+ \global\edef\pgffor@remember@once@expanded{\pgffor@remember@once@code}%
+ \fi%
+ \ifx\pgffor@remember@code\pgfutil@empty%
+ \else%
+ \global\edef\pgffor@remember@expanded{\pgffor@remember@code}%
+ \fi%
+ \endgroup%
+ %
+ \ifx\pgffor@remember@once@expanded\pgfutil@empty%
+ \else%
+ \pgffor@remember@once@expanded%
+ \let\pgffor@assign@once@code=\pgfutil@empty%
+ \global\let\pgffor@remember@once@expanded=\pgfutil@empty%
+ \fi%
+ %
+ \ifx\pgffor@remember@expanded\pgfutil@empty%
+ \else%
+ \pgffor@remember@expanded%
+ \global\let\pgffor@remember@expanded=\pgfutil@empty%
+ \fi%
+}
+
+\let\pgffor@begingroup=\pgffor@default@begingroup
+\let\pgffor@endgroup=\pgffor@default@endgroup
+
+
+\def\pgffor@stack@begingroup{%
+ \pgffor@toks={}%
+ \pgffor@addcstotoks{\pgffor@mainvar}%
+ \pgffor@addcstotoks{\pgffor@var}%
+ \pgffor@addcstotoks{\pgffor@body}%
+ %
+ \pgffor@addcstotoks{\pgffor@last}%
+ \pgffor@addcstotoks{\pgffor@prevlast}%
+ \pgffor@addcstotoks{\pgffor@dotsend}%
+ %
+ \pgffor@addcstotoks{\pgffor@assign@before@code}%
+ \pgffor@addcstotoks{\pgffor@assign@after@code}%
+ \pgffor@addcstotoks{\pgffor@remember@code}%
+ \pgffor@addcstotoks{\pgffor@remember@once@code}%
+ \pgffor@addcstotoks{\pgffor@dots@pre}%
+ \pgffor@addcstotoks{\pgffor@dots@post}%
+ %
+ \pgffor@addregtotoks{\pgffor@iter}%
+ \pgffor@addregtotoks{\pgffor@skip}%
+ %
+ \pgffor@addiftotoks{\ifpgffor@alphabeticsequence}%
+ \pgffor@addiftotoks{\ifpgffor@context}%
+ \expandafter\pgffor@stackpush\expandafter{\the\pgffor@toks}%
+}
+
+\def\pgffor@stack@endgroup{\pgffor@stackpop}
+
+% Keys stuff.
+
+\newif\ifpgffor@assign@evaluate
+\newif\ifpgffor@assign@once
+
+\pgfkeys{/pgf/foreach/.cd,
+ var/.code=\pgffor@var@add#1\pgffor@stop,
+ scope iterations/.code={
+ \csname if#1\endcsname%
+ \let\pgffor@begingroup=\pgffor@default@begingroup%
+ \let\pgffor@endgroup=\pgffor@default@endgroup%
+ \else%
+ \let\pgffor@begingroup=\pgffor@stack@begingroup%
+ \let\pgffor@endgroup=\pgffor@stack@endgroup%
+ \fi%
+ },
+ evaluate/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncefalse\pgffor@assign@parse{#1},%
+ assign/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncefalse\pgffor@assign@parse{#1},%
+ evaluate once/.code=\pgffor@assign@evaluatetrue\pgffor@assign@oncetrue\pgffor@assign@parse{#1},%
+ assign once/.code=\pgffor@assign@evaluatefalse\pgffor@assign@oncetrue\pgffor@assign@parse{#1},%
+ remember/.code=\pgffor@remember@parse{#1},%
+ count/.code=\pgffor@count@parse#1\pgffor@stop
+}
+
+\def\pgffor@assign@parse#1{%
+ \pgfutil@in@;{#1}%
+ \ifpgfutil@in@%
+ \else%
+ \pgfutil@in@={#1}%
+ \fi%
+ \ifpgfutil@in@%
+ \pgffor@assign@@parse#1;\pgffor@stop;%
+ \else%
+ \pgffor@assign@parse@old#1\pgffor@stop%%
+ \fi%
+}
+
+\def\pgffor@stop{\pgffor@stop}
+\def\pgffor@assign@@parse#1;{%
+ \def\pgffor@test{#1}%
+ \ifx\pgffor@test\pgffor@stop%
+ \let\pgffor@next=\relax%
+ \else%
+ \let\pgffor@next=\pgffor@assign@@parse%
+ \ifx\pgffor@test\pgfutil@empty%
+ \else%
+ \pgfutil@in@={#1}%
+ \ifpgfutil@in@%
+ \pgffor@assign@@@parse#1\pgffor@stop%
+ \else%
+ \pgffor@assign@@@parse#1=#1\pgffor@stop%
+ \fi%
+ \fi%
+ \fi%
+ \pgffor@next}
+
+\def\pgffor@assign@@@parse#1=#2\pgffor@stop{%
+ \ifpgffor@assign@evaluate%
+ \ifpgffor@assign@once%
+ \pgfutil@append@tomacro{\pgffor@assign@once@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}%
+ \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}%
+ \else
+ \pgfutil@append@tomacro{\pgffor@assign@before@code}{\pgfmathparse{#2}\let#1=\pgfmathresult}%
+ \fi%
+ \else%
+ \ifpgffor@assign@once%
+ \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#1{#2}}%
+ \pgfutil@append@tomacro{\pgffor@remember@once@code}{\noexpand\def\noexpand#1{#2}}%
+ \else
+ \pgfutil@append@tomacro{\pgffor@assign@before@code}{\def#1{#2}}%
+ \fi%
+ \fi%
+}
+
+\def\pgffor@assign@parse@old#1#2\pgffor@stop{%
+ \pgffor@assign@@parse@old#2\pgffor@stop as#1using #1\pgffor@@stop}
+
+\def\pgffor@assign@@parse@old#1as#2#3\pgffor@@stop{%
+ \pgffor@assign@@@parse@old{#2}#1#3\pgffor@stop\pgffor@@stop}
+
+\def\pgffor@assign@@@parse@old#1#2using #3\pgffor@stop#4\pgffor@@stop{%
+ \pgffor@assign@@@parse#1=#3\pgffor@stop}
+
+
+
+\def\pgffor@remember@parse#1{%
+ \pgfutil@in@ a{#1}% This matches the 'a' in 'as' or 'intially'.
+ \ifpgfutil@in@%
+ \pgffor@remember@parse@old#1\pgffor@stop%
+ \else%
+ \pgffor@remember@@parse#1;\pgffor@stop;%
+ \fi%
+}
+
+\def\pgffor@remember@@parse#1;{%
+ \def\pgffor@test{#1}%
+ \ifx\pgffor@test\pgffor@stop%
+ \let\pgffor@next=\relax%
+ \else%
+ \let\pgffor@next=\pgffor@remember@@parse%
+ \ifx\pgffor@test\pgfutil@empty%
+ \else%
+ \pgfutil@in@={#1}%
+ \ifpgfutil@in@%
+ \pgffor@remember@@@parse#1\pgffor@stop%
+ \else%
+ \pgffor@ifcsregister{#1}{%
+ \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand#1=\the#1\noexpand\relax}%
+ }%
+ {%
+ \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \pgffor@next%
+}
+
+\def\pgffor@remember@@@parse#1=#2\pgffor@stop{%
+ \pgffor@ifcsregister{#2}{%
+ \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{\the#2}}%
+ \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}%
+ }%
+ {%
+ \pgfutil@append@tomacro{\pgffor@assign@after@code}{\expandafter\def\expandafter#1\expandafter{#2}}%
+ \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#1{#1}}%
+ }%
+}
+
+\def\pgffor@remember@parse@old#1#2\pgffor@stop{%
+ \pgffor@remember@@parse@old#1#2\pgffor@stop as#1(initially )\pgffor@@stop}
+
+\def\pgffor@remember@@parse@old#1#2as#3#4\pgffor@@stop{%
+ \pgffor@remember@@@parse@old{#1}{#3}#2#4\pgffor@stop\pgffor@@stop}
+
+\def\pgffor@remember@@@parse@old#1#2#3(initially #4)#5\pgffor@stop#6\pgffor@@stop{%
+ \pgfutil@append@tomacro{\pgffor@assign@after@code}{\edef#2{#1}}%
+ \pgfutil@append@tomacro{\pgffor@remember@code}{\noexpand\def\noexpand#2{#2}}%
+ \def\pgffor@test{#4}%
+ \ifx\pgffor@test\pgfutil@empty%
+ \else%
+ \pgfutil@append@tomacro{\pgffor@assign@once@code}{\def#2{#4}}%
+ \fi%
+}
+
+\def\pgffor@count@parse#1#2\pgffor@stop{%
+ \pgffor@count@@parse#1#2\pgffor@stop from 1\pgffor@stop\pgffor@@stop}
+
+\def\pgffor@count@@parse#1#2from#3\pgffor@stop#4\pgffor@@stop{%
+ \pgfutil@append@tomacro\pgffor@remember@code{\noexpand\def\noexpand#1{#1}}%
+ \pgfutil@append@tomacro\pgffor@assign@before@code{\pgfmathparse{int(#1+1)}\let#1=\pgfmathresult}%
+ \pgfmathparse{int(#3-1)}\let#1=\pgfmathresult%
+}
+
+
+\def\pgfutil@append@macrotomacro#1#2{%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
+ #1\expandafter\expandafter\expandafter{\expandafter#1#2}}
+
+\def\pgfutil@append@tomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}}
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
index dd660fd6ab7..86e0499ded7 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
@@ -8,7 +8,9 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-% This file is perfectly self-contained, except that the catcode of @ should be made a letter.
+% The files pgfkeys.code.tex and pgfkeysfiltered.code.tex are
+% perfectly self-contained, except that the catcode of @
+% should be made a letter.
% Guard against reading twice
@@ -64,7 +66,7 @@
% \pgfkeyssetvalue{/tikz/length}{2cm-3cm}
% \pgfkeyssetvalue{/algo/swap}{{#2}{#1}}
-\def\pgfkeyssetvalue#1#2{%
+\long\def\pgfkeyssetvalue#1#2{%
\pgfkeys@temptoks{#2}\expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}%
}
@@ -85,13 +87,13 @@
%
% \pgfkeysaddvalue{/tikz/length}{}{-3cm}
-\def\pgfkeysaddvalue#1#2#3{%
+\long\def\pgfkeysaddvalue#1#2#3{%
{%
- \toks0{#1}%
+ \toks0{#2}%
\pgfkeysifdefined{#1}
{\pgfkeys@temptoks\expandafter\expandafter\expandafter{\csname pgfk@#1\endcsname}}%
{\pgfkeys@temptoks{}}%
- \toks1{#2}%
+ \toks1{#3}%
\xdef\pgfkeys@global@temp{\the\toks0 \the\pgfkeys@temptoks \the\toks1}% believe or don't: the spaces are important
}%
\pgfkeyslet{#1}\pgfkeys@global@temp%
@@ -169,8 +171,20 @@
%
% \pgfkeysifdefined{/tikz/length}{key exists}{does not exist}
-\def\pgfkeysifdefined#1#2#3{\pgfkeys@ifcsname pgfk@#1\endcsname#2\else#3\fi}
+\long\def\pgfkeysifdefined#1#2#3{\pgfkeys@ifcsname pgfk@#1\endcsname#2\else#3\fi}
+% Tests whether a key is assignable. For standard keys which just
+% store their value, this is identical to \pgfkeysifdefined.
+%
+% But \pgfkeysifassignable is true for command keys as well (but not
+% for handled keys).
+\long\def\pgfkeysifassignable#1#2#3{%
+ \pgfkeysifdefined{#1}%
+ {#2}
+ {\pgfkeysifdefined{#1/.@cmd}%
+ {#2}%
+ {#3}}%
+}%
@@ -259,7 +273,7 @@
\let\pgfkeysdefaultpath\pgfkeys@root
\def\pgfkeys{\expandafter\pgfkeys@@set\expandafter{\pgfkeysdefaultpath}}%
-\def\pgfkeys@@set#1#2{%
+\long\def\pgfkeys@@set#1#2{%
\let\pgfkeysdefaultpath\pgfkeys@root%
\pgfkeys@parse#2,\pgfkeys@mainstop%
\def\pgfkeysdefaultpath{#1}}
@@ -272,7 +286,7 @@
\expandafter\pgfkeys@normal%
\fi%
}
-\def\pgfkeys@normal#1,{%
+\long\def\pgfkeys@normal#1,{%
\pgfkeys@unpack#1=\pgfkeysnovalue=\pgfkeys@stop%
\pgfkeys@parse%
}
@@ -284,7 +298,7 @@
\def\pgfkeysnovalue@text{\pgfkeysnovalue}
\def\pgfkeysvaluerequired{\pgfkeysvaluerequired} % equals only itself
-\def\pgfkeys@unpack#1=#2=#3\pgfkeys@stop{%
+\long\def\pgfkeys@unpack#1=#2=#3\pgfkeys@stop{%
\pgfkeys@spdef\pgfkeyscurrentkey{#1}%
\edef\pgfkeyscurrentkey{\pgfkeyscurrentkey}%
\ifx\pgfkeyscurrentkey\pgfkeys@empty%
@@ -326,6 +340,10 @@
}
+% either handled key or unknown.
+%
+% This macro will be replaced by the /handler config/handle only existing
+% configuration, see below.
\def\pgfkeys@case@three{%
\pgfkeys@split@path%
\pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}%
@@ -333,6 +351,80 @@
\expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov}
{\pgfkeys@unknown}%
}
+\let\pgfkeys@case@three@handleall=\pgfkeys@case@three
+\def\pgfkeys@case@three@handle@restricted{%
+ \pgfkeys@split@path%
+ \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{%
+ \pgfkeys@ifexecutehandler{%
+ \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ }{%
+ % this here is necessary: /my search path/key/.code
+ % won't be called, so \pgfkeyscurrentpath == '/my search path/key'
+ % -> it should be one directory higher! We want to invoke the
+ % .unknown handler in
+ % '/my search path'
+ %
+ % Idea:
+ % set
+ % - path := '/my search path'
+ % - name := 'key/.code'
+ % - key = '/my search path/key/.code'
+ \let\pgfkeys@temp=\pgfkeyscurrentkey
+ \let\pgfkeys@tempb=\pgfkeyscurrentname
+ \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}%
+ \pgfkeys@split@path%
+ \let\pgfkeyscurrentkey=\pgfkeys@temp
+ \edef\pgfkeyscurrentname{\pgfkeyscurrentname/\pgfkeys@tempb}%
+ \pgfkeys@unknown
+ }%
+ }{%
+ \pgfkeys@unknown
+ }%
+}
+
+% this macro is to implement the |handly only existing| key in key filtering:
+% #1: the code to invoke IF the key handler shall be executed
+% #2: the code to invoke if it shall not run.
+\def\pgfkeys@ifexecutehandler#1#2{#1}%
+\let\pgfkeys@ifexecutehandler@handleall=\pgfkeys@ifexecutehandler
+\def\pgfkeys@ifexecutehandler@handleonlyexisting#1#2{%
+ \pgfkeys@ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname%
+ #1% ok, this particular key handler is known and should be processed in any case (for example .try)
+ \else
+ % implement the 'only existing' feature here:
+ \pgfkeysifdefined{\pgfkeyscurrentpath}{#1}{%
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}{#1}{#2}%
+ }{}%
+ \fi%
+}%
+\def\pgfkeys@ifexecutehandler@handlefullorexisting#1#2{%
+ \ifpgfkeysaddeddefaultpath
+ \pgfkeys@ifcsname pgfk@excpt@\pgfkeyscurrentname\endcsname%
+%\message{ifexecutehandler(\pgfkeyscurrentkeyRAW, path \pgfkeysdefaultpath): '\pgfkeyscurrentname' is an exception; processing it (on \pgfkeyscurrentpath).}%
+ #1% ok, this particular key handler is known and be processed in any case (for example .try)
+ \else
+ % implement the 'only existing' feature here:
+ \pgfkeysifdefined{\pgfkeyscurrentpath}{%
+%\message{ifexecutehandler(\pgfkeyscurrentkeyRAW, path \pgfkeysdefaultpath): '\pgfkeyscurrentpath' does exist. Executing '\pgfkeyscurrentname'.}%
+ #1%
+ }{%
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}{%
+%\message{ifexecutehandler(\pgfkeyscurrentkeyRAW, path \pgfkeysdefaultpath): '\pgfkeyscurrentpath/.@cmd' does exist. Executing '\pgfkeyscurrentname'.}%
+ #1%
+ }{%
+%\message{ifexecutehandler(\pgfkeyscurrentkeyRAW, path \pgfkeysdefaultpath): '\pgfkeyscurrentpath' does NOT exist. Skipping '\pgfkeyscurrentname'.}%
+ #2%
+ }%
+ }%
+ \fi%
+ \else
+%\message{ifexecutehandler(\pgfkeyscurrentkeyRAW, path \pgfkeysdefaultpath): Fully qualified key provided. Executing '\pgfkeyscurrentname'.}%
+ #1% ok, always true if the USER explicitly provided the full key path.
+ \fi
+}%
+\def\pgfkeysaddhandlyonlyexistingexception#1{\expandafter\def\csname pgfk@excpt@#1\endcsname{1}}%
+
\def\pgfkeys@unknown{%
\pgfkeysifdefined{\pgfkeyscurrentpath/.unknown/.@cmd}%
@@ -346,8 +438,8 @@
}
-\def\pgfkey@argumentisspace#1{%
- \def\pgfkeys@spdef##1##2{%
+\long\def\pgfkey@argumentisspace#1{%
+ \long\def\pgfkeys@spdef##1##2{%
\futurelet\pgfkeys@possiblespace\pgfkeys@sp@a##2\pgfkeys@stop\pgfkeys@stop#1\pgfkeys@stop\relax##1}%
\def\pgfkeys@sp@a{%
\ifx\pgfkeys@possiblespace\pgfkeys@sptoken%
@@ -355,10 +447,10 @@
\else%
\expandafter\pgfkeys@sp@b\expandafter#1%
\fi}%
- \def\pgfkeys@sp@b#1##1 \pgfkeys@stop{\pgfkeys@sp@c##1}%
+ \long\def\pgfkeys@sp@b#1##1 \pgfkeys@stop{\pgfkeys@sp@c##1}%
}
\pgfkey@argumentisspace{ }
-\def\pgfkeys@sp@c#1\pgfkeys@stop#2\relax#3{\pgfkeys@temptoks{#1}\edef#3{\the\pgfkeys@temptoks}}
+\long\def\pgfkeys@sp@c#1\pgfkeys@stop#2\relax#3{\pgfkeys@temptoks{#1}\edef#3{\the\pgfkeys@temptoks}}
{\def\:{\global\let\pgfkeys@sptoken= } \: }
@@ -367,6 +459,7 @@
% \pgfkeyscurrentkey does not start with /
\expandafter\futurelet\expandafter\pgfkeys@possibleslash\expandafter\pgfkeys@check@slash\pgfkeyscurrentkey\relax%
}
+\newif\ifpgfkeysaddeddefaultpath
\def\pgfkeys@check@slash{%
\ifx\pgfkeys@possibleslash/%
\expandafter\pgfkeys@nevermind%
@@ -375,8 +468,16 @@
\fi%
}
-\def\pgfkeys@nevermind#1\relax{}
-\def\pgfkeys@addpath#1\relax{\edef\pgfkeyscurrentkey{\pgfkeysdefaultpath#1}}
+\def\pgfkeys@nevermind#1\relax{%
+ \pgfkeysaddeddefaultpathfalse
+ \let\pgfkeyscurrentkeyRAW\pgfkeyscurrentkey
+}
+\def\pgfkeys@addpath#1\relax{%
+ \pgfkeysaddeddefaultpathtrue
+ \def\pgfkeyscurrentkeyRAW{#1}%
+ \edef\pgfkeyscurrentkey{\pgfkeysdefaultpath#1}%
+}
+
\def\pgfkeys@split@path{% Should assign the two codes
% \pgfkeyscurrentname and \pgfcurrentlkeypath
@@ -417,7 +518,7 @@
% \pgfqkeys{/tikz}{myother length/.code=\def\myotherlength{#1}\pgfkeysalso{length=#1}}
\def\pgfqkeys{\expandafter\pgfkeys@@qset\expandafter{\pgfkeysdefaultpath}}%
-\def\pgfkeys@@qset#1#2#3{\def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}}
+\long\def\pgfkeys@@qset#1#2#3{\def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}}
% Sets keys while setting keys
@@ -434,7 +535,7 @@
%
% \pgfkeys{tikz,myother length/.code=\def\myotherlength{#1}\pgfkeysalso{length=#1}}
-\def\pgfkeysalso#1{\pgfkeys@parse#1,\pgfkeys@mainstop}
+\long\def\pgfkeysalso#1{\pgfkeys@parse#1,\pgfkeys@mainstop}
@@ -454,7 +555,7 @@
% \begingroup
% \pgfqkeysalso{/tikz}{myother length/.code=\def\myotherlength{#1}\pgfkeysalso{length=#1}}
-\def\pgfqkeysalso#1#2{\def\pgfkeysdefaultpath{#1/}\pgfkeys@parse#2,\pgfkeys@mainstop}
+\long\def\pgfqkeysalso#1#2{\def\pgfkeysdefaultpath{#1/}\pgfkeys@parse#2,\pgfkeys@mainstop}
@@ -475,12 +576,12 @@
%
% \pgfkeysdef{/my key}{\show#1}
-\def\pgfkeysdef#1#2{%
- \def\pgfkeys@temp##1\pgfeov{#2}%
+\long\def\pgfkeysdef#1#2{%
+ \long\def\pgfkeys@temp##1\pgfeov{#2}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
}
-\def\pgfkeysedef#1#2{%
- \edef\pgfkeys@temp##1\pgfeov{#2}%
+\long\def\pgfkeysedef#1#2{%
+ \long\edef\pgfkeys@temp##1\pgfeov{#2}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
}
@@ -500,19 +601,98 @@
%
% \pgfkeysdefargs{/swap}{#1#2}{#2#1}
-\def\pgfkeysdefargs#1#2#3{%
- \def\pgfkeys@temp#2\pgfeov{#3}%
+\long\def\pgfkeysdefargs#1#2#3{%
+ \long\def\pgfkeys@temp#2\pgfeov{#3}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
\pgfkeyssetvalue{#1/.@args}{#2\pgfeov}%
\pgfkeyssetvalue{#1/.@body}{#3}%
}
-\def\pgfkeysedefargs#1#2#3{%
- \edef\pgfkeys@temp#2\pgfeov{#3}%
+\long\def\pgfkeysedefargs#1#2#3{%
+ \long\edef\pgfkeys@temp#2\pgfeov{#3}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
\pgfkeyssetvalue{#1/.@args}{#2\pgfeov}%
\pgfkeyssetvalue{#1/.@body}{#3}%
}
+% Like \pgfkeysdefargs, but `#2' is an integer denoting the expected
+% *number* of arguments.
+%
+% There is a subtle difference between the 'args' command, when it
+% comes to spaces:
+% a key defined with defargs{#1#2} must not have spaces between the
+% arguments when it is used.
+%
+% See this:
+%
+%--------------------------------------------------
+% % defnargs:
+% \pgfkeysdefnargs{/a}{2}{1=`#1', 2=`#2'}
+% \pgfkeys{
+% /a=
+% {1}
+% {2}
+% }
+% ->defnargs: 1=`1', 2=`2'
+%
+% defargs:
+% \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'}
+% \pgfkeys{
+% /b=
+% {1}
+% {2}
+% }
+% ->defargs: 1=`1', 2=` 2' (note the space!)
+%
+% defargs:
+% \pgfkeysdefargs{/b}{#1#2}{1=`#1', 2=`#2'}
+% \pgfkeys{
+% /b=
+% {1}%
+% {2}
+% }
+% ->defargs: 1=`1', 2=`2'
+%--------------------------------------------------
+\long\def\pgfkeysdefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\def}}%
+\long\def\pgfkeysedefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\edef}}%
+\long\def\pgfkeysdefnargs@#1#2#3#4{%
+ \ifcase#2\relax
+ \pgfkeyssetvalue{#1/.@args}{}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7##8}%
+ \or
+ \pgfkeyssetvalue{#1/.@args}{##1##2##3##4##5##6##7##8##9}%
+ \else
+ \pgfkeys@error{\string\pgfkeysdefnargs: expected <= 9 arguments, got #2}%
+ \fi
+ \pgfkeysgetvalue{#1/.@args}\pgfkeys@tempargs
+ \def\pgfkeys@temp{\expandafter#4\csname pgfk@#1/.@@body\endcsname}%
+ \expandafter\pgfkeys@temp\pgfkeys@tempargs{#3}%
+ % eliminate the \pgfeov at the end such that TeX gobbles spaces
+ % by using
+ % \pgfkeysdef{#1}{\pgfkeysvalueof{#1/.@@body}##1}
+ % (with expansion of '#1'):
+ \edef\pgfkeys@tempargs{\noexpand\pgfkeysvalueof{#1/.@@body}}%
+ \def\pgfkeys@temp{\pgfkeysdef{#1}}%
+ \expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}%
+ \pgfkeyssetvalue{#1/.@body}{#3}%
+}
+
% Defining a key command
@@ -521,8 +701,10 @@
\pgfkeysdef{/handlers/.code 2 args}{\pgfkeysdefargs{\pgfkeyscurrentpath}{##1##2}{#1}}
\pgfkeysdef{/handlers/.ecode}{\pgfkeysedef{\pgfkeyscurrentpath}{#1}}
\pgfkeysdef{/handlers/.ecode 2 args}{\pgfkeysedefargs{\pgfkeyscurrentpath}{##1##2}{#1}}
-\pgfkeysdefargs{/handlers/.code args}{#1#2}{\pgfkeysdefargs{\pgfkeyscurrentpath}{#1}{#2}}
-\pgfkeysdefargs{/handlers/.ecode args}{#1#2}{\pgfkeysedefargs{\pgfkeyscurrentpath}{#1}{#2}}
+\pgfkeysdefnargs{/handlers/.code args}{2}{\pgfkeysdefargs{\pgfkeyscurrentpath}{#1}{#2}}
+\pgfkeysdefnargs{/handlers/.ecode args}{2}{\pgfkeysedefargs{\pgfkeyscurrentpath}{#1}{#2}}
+\pgfkeysdefnargs{/handlers/.code n args}{2}{\pgfkeysdefnargs{\pgfkeyscurrentpath}{#1}{#2}}
+\pgfkeysdefnargs{/handlers/.ecode n args}{2}{\pgfkeysedefnargs{\pgfkeyscurrentpath}{#1}{#2}}
% Adding to a key command
@@ -530,22 +712,31 @@
% Find out, whether with args or not.
\pgfkeysifdefined{\pgfkeyscurrentpath/.@args}%
{% Yes, so add to body and reuse args
- \pgfkeysaddvalue{\pgfkeyscurrentpath/.@body}{#1}{#2}%
- % Redefine code
- \pgfkeysgetvalue{\pgfkeyscurrentpath/.@args}{\pgfkeys@tempargs}
- \pgfkeysgetvalue{\pgfkeyscurrentpath/.@body}{\pgfkeys@tempbody}
- \expandafter\expandafter\expandafter\def\expandafter\pgfkeys@temp\expandafter\pgfkeys@tempargs\expandafter{\pgfkeys@tempbody}%
- \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@temp}%
+ \pgfkeysaddvalue{\pgfkeyscurrentpath/.@body}{#1}{#2}%
+ % Redefine code
+ {%
+ \pgfkeysgetvalue{\pgfkeyscurrentpath/.@args}{\pgfkeys@tempargs}%
+ \pgfkeysgetvalue{\pgfkeyscurrentpath/.@body}{\pgfkeys@tempbody}%
+ \def\pgfkeys@marshal{\expandafter\gdef\expandafter\pgfkeys@global@temp\pgfkeys@tempargs}%
+ \expandafter\pgfkeys@marshal\expandafter{\pgfkeys@tempbody}%
+ }%
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@@body}{%
+ % support for \pgfkeysndefargs:
+ \pgfkeyslet{\pgfkeyscurrentpath/.@@body}{\pgfkeys@global@temp}%
+ }{%
+ % support for \pgfkeysdefargs:
+ \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@global@temp}%
+ }%
}%
{%
- % No, so single argument. Redefine accordingly.
+ % No, so single argument (simple \pgfkeysdef). Redefine accordingly.
{%
\toks0{#1}%
\pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}%
{\pgfkeys@temptoks\expandafter\expandafter\expandafter{\csname pgfk@\pgfkeyscurrentpath/.@cmd\endcsname##1\pgfeov}}%
{\pgfkeys@temptoks{}}%
\toks1{#2}%
- \xdef\pgfkeys@global@temp{\the\toks0 \the\pgfkeys@temptoks \the\toks1}%
+ \xdef\pgfkeys@global@temp{\the\toks0 \the\pgfkeys@temptoks \the\toks1 }%
}%
\expandafter\def\expandafter\pgfkeys@temp\expandafter##\expandafter1\expandafter\pgfeov\expandafter{\pgfkeys@global@temp}%
\pgfkeyslet{\pgfkeyscurrentpath/.@cmd}\pgfkeys@temp%
@@ -562,6 +753,7 @@
\pgfkeys{/handlers/.style args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.code args={#1}{\pgfkeysalso{#2}}}}
\pgfkeys{/handlers/.estyle args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.ecode args={#1}{\noexpand\pgfkeysalso{#2}}}}
\pgfkeys{/handlers/.style 2 args/.code=\pgfkeys{\pgfkeyscurrentpath/.code 2 args=\pgfkeysalso{#1}}}
+\pgfkeys{/handlers/.style n args/.code 2 args=\pgfkeys{\pgfkeyscurrentpath/.code n args={#1}{\pgfkeysalso{#2}}}}
% Adding to a style
@@ -574,7 +766,11 @@
\pgfkeys{/handlers/.initial/.code=\pgfkeyssetvalue{\pgfkeyscurrentpath}{#1}}
\pgfkeys{/handlers/.add/.code 2 args=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{#2}}
+\pgfkeys{/handlers/.prefix/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{}}
+\pgfkeys{/handlers/.append/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{}{#1}}
\pgfkeys{/handlers/.get/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath}{#1}}
+\pgfkeys{/handlers/.link/.code=\pgfkeyssetvalue{\pgfkeyscurrentpath}{\pgfkeysvalueof{#1}}}
+
% Defining a default
@@ -614,6 +810,26 @@
.unknown/.style={/errors/unknown choice value=\pgfkeyscurrentkey\pgfkeyscurrentvalue}}}
+% Repeatedly setting a key
+
+\pgfkeys{/handlers/.list/.code=%
+ {%
+ % Use foreach to unfold the list
+ \let\pgf@keys@temp=\pgfutil@empty%
+ \foreach \pgf@keys@key in{#1}%
+ {\expandafter\expandafter\expandafter\gdef%
+ \expandafter\expandafter\expandafter\pgf@keys@temp%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@keys@temp\expandafter{\pgf@keys@key}}}%
+ \edef\pgf@keys@list@path{\pgfkeyscurrentpath}%
+ \expandafter\expandafter\expandafter\pgf@keys@do@list%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@keys@list@path\expandafter}\pgf@keys@temp\pgf@stop%
+ }%
+}
+\def\pgf@keys@do@list#1{\pgfutil@ifnextchar\bgroup{\pgf@keys@do@list@item{#1}}\pgfutil@gobble}
+\def\pgf@keys@do@list@item#1#2{\pgfkeysalso{#1={#2}}\pgf@keys@do@list{#1}}
+
+
+
% Inspection handlers
\pgfkeys{/handlers/.show value/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath}{\pgfkeysshower}\show\pgfkeysshower} % inspect the value
@@ -622,8 +838,65 @@
% Path handling
-\pgfkeys{/handlers/.is family/.code=\pgfkeys{\pgfkeyscurrentpath/.ecode=\edef\noexpand\pgfkeysdefaultpath{\pgfkeyscurrentpath/}}}
-\pgfkeys{/handlers/.cd/.code=\edef\pgfkeysdefaultpath{\pgfkeyscurrentpath/}}
+% Prepares the .unknown handler used by '.search also'.
+% It will be stored into \pgfkeys@global@temp.
+\def\pgfkeys@searchalso@prepare@unknown@handler#1{%
+ \global\def\pgfkeys@global@temp##1\pgfeov{}%
+ \pgfkeys@searchalso@parse#1,\pgfkeys@mainstop
+ {%
+ \toks0=\expandafter{\pgfkeys@global@temp##1\pgfeov}%
+ \toks1={\def\pgfutilnext{\pgfkeysvalueof{/handlers/.unknown/.@cmd}##1\pgfeov}\pgfutilnext}%
+ \xdef\pgfkeys@global@temp{%
+ \noexpand\ifpgfkeysaddeddefaultpath
+ \noexpand\pgfkeyssuccessfalse
+ \noexpand\let\noexpand\pgfkeys@searchalso@name=\noexpand\pgfkeyscurrentkeyRAW
+ \the\toks0 % one or more /.try things; one for each path. The last element won't have a /.try
+ %\noexpand\ifpgfkeyssuccess
+ %\noexpand\else
+ % \the\toks1 % invoke /handlers/.unknown handler
+ %\noexpand\fi
+ \noexpand\else
+ \the\toks1 % invoke /handlers/.unknown handler
+ \noexpand\fi
+ }%
+ \expandafter\gdef\expandafter\pgfkeys@global@temp\expandafter##\expandafter1\expandafter\pgfeov\expandafter{\pgfkeys@global@temp}%
+ }%
+}%
+
+\def\pgfkeys@searchalso@parse{\futurelet\pgfkeys@possiblerelax\pgfkeys@searchalso@parse@main}
+\def\pgfkeys@searchalso@parse@main{%
+ \ifx\pgfkeys@possiblerelax\pgfkeys@mainstop%
+ \expandafter\pgfkeys@cleanup%
+ \else%
+ \expandafter\pgfkeys@searchalso@appendentry%
+ \fi%
+}
+\def\pgfkeys@searchalso@appendentry#1,#2{%
+ \def\pgfkeys@searchalso@nexttok{#2}%
+ \pgfkeys@spdef\pgfkeys@temp{#1}%
+ {%
+ \toks0=\expandafter{\pgfkeys@global@temp##1\pgfeov}%
+ \toks1=\expandafter{\pgfkeys@temp}%
+ \toks2={##1}%
+ \xdef\pgfkeys@global@temp{%
+ \the\toks0 % the space is important!
+ \noexpand\ifpgfkeyssuccess\noexpand\else
+ \noexpand\pgfqkeys{\the\toks1 }{\noexpand\pgfkeys@searchalso@name
+ \ifx\pgfkeys@searchalso@nexttok\pgfkeys@mainstop\else/.try\fi={\the\toks2 }}%
+ \noexpand\fi}%
+ \expandafter\gdef\expandafter\pgfkeys@global@temp\expandafter##\expandafter1\expandafter\pgfeov\expandafter{\pgfkeys@global@temp}%
+ }%
+ \pgfkeys@searchalso@parse#2%
+}
+\pgfkeys{%
+ /handlers/.is family/.code=\pgfkeys{\pgfkeyscurrentpath/.ecode=\edef\noexpand\pgfkeysdefaultpath{\pgfkeyscurrentpath/}},%
+ /handlers/.cd/.code=\edef\pgfkeysdefaultpath{\pgfkeyscurrentpath/},%
+ /handlers/.search also/.code={%
+ \pgfkeys@searchalso@prepare@unknown@handler{#1}%
+%\message{I prepared the '\pgfkeyscurrentpath/.unknown' handler \meaning\pgfkeys@global@temp\space for '#1'.}%
+ \pgfkeyslet{\pgfkeyscurrentpath/.unknown/.@cmd}{\pgfkeys@global@temp}%
+ }
+}%
% Value expansion
@@ -632,7 +905,7 @@
\pgfkeys{/handlers/.expand twice/.code=\expandafter\expandafter\expandafter\pgfkeys@exp@call\expandafter\expandafter\expandafter{#1}}
\pgfkeys{/handlers/.expanded/.code=\edef\pgfkeys@temp{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}}
-\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath=#1}}
+\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}}
% Try to set a key and do nothing if not define
@@ -640,14 +913,15 @@
\pgfkeys{/handlers/.try/.code=\pgfkeys@try}
\pgfkeys{/handlers/.retry/.code=\ifpgfkeyssuccess\else\pgfkeys@try\fi}
\def\pgfkeys@try{%
+ \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% make sure that \pgfkeys@code doesn't know about 'try'. Important for .is choice
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}}
+ {}% no default, so leave it
+ \fi%
\pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}%
{%
\pgfkeysgetvalue{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@code}%
- \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value
- \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}%
- {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}}
- {}% no default, so leave it
- \fi%
\expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov%
\pgfkeyssuccesstrue%
}%
@@ -661,7 +935,23 @@
\fi%
\pgfkeyssuccesstrue%
}%
- {\pgfkeyssuccessfalse}%
+ {%
+ \pgfkeys@split@path%
+ \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{%
+ % in the standard configuration, this check here is redundand
+ % because pgfkeys@ifexecutehandler === true.
+ % It is only interesting for 'handle only existing'.
+ \pgfkeys@ifexecutehandler{%
+ \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \pgfkeyssuccesstrue%
+ }{%
+ \pgfkeyssuccessfalse
+ }%
+ }{%
+ \pgfkeyssuccessfalse
+ }%
+ }%
}%
}
@@ -694,6 +984,29 @@
}
}
-
+\pgfkeys{
+ /handler config/.is choice,
+ /handler config/all/.code={%
+ \let\pgfkeys@case@three=\pgfkeys@case@three@handleall
+ \let\pgfkeys@ifexecutehandler=\pgfkeys@ifexecutehandler@handleall
+ },
+ /handler config/only existing/.code={%
+ \let\pgfkeys@case@three=\pgfkeys@case@three@handle@restricted
+ \let\pgfkeys@ifexecutehandler=\pgfkeys@ifexecutehandler@handleonlyexisting
+ },
+ /handler config/full or existing/.code={%
+ \let\pgfkeys@case@three=\pgfkeys@case@three@handle@restricted
+ \let\pgfkeys@ifexecutehandler=\pgfkeys@ifexecutehandler@handlefullorexisting
+ },
+ /handler config/only existing/add exception/.code={\pgfkeysaddhandlyonlyexistingexception{#1}},
+}%
+\pgfkeysaddhandlyonlyexistingexception{.cd}%
+\pgfkeysaddhandlyonlyexistingexception{.try}%
+\pgfkeysaddhandlyonlyexistingexception{.retry}%
+\pgfkeysaddhandlyonlyexistingexception{.lastretry}%
+\pgfkeysaddhandlyonlyexistingexception{.unknown}%
+
+
+\input pgfkeysfiltered.code.tex
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
new file mode 100644
index 00000000000..c46e418ddad
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
@@ -0,0 +1,1016 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% 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.
+%
+% This file contains additions to pgfkeys.code.tex (loaded
+% automatically at the end of pgfkeys.code.tex)
+%
+% Improvements:
+%
+% - option filtering
+% you provide
+% - a boolean predicate
+% - a "filter handler" which will be invoked for non-matching options,
+% - a key=value list as usual.
+% The filter sets only matching options and invokes the handler for
+% unmatching ones.
+%
+% - Fast family support as in xkeyval.
+% - A key like /my tree/my option can be associated with /my family
+% - You can efficiently set keys which belong to a set of "active"
+% families.
+% Remaining options can be collected into a macro.
+
+% WARNING:
+% this file overwrites
+% \pgfkeys@addpath
+% \pgfkeys@nevermind
+%
+% all other features are 'additive'
+
+
+% these implementations will be switched dynamically with their
+% filtered versions (in \pgfkeys@install@filter@and@invoke)
+\let\pgfkeys@orig@case@one=\pgfkeys@case@one
+\let\pgfkeys@orig@@set=\pgfkeys@@set
+\let\pgfkeys@orig@@qset=\pgfkeys@@qset
+\let\pgfkeys@orig@try=\pgfkeys@try
+\let\pgfkeys@orig@unknown=\pgfkeys@unknown
+
+\newif\ifpgfkeysfilteringisactive
+\newif\ifpgfkeysfiltercontinue
+\let\pgfkeys@key@predicate=\pgfkeys@empty
+\let\pgfkeys@filtered@handler=\pgfkeys@empty
+\newtoks\pgfkeys@tmptoks
+
+% Performs 'filtered' key settings.
+%
+% For every option for which the path prefixing has already been done,
+% the current key filter predicate will be invoked. If the predicate
+% returns true, pgfkeys will process this key in the normal manner.
+% If not, a key filter handler will be invoked.
+%
+% The *predicate* and *handler* semantics are as follows:
+% PRECONDITION:
+% 1. The variables
+% \pgfkeyscurrentkey (full path including name)
+% \pgfkeyscurrentkeyRAW (the current key as it has been
+% found in the key=value list
+% without path modification)
+% \pgfkeyscurrentvalue
+% are all set. If the current key is a handler variable,
+% \pgfkeyscurrentname
+% and
+% \pgfkeyscurrentpath
+% are also set.
+% 2. The type of option has already been checked, that means
+% case (1) whether '.@cmd' exists
+% case (2) whether the key as such has its value
+% case (3) it is a handler like '.code', '.cd' or whatever.
+% case (0) it is unknown.
+% The actual case number (0-3) will be provided as contents
+% of the macro
+% \pgfkeyscasenumber.
+% It is always a one-character token, so it may be compared
+% with both, \ifnum or \if.
+% Please note that unknown options will be processed with
+% the usual '.unknown' handlers unless the key filter takes
+% control over unknown options as well.
+%
+% POSTCONDITION:
+% the predicate sets
+% \pgfkeysfiltercontinuetrue
+% or
+% \pgfkeysfiltercontinuefalse
+% (the boolean \ifpgfkeysfiltercontinue).
+% Depending on this 'if', option processing will be continued or
+% skipped.
+%
+% The handler can do anything with the option, for example collect
+% unmatched ones.
+%
+% ATTENTION: \pgfkeysfiltered can't be nested (yet). Use the
+% \pgfkeyspredicateAND if you need multiple predicates at once.
+% Nesting would produce unexpected results because the current filter
+% state can't be stored/restored without TeX-groups, therefor it is
+% disabled.
+%
+% ATTENTION: you can't filter error messages.
+%
+% REMARK: In case (3), the macros \pgfkeyscurrentpath and
+% \pgfkeyscurrentname have already been computed, you do not need to
+% invoke \pgfkeyssplitpath. In any other case, neither path nor name
+% are required for the options processing - if you need them for
+% predicates/handlers, you need to compute them by hand.
+%
+%
+% Example:
+% \def\unmatched{}
+% \pgfkeys{/pgf/key filters/is descendant of/.install key filter=/my group}
+% \pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\unmatched}
+% \pgfkeysfiltered%
+% {/my group/option 1=value 1,/tikz/option 2=value 2}
+% ->
+% will set '/my group/option 1' as usual, but '/tikz/option 2' will not
+% be set. Instead, it will be appended to '\unmatched' such that
+% \unmatched = {/tikz/option 2=value2}
+% after the operation.
+%
+% Arguments:
+% #1: key-value list.
+\def\pgfkeysfiltered{%
+ % produce
+ % '{<default path>}'
+ % each expanded exactly one time into the register:
+ \expandafter\pgfkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}%
+}
+
+% #1: old value of default path.
+% #2: key-value-list.
+\def\pgfkeysfiltered@@install#1#2{%
+ \pgfkeys@install@filter@and@invoke{%
+ \let\pgfkeysdefaultpath\pgfkeys@root%
+ \pgfkeys@parse#2,\pgfkeys@mainstop%
+ \def\pgfkeysdefaultpath{#1}%
+ }%
+}
+
+% Assuming that macro #1 contains a key=value list, this command
+% performs an \pgfkeysalso command for the content of macro #1.
+%
+% It can be used in conjunction with
+% - \pgfkeysfiltered and
+% - \pgfkeysappendfilterednamestomacro:
+% the first pass fill only process options matching the filter, then,
+% a \pgfkeysalsofrom can be used at a later time to set the remaining
+% options.
+%
+% Example:
+% \pgfkeys{/my group/.cd,/utils/exec=\pgfkeysalsofrom\filtered}
+\long\def\pgfkeysalsofrom#1{%
+ \expandafter\pgfkeysalso\expandafter{#1}%
+}
+
+% The same as \pgfkeysalsofrom, but it invokes \pgfkeysalsofiltered.
+\long\def\pgfkeysalsofilteredfrom#1{%
+ \expandafter\pgfkeysalsofiltered\expandafter{#1}%
+}
+
+% #1 = options
+\long\long\def\pgfkeysalsofiltered#1{%
+ \pgfkeys@install@filter@and@invoke{\pgfkeysalso{#1}}%
+}%
+
+% The same like \pgfkeysfiltered, but with quick search path setting.
+%
+% #1: default path
+% #2: key-value-pairs
+\long\def\pgfqkeysfiltered#1{%
+ \expandafter\pgfqkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}{#1}%
+}
+
+% #1: old value of default path.
+% #2: default path
+% #3: key-value-list.
+\long\def\pgfqkeysfiltered@@install#1#2#3{%
+ \pgfkeys@install@filter@and@invoke{%
+ \def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}%
+ }%
+}
+
+% Family management
+%
+% The family code provides the following features:
+% 1. every key can be associated with 0 or 1 'family'.
+% 2. Families are a loose association which are independend of the key
+% hierarchy.
+% For example, /my tree/key1 can belong to family /tikz.
+%
+% 3. It is possible to "activate" or "deactivate" single families.
+% Furthermore, it is possible to set only keys which belong to
+% active families (using \pgfkeysfiltered).
+% 4. Runtime complexities:
+% If you have N options and you only want to process K active
+% families, the runtime is O( N + K ):
+% - activate every family O(K)
+% - use \pgfkeyshasactivefamily as filter predicate O(N)
+% - deactivate every family O(K)
+
+
+% Activates family #1.
+%
+% #1 maybe a macro.
+\def\pgfkeysactivatefamily#1{%
+ \pgfkeysiffamilydefined
+ {#1}%
+ {\csname pgfk@#1/familyactivetrue\endcsname}%
+ {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}%
+%\message{[ACTIVATING FAMILY #1]}%
+}
+
+% Deactivates family #1.
+%
+% #1 maybe a macro.
+\def\pgfkeysdeactivatefamily#1{%
+ \pgfkeysiffamilydefined
+ {#1}%
+ {\csname pgfk@#1/familyactivefalse\endcsname}%
+ {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}%
+%\message{[DEACTIVATING FAMILY #1]}%
+}
+
+% Activates all families in the comma separated list #1.
+%
+% It will also generate code for deactivation of all those families
+% into the command #2.
+%
+% #1: a comma-separated list of fully qualified family names.
+% #2: a command which will be filled with a deactivate-all command.
+\def\pgfkeysactivatefamilies#1#2{%
+ \pgfkeyssavekeyfilterstateto\pgfkeys@cur@state
+ \expandafter\pgfkeysactivatefamilies@impl\expandafter{\pgfkeys@cur@state}{#1}{#2}%
+}
+% #1: commands needed to restore the old filtering state
+% #2: family name list
+% #3: macro name for de-activate command
+\def\pgfkeysactivatefamilies@impl#1#2#3{%
+ \pgfkeysinstallkeyfilter{/pgf/key filters/false}{}%
+ \let#3=\pgfkeys@empty%
+ \def\pgfkeys@filtered@handler{\pgfkeys@family@activate@handler{#3}}%
+ \pgfkeysalsofiltered{#2}%
+ #1%
+}
+
+\def\pgfkeys@family@activate@handler#1{%
+ \pgfkeysactivatefamily{\pgfkeyscurrentkey}%
+ % produce
+ % <old list> '\pgfkeysdeactivatefamily{' <current key> '}'
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter\pgfkeysdeactivatefamily\expandafter{\pgfkeyscurrentkey}}%
+ \edef#1{\the\pgfkeys@tmptoks}%
+}
+
+% If for testing whether a family exists.
+%
+% #1 = fully qualified family name
+% #2 = if-case
+% #3 = else-case
+%
+% Description:
+%
+% If the family exists, #2 will be executed. Otherwise, #3 will be
+% called.
+\long\def\pgfkeysiffamilydefined#1#2#3{\pgfkeys@ifcsname ifpgfk@#1/familyactive\endcsname#2\else#3\fi}
+
+% Sets the TeX boolean
+% \ifpgfkeysfiltercontinue := ( family #1 is active )
+%
+% Argument:
+% #1 the family name. Maybe a macro.
+\def\pgfkeysisfamilyactive#1{%
+ \pgfkeysiffamilydefined{#1}{%
+ \expandafter\let\expandafter\ifpgfkeysfiltercontinue\csname ifpgfk@#1/familyactive\endcsname
+ }{%
+ \pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov%
+ \expandafter\expandafter\expandafter\let\csname ifpgfkeysfiltercontinue\endcsname\csname iffalse\endcsname
+ }%
+}%
+
+% Retrieve the family of full key #1 into macro #2.
+%
+% Will set the TeX boolean \ifpgfkeyssuccess to whether the full key
+% really has a family.
+%
+% The family for any key is stored in the sub-key #1/family.
+%
+% Parameters:
+% #1: the full key name for which the family is requested. Maybe a
+% macro.
+% #2: a macro name which will be filled with the result.
+\def\pgfkeysgetfamily#1#2{%
+ \pgfkeysifdefined{#1/family}{\pgfkeysgetvalue{#1/family}{#2}\pgfkeyssuccesstrue}{\pgfkeyssuccessfalse}%
+}
+
+% Equivalent to \pgfkeys{#1/.belongs to family=#2}
+\def\pgfkeyssetfamily#1#2{%
+ \pgfkeysiffamilydefined{#2}{%
+ \pgfkeyssetvalue{#1/family}{#2}%
+ }{%
+ \pgfkeysalso{/errors/family unknown=#2}%
+ }%
+}%
+
+
+% Sets \ifpgfkeysfiltercontinue to true iff the current key belongs to
+% the /errors tree.
+\long\def\pgfkeys@cur@is@descendant@of@errors{%
+ \expandafter\pgfkeys@cur@is@descendant@of@errors@impl\pgfkeyscurrentkey/errors\pgf@@eov
+}%
+\long\def\pgfkeys@cur@is@descendant@of@errors@impl#1/errors#2\pgf@@eov{%
+ \def\pgfkeyspred@TMP{#1}%
+ \ifx\pgfkeyspred@TMP\pgfkeys@empty
+%\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': TRUE.}%
+ \pgfkeysfiltercontinuetrue
+ \else
+%\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': FALSE.}%
+ \pgfkeysfiltercontinuefalse
+ \fi
+}%
+
+% \pgfkeysinterruptkeyfilter
+% ...
+% \endpgfkeysinterruptkeyfilter
+% temporarily interrupts key filtering and enables it in
+% \endpgfkeysinterruptkeyfilter.
+%
+% If key filtering it not active, this has no effect at all.
+%
+% REMARK:
+% \pgfkeysinterruptkeyfilter...\endpgfkeysinterruptkeyfilter does NOT
+% introduce a \TeX-group.
+\def\pgfkeysinterruptkeyfilter{%
+ \ifpgfkeysfilteringisactive
+ \let\pgfkeys@case@one=\pgfkeys@orig@case@one
+ \let\pgfkeys@try=\pgfkeys@orig@try
+ \let\pgfkeys@unknown=\pgfkeys@orig@unknown
+ \fi
+}
+
+\def\endpgfkeysinterruptkeyfilter{%
+ \ifpgfkeysfilteringisactive
+ \let\pgfkeys@case@one=\pgfkeys@case@one@filtered
+ \let\pgfkeys@try=\pgfkeys@try@filtered
+ \let\pgfkeys@unknown=\pgfkeys@unknown@filtered
+ \fi
+}
+
+% Activates families #1, calls \pgfkeysfiltered and deactivates the
+% families afterwards.
+%
+% REMARK: you need to install a family-based key filter predicate
+% manually to benefit from the activated families!
+%
+% #1: comma separated family list
+% #2: key-value pairs
+%
+% @see \pgfkeysactivatefamiliesandfilteroptions
+\def\pgfkeysactivatefamiliesandfilteroptions#1#2{%
+ \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}%
+ \pgfkeysfiltered{#2}%
+ \pgfkeys@family@deactivation
+}
+
+% The "quick" variant of \pgfkeysactivatefamiliesandfilteroptions: it
+% also assigns a default path.
+%
+% #1: comma separated family list
+% #2: default path
+% #3: key-value pairs
+\def\pgfqkeysactivatefamiliesandfilteroptions#1#2#3{%
+ \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}%
+ \pgfqkeysfiltered{#2}{#3}%
+ \pgfkeys@family@deactivation
+}
+
+% Public version of split path:
+\def\pgfkeyssplitpath{\pgfkeys@split@path}%
+
+
+% The same as \pgfkeysactivatefamiliesandfilteroptions but just for
+% ONE family.
+%
+% #1: family (maybe a macro)
+% #2: key-value pairs
+\def\pgfkeysactivatesinglefamilyandfilteroptions#1#2{%
+ \pgfkeysactivatefamily{#1}%
+ \pgfkeysfiltered{#2}%
+ \pgfkeysdeactivatefamily{#1}%
+}
+
+% The "quick" variant of \pgfkeysactivatesinglefamilyandfilteroptions
+%
+% #1: family (maybe a macro)
+% #2: default path
+% #3: key-value pairs
+\def\pgfqkeysactivatesinglefamilyandfilteroptions#1#2#3{%
+ \pgfkeysactivatefamily{#1}%
+ \pgfqkeysfiltered{#2}{#3}%
+ \pgfkeysdeactivatefamily{#1}%
+}
+
+% Installs the key filter '#1' with argument '#2'.
+% This is equivalent to
+% \pgfkeys{#1/.install key filter=#2}
+%
+% The current values of the key filter handler is stored into the public
+% macros
+% \pgfkeyscurrentkeyfilter
+% and
+% \pgfkeyscurrentkeyfilterargs
+%
+% #1: a full key name; may be a macro
+% #2: optional arguments for the key. If the key expects more than one
+% argument, supply '{{first}{second}}'
+\def\pgfkeysinstallkeyfilter#1#2{%
+ \pgfkeysifdefined{#1/.@cmd}{%
+ \edef\pgfkeyscurrentkeyfilter{#1}%
+ \def\pgfkeyscurrentkeyfilterargs{#2}%
+ \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@key@predicate@}%
+ \def\pgfkeys@key@predicate{\pgfkeys@key@predicate@#2\pgfeov}%
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter/.@cmd}{#1}{#2}\pgfeov%
+ }%
+}
+
+% Installs the key filter handler '#1' with argument '#2'.
+% This is equivalent to
+% \pgfkeys{#1/.install key filter handler=#2}
+%
+% The current values of the key filter handler is stored into the public
+% macros
+% \pgfkeyscurrentkeyfilterhandler
+% and
+% \pgfkeyscurrentkeyfilterhandlerargs
+%
+% #1: a full key name; may be a macro
+% #2: optional arguments for the handler. If the handler expects more than one
+% argument, supply '{{first}{second}}'
+\def\pgfkeysinstallkeyfilterhandler#1#2{%
+ \pgfkeysifdefined{#1/.@cmd}{%
+ \edef\pgfkeyscurrentkeyfilterhandler{#1}%
+ \def\pgfkeyscurrentkeyfilterhandlerargs{#2}%
+ \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@filtered@handler@}%
+ \def\pgfkeys@filtered@handler{\pgfkeys@filtered@handler@#2\pgfeov}%
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter handler/.@cmd}{#1}{#2}\pgfeov%
+ }%
+}
+
+% Creates a macro which contains commands to re-activate the current
+% key filter and key filter handler. It can be used to temporarily
+% switch the key filter.
+\def\pgfkeyssavekeyfilterstateto#1{%
+ % produce the string
+ % \pgfkeysinstallkeyfilter{...}{...}
+ % \pgfkeysinstallkeyfilterhandler{...}{...}
+ % where each argument is expanded once
+ % FIXME: Do the same with less overhead!
+ \pgfkeys@tmptoks={\pgfkeysinstallkeyfilter}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilter}}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterargs}\pgfkeysinstallkeyfilterhandler}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandler}}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandlerargs}}%
+ \edef#1{%
+ \the\pgfkeys@tmptoks
+ }%
+}
+
+
+\pgfkeys{%
+ /errors/family unknown/.code=\pgfkeys@error{%
+ Sorry, I do not know family '#1' and can't work with any assoicated family handling. Perhaps you misspelled it?},
+ /errors/no such key filter/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter '#1'.},
+ /errors/no such key filter handler/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter handler '#1'.},
+ % HANDLERS:
+ %
+ % .is family should
+ % 1. '.cd' into the families' path,
+ % 2. define booleans to activate/deactive the family
+ % (see \pgfkeysisfamilyactive)
+ % 3. make sure that \pgfkeyshasactivefamily returns true for
+ % the family itsself.
+ /handlers/.is family/.append code={%
+ %\newif is an \outer macro in plain tex, so this here is not portable:
+ %\expandafter\newif\csname if\pgfkeyscurrentpath/familyactive\endcsname
+ \edef\pgfkeyspred@TMP{pgfk@\pgfkeyscurrentpath/familyactive}%
+ \expandafter\pgfkeys@non@outer@newif\expandafter{\pgfkeyspred@TMP}%
+ \edef\pgfkeyspred@TMP{\pgfkeyscurrentpath/.belongs to family=\pgfkeyscurrentpath}%
+ \expandafter\pgfkeysalso\expandafter{\pgfkeyspred@TMP}%
+ },%
+ /handlers/.activate family/.code=\pgfkeysactivatefamily{\pgfkeyscurrentpath},
+ /handlers/.deactivate family/.code=\pgfkeysdeactivatefamily{\pgfkeyscurrentpath},
+ /handlers/.belongs to family/.code={\pgfkeyssetfamily{\pgfkeyscurrentpath}{#1}},%
+ %
+ %
+ % An addition to the '.try' and '.retry' handlers:
+ %
+ % It is the same as '.retry', but if the option is still unknown, the
+ % usual handlers for unknown keys will be invoked.
+ /handlers/.lastretry/.code={%
+ \ifpgfkeyssuccess\else
+ \pgfkeys@try
+ \ifpgfkeyssuccess\else
+ % discard the '.lastretry' suffix:
+ \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}%
+ \pgfkeys@split@path%
+ \pgfkeys@unknown
+ \fi
+ \fi
+ },
+ %
+ %
+ /handlers/.install key filter/.code={%
+ \pgfkeysinstallkeyfilter{\pgfkeyscurrentpath}{#1}%
+ },%
+ /handlers/.install key filter handler/.code={%
+ \pgfkeysinstallkeyfilterhandler{\pgfkeyscurrentpath}{#1}%
+ },%
+ %
+ %
+ % KEY FILTER HANDLERS:
+ %
+ /pgf/key filter handlers/append filtered to/.code={%
+ % Produce
+ % <orig key> '={' <value> '}'
+ % where both, the key and the value are expanded just ONCE:
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentkeyRAW\expandafter=\expandafter{\pgfkeyscurrentvalue}}%
+ \ifx#1\pgfkeys@empty
+ \else
+ % Produce <old list> ',' <orig key> '={' <value> '}'
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter,\the\pgfkeys@tmptoks}%
+ \fi
+ \edef#1{\the\pgfkeys@tmptoks}%
+ },%
+ /pgf/key filter handlers/ignore/.code={},
+ /pgf/key filter handlers/ignore/.install key filter handler,
+ /pgf/key filter handlers/log/.code={%
+ \immediate\write16{LOG: the option '\pgfkeyscurrentkey' (was originally '\pgfkeyscurrentkeyRAW') (case \pgfkeyscasenumber) has not been processed due to pgfkeysfiltered.}%
+ },
+ %
+ %
+ % KEY FILTER PREDICATES:
+ %
+ % Returns true iff the currently processed key belongs to an active family.
+ % A family is active if it has been activated before.
+ /pgf/key filters/active families/.code={%
+ \if\pgfkeyscasenumber0%
+ % unknown options shall be processed with the
+ % unknown-handlers.
+ \pgfkeysfiltercontinuetrue
+ \else
+ \if\pgfkeyscasenumber3%
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ \pgfkeysfiltercontinuefalse
+ \fi
+ \fi
+ },%
+ %
+ %
+ %
+ % This filter works as follows:
+ % 1. if the current key belongs to a family:
+ % return whether its family is active,
+ % 2. if the current key does NOT belong to a family:
+ % return the result of criterion '#1',
+ % 3. the current key is unknown:
+ % return the result of criterion '#2'.
+ %
+ % Arguments:
+ % #1: the predicate which will be invoked in case 2.
+ % It will be invoked with the current case number as argument.
+ % #2: the predicate which will be invoked in case 3 with
+ % the current case number as argument.
+ /pgf/key filters/active families or no family/.code 2 args={%
+ \if\pgfkeyscasenumber0%
+ \pgfkeysevalkeyfilterwith{#2}%
+ \else
+ \if\pgfkeyscasenumber3%
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ \pgfkeysevalkeyfilterwith{#1}%
+ \fi
+ \fi
+ },
+ /pgf/key filters/active families or no family DEBUG/.code 2 args={%
+ \if\pgfkeyscasenumber0%
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}%
+ \pgfkeysevalkeyfilterwith{#2}%
+ \else
+ \if\pgfkeyscasenumber3%
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \ifpgfkeysfiltercontinue
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}%
+ \else
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is NOT active.]}%
+ \fi
+ \else% Ok, it does not belong to any family.
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking has-no-family-handler '#1']}%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \fi
+ \fi
+ },
+ %
+ % A (faster) shortcut for
+ % /pgf/key filters/active families or no family=
+ % {/pgf/keys filters/false}
+ % {/pgf/keys filters/false}
+ /pgf/key filters/active families and known/.code={%
+ \if\pgfkeyscasenumber0%
+ \pgfkeysfiltercontinuefalse
+ \else
+ \if\pgfkeyscasenumber3%
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ \pgfkeysfiltercontinuefalse
+ \fi
+ \fi
+ },
+ % A (faster) shortcut for
+ % /pgf/key filters/active families or no family=
+ % {/pgf/key filters/is descendant of=#1}% for keys without family
+ % {/pgf/keys filters/false}
+ /pgf/key filters/active families or descendants of/.code={%
+ \if\pgfkeyscasenumber0%
+ \pgfkeysfiltercontinuefalse
+ \else
+ \if\pgfkeyscasenumber3%
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ % the 'is descendendant of' implementation has been
+ % COPY PASTED here:
+ %
+ % string prefix comparison:
+ \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{%
+ \def\pgfkeyspred@TMP{##1}%
+ \ifx\pgfkeyspred@TMP\pgfkeys@empty
+ \pgfkeysfiltercontinuetrue
+ \else
+ \pgfkeysfiltercontinuefalse
+ \fi
+ }%
+ \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov
+ \fi
+ \fi
+ },
+ %
+ % Processes only options which are childs of #1.
+ % Example:
+ % is descendant of/.install key filter=/foo
+ % will be true for
+ % /foo/bar/x=y
+ % /foo/.cd
+ % /foo/bar/.style=...
+ % but not for
+ % /bar/foo/...
+ /pgf/key filters/is descendant of/.code={%
+ \if\pgfkeyscasenumber0%
+%\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is UNKNOWN. Calling unknown handler.}%
+ % unknown options shall be processed with the
+ % unknown-handlers.
+ \pgfkeysfiltercontinuetrue
+ \else
+ % string prefix comparison:
+ % [ note : this has been COPY-PASTED to
+ % |active families or descendants of| ]
+ \def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{%
+ \def\pgfkeyspred@TMP{##1}%
+ \ifx\pgfkeyspred@TMP\pgfkeys@empty
+%\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': TRUE.}%
+ \pgfkeysfiltercontinuetrue
+ \else
+%\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': FALSE.}%
+ \pgfkeysfiltercontinuefalse
+ \fi
+ }%
+ \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov
+ \fi
+ },%
+ %
+ %
+ %
+ % Returns true if the currently processed full key equals #2.
+ /pgf/key filters/equals/.code={%
+ \if\pgfkeyscasenumber0%
+ % Unknown option:
+ \pgfkeysfiltercontinuetrue
+ \else
+ \def\pgfkeyspred@TMP{#1}%
+ \ifx\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \pgfkeysfiltercontinuetrue
+ \else
+ \pgfkeysfiltercontinuefalse
+ \fi
+ \fi
+ },%
+ %
+ %
+ % Argument #1 can be any other (evaluated) filter predicate, its logical return
+ % value will be inverted.
+ % Example:
+ % not/.install key filter={is descendend of=/tikz}
+ % will install a key filter which evaluates 'is descendant of' with argument '/tikz' and returns the logical negation of the result.
+ %
+ /pgf/key filters/not/.code={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysfiltercontinuefalse
+ \else
+ \pgfkeysfiltercontinuetrue
+ \fi
+ },%
+ /pgf/key filters/and/.code 2 args={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysevalkeyfilterwith{#2}%
+ \fi
+ },%
+ /pgf/key filters/or/.code 2 args={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \else
+ \pgfkeysevalkeyfilterwith{#2}%
+ \fi
+ },%
+ /pgf/key filters/true/.code={\pgfkeysfiltercontinuetrue},%
+ /pgf/key filters/true/.install key filter,
+ /pgf/key filters/false/.code={%
+ \pgfkeysfiltercontinuefalse
+ },%
+ %
+ % Returns false if the current key is unknown, which avoids calling
+ % the unknown handlers.
+ /pgf/key filters/defined/.code={%
+ \if\pgfkeyscasenumber0%
+ \pgfkeysfiltercontinuefalse
+ \else
+ \pgfkeysfiltercontinuetrue
+ \fi
+ },
+}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Private IMPLEMENTATION
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+% This command does THE SAME work as \pgfkeys@case@one,
+% but it applies filtering whenever it identified the type of an
+% option.
+\def\pgfkeys@case@one@filtered{%
+ \pgfkeys@cur@is@descendant@of@errors
+ \ifpgfkeysfiltercontinue
+ \pgfkeys@orig@case@one
+ \else
+ \pgfkeysfiltercontinuetrue
+ \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{%
+ % CASE ONE: a command option
+ \def\pgfkeyscasenumber{1}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \else
+%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ % CASE TWO: a normal value option
+ \pgfkeysifdefined{\pgfkeyscurrentkey}{%
+ \def\pgfkeyscasenumber{2}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@case@two@extern
+ \else
+%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ \pgfkeys@split@path
+ % CASE THREE: a handler
+ \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{%
+ \pgfkeys@ifexecutehandler{%
+ \def\pgfkeyscasenumber{3}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \else
+%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ \pgfkeys@unknown
+ }%
+ }{%
+ \pgfkeys@unknown
+ }%
+ }%
+ }%
+ \fi
+}%
+
+\def\pgfkeys@unknown@filtered{%
+ % CASE ZERO: an unknown option.
+ \def\pgfkeyscasenumber{0}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ % start normal 'unknown' handlers:
+ \pgfkeys@orig@unknown
+ \else
+%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+}
+
+% Does the same as \pgfkeys@try, but it also invokes the key filters.
+\def\pgfkeys@try@filtered{%
+ \ifpgfkeysfiltercontinue
+ \pgfkeys@orig@try
+ \else
+ \pgfkeysfiltercontinuetrue
+ \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}% make sure that \pgfkeys@code doesn't know about 'try'. Important for .is choice
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}}
+ {}% no default, so leave it
+ \fi%
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}%
+ {%
+ % CASE ONE: a command option
+ \def\pgfkeyscasenumber{1}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov%
+ \else
+ \pgfkeys@filtered@handler%
+ \fi
+ \pgfkeyssuccesstrue%
+ }%
+ {%
+ \pgfkeysifdefined{\pgfkeyscurrentpath}%
+ {% CASE TWO: a normal value option
+ \def\pgfkeyscasenumber{2}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text%
+ \pgfkeysvalueof{\pgfkeyscurrentpath}%
+ \else%
+ \pgfkeyslet{\pgfkeyscurrentpath}\pgfkeyscurrentvalue%
+ \fi%
+ \else
+ \pgfkeys@filtered@handler%
+ \fi
+ \pgfkeyssuccesstrue%
+ }%
+ {%
+ \pgfkeys@split@path%
+ \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{%
+ % CASE THREE: a handled key
+ %
+ % in the standard configuration, this check here is redundand
+ % because pgfkeys@ifexecutehandler === true.
+ % It is only interesting for 'handle only existing'.
+ \pgfkeys@ifexecutehandler{%
+ \def\pgfkeyscasenumber{3}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \else
+%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ \pgfkeyssuccesstrue%
+ }{%
+ \pgfkeyssuccessfalse
+ }%
+ }{%
+ \pgfkeyssuccessfalse
+ }%
+ }%
+ }%
+ \fi
+}
+
+
+% #1 the code to invoke after init and before cleanup
+\def\pgfkeys@install@filter@and@invoke#1{%
+ \ifpgfkeysfilteringisactive
+ \pgfkeys@error{Sorry, nested calls to key filtering routines are not allowed. (reason: It is not possible to properly restore the previous filtering state after returning from the nested call)}%
+ \fi
+ \pgfkeysfilteringisactivetrue
+ \let\pgfkeys@case@one=\pgfkeys@case@one@filtered
+ \let\pgfkeys@try=\pgfkeys@try@filtered
+ \let\pgfkeys@unknown=\pgfkeys@unknown@filtered
+ #1%
+ \let\pgfkeys@case@one=\pgfkeys@orig@case@one
+ \let\pgfkeys@try=\pgfkeys@orig@try
+ \let\pgfkeys@unknown=\pgfkeys@orig@unknown
+ \pgfkeysfilteringisactivefalse
+}
+
+
+%--------------------------------------------------
+% \def\pgfkeys@eval@key@filter@subroutine@case@one{%
+% \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{%
+% \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+% \let\pgfkeyspred@TMP=\pgfkeyscurrentvalue
+% \pgfkeys@eval@key@filter@subroutine@restorestate
+% \expandafter\pgfkeys@code\pgfkeyspred@TMP\pgfeov
+% }{%
+% \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyscurrentkey\pgfkeyscurrentvalue\pgfeov%
+% }%
+% }
+% % THIS VERSION IS TOO SLOW. See below.
+% \def\pgfkeysevalkeyfilterwith#1{%
+% \edef\pgfkeys@eval@key@filter@subroutine@restorestate{%
+% \noexpand\def\noexpand\pgfkeyscurrentkey{\pgfkeyscurrentkey}%
+% \noexpand\def\noexpand\pgfkeyscurrentkeyRAW{\pgfkeyscurrentkeyRAW}%
+% \noexpand\def\noexpand\pgfkeyscurrentname{\pgfkeyscurrentname}%
+% \noexpand\def\noexpand\pgfkeyscurrentvalue{\pgfkeyscurrentvalue}%
+% \noexpand\pgfkeys@pathtoks={\pgfkeyscurrentpath}%
+% }%
+% \pgfkeysinterruptkeyfilter
+% \let\pgfkeys@case@one=\pgfkeys@eval@key@filter@subroutine@case@one
+% \pgfkeysalso{#1}%
+% \endpgfkeysinterruptkeyfilter% this here also restored \pgfkeys@case@one.
+% \pgfkeys@eval@key@filter@subroutine@restorestate
+% }%
+%--------------------------------------------------
+
+
+% Evaluates a key filter '#1'. Example:
+% \pgfkeysevalkeyfilterwith{/pgf/key filters/equals=/tikz}
+%
+% \pgfkeysevalkeyfilterwith works only if key filtering is
+% active.
+%
+% The argument '#1' MUST be a FULL KEY.
+%
+% The implementation employs a subset of the \pgfkeysalso code.
+\long\def\pgfkeysevalkeyfilterwith#1{%
+ \pgfkeys@eval@key@filter@subroutine@unpack#1=\pgfkeysnovalue=\pgfkeys@stop
+}%
+\long\def\pgfkeys@eval@key@filter@subroutine@unpack#1=#2=#3\pgfkeys@stop{%
+ \pgfkeys@spdef\pgfkeyspred@TMP{#1}%
+ \edef\pgfkeyspred@TMP{\pgfkeyspred@TMP}%
+ \pgfkeys@spdef\pgfkeyspred@TMPB{#2}% TMPB=value
+ \ifx\pgfkeyspred@TMPB\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyspred@TMP/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyspred@TMP/.@def}{\pgfkeyspred@TMPB}}
+ {}% no default, so leave it
+ \fi%
+ \ifx\pgfkeyspred@TMPB\pgfkeysvaluerequired%
+ \pgfkeysvalueof{/errors/value required/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov%
+ \else%
+ \pgfkeysifdefined{\pgfkeyspred@TMP/.@cmd}{%
+ \pgfkeysgetvalue{\pgfkeyspred@TMP/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyspred@TMPB\pgfeov
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov%
+ }%
+ \fi%
+}
+
+
+\def\pgfkeys@non@outer@newif@#1#2{%
+ \expandafter\edef\csname #2true\endcsname{\noexpand\let\noexpand#1=\noexpand\iftrue}%
+ \expandafter\edef\csname #2false\endcsname{\noexpand\let\noexpand#1=\noexpand\iffalse}%
+ \csname #2false\endcsname
+}%
+
+% For latex and context, this here has the same effect as a \newif
+% applied to 'if#1'. For plain tex, it has also the same effect, but
+% it is not an \outer macro as the plain-tex \newif.
+\def\pgfkeys@non@outer@newif#1{%
+ \expandafter\pgfkeys@non@outer@newif@\csname if#1\endcsname{#1}%
+}
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
index 97727fdbeb7..6a0a1be016d 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
@@ -15,8 +15,10 @@
% prints out a message to the log.
-\def\pgfversion{2.00}
-\def\pgftypesetversion{\oldstylenums{2}.\oldstylenums{00}}
+%\def\pgfversion{2.00-cvs}
+%\def\pgftypesetversion{\oldstylenums{2}.\oldstylenums{00}--\textsc{cvs}}
+\def\pgfversion{2.10}
+\def\pgftypesetversion{\oldstylenums{2}.\oldstylenums{10}}
\ifx\pgfrcsloaded\undefined
@@ -87,7 +89,7 @@
\def\ProvidesFile#1[#2]{\wlog{Loading file #1 version #2.}}
\fi
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgfrcs.code.tex,v 1.21 2008/02/20 11:00:42 tantau Exp $
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgfrcs.code.tex,v 1.24 2010/10/25 20:57:06 ludewich Exp $
\catcode`\@=\pgfrcsatcode
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
index 29c27b499c7..7b3c34a0510 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
@@ -39,6 +39,7 @@
\def\pgfutil@firstoftwo#1#2{#1}
\def\pgfutil@secondoftwo#1#2{#2}
\def\pgfutil@empty{}
+\def\pgfutil@gobble@until@relax#1\relax{}
\def\pgfutil@gobble#1{}
\def\pgfutil@gobbletwo#1#2{}
\def\pgfutil@namedef#1{\expandafter\def\csname #1\endcsname}
@@ -46,8 +47,8 @@
\def\pgfutil@@namelet#1#2{\expandafter\let\expandafter#1\csname#2\endcsname}
\long\def\pgfutil@g@addto@macro#1#2{%
\begingroup
- \toks@\expandafter{#1#2}%
- \xdef#1{\the\toks@}%
+ \pgfutil@toks@\expandafter{#1#2}%
+ \xdef#1{\the\pgfutil@toks@}%
\endgroup}
\newif\ifpgfutil@tempswa
@@ -77,6 +78,19 @@
% pgfutil@in@
\newif\ifpgfutil@in@
+
+% Usage:
+% \pgfutil@in@{one}{three two one}
+% \ifpgfutil@in@
+% -> will be true!
+% \else
+% \fi
+%
+% \pgfutil@in@{,}{1234,456567}
+% \ifpgfutil@in@
+% -> will be true!
+% \else
+% \fi
\def\pgfutil@in@#1#2{%
\def\pgfutil@in@@##1#1##2##3\pgfutil@in@@{%
\ifx\pgfutil@in@##2\pgfutil@in@false\else\pgfutil@in@true\fi}%
@@ -106,9 +120,9 @@
% pgfutil@IfFileExists
-\chardef\pgfutil@inputcheck0
+%\chardef\pgfutil@inputcheck0
\def\pgfutil@IfFileExists#1#2#3{%
- \openin\pgfutil@inputcheck#1 %
+ \openin\pgfutil@inputcheck=#1 %
\ifeof\pgfutil@inputcheck
#3\relax
\else
@@ -119,6 +133,13 @@
\def\pgfutil@InputIfFileExists#1#2#3{\pgfutil@IfFileExists{#1}{\input #1\relax#2}{#3}}%
+% pgfutil@loop (from plain.tex)
+
+\def\pgfutil@loop#1\pgfutil@repeat{\def\pgfutil@body{#1}\pgfutil@iterate}
+\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
+
+
% aux-read-hook
\let\pgfutil@aux@read@hook=\relax
@@ -130,4 +151,314 @@
\newtoks\pgfutil@everybye
+%
+% PDF-Resource management -- might seem strange that this is here, but
+% it turns out to be the correct place since latex and context handle
+% this stuff quite differently
+%
+
+% Adding something to the pdf-resources:
+
+\def\pgfutil@addpdfresource@extgs#1{\pgf@sys@addpdfresource@extgs@plain{#1}}
+\def\pgfutil@addpdfresource@colorspaces#1{\pgf@sys@addpdfresource@colorspaces@plain{#1}}
+\def\pgfutil@addpdfresource@patterns#1{\pgf@sys@addpdfresource@patterns@plain{#1}}
+\def\pgfutil@setuppdfresources{\pgf@sys@setuppdfresources@plain}
+
+
+% Inserts the argument at the begin of the current page (hopefully)
+
+\let\pgfutil@insertatbegincurrentpage=\relax
+
+
+% Library files inclusion
+
+
+% Include a library file.
+%
+% #1 = List of names of library file.
+%
+% Description:
+%
+% This command includes a list of library files. For each file X in the
+% list, the file pgflibraryX.code.tex is included, provided this has
+% not been done earlier.
+%
+% For the convenience of Context users, both round and square brackets
+% are possible for the argument.
+%
+% Example:
+%
+% \usepgflibrary{arrows}
+% \usepgflibrary[patterns,snakes]
+
+\def\usepgflibrary{\pgfutil@ifnextchar[{\use@pgflibrary}{\use@@pgflibrary}}%}
+\def\use@pgflibrary[#1]{\use@@pgflibrary{#1}}
+\def\use@@pgflibrary#1{%
+ \edef\pgf@list{#1}%
+ \pgfutil@for\pgf@temp:=\pgf@list\do{%
+ \expandafter\pgfkeys@spdef\expandafter\pgf@temp\expandafter{\pgf@temp}%
+ \ifx\pgf@temp\pgfutil@empty
+ \else
+ \expandafter\ifx\csname pgf@library@\pgf@temp @loaded\endcsname\relax%
+ \expandafter\let\csname pgf@library@\pgf@temp @loaded\endcsname=\pgfutil@empty%
+ \expandafter\edef\csname pgf@library@#1@atcode\endcsname{\the\catcode`\@}
+ \expandafter\edef\csname pgf@library@#1@barcode\endcsname{\the\catcode`\|}
+ \catcode`\@=11
+ \catcode`\|=12
+ \input pgflibrary\pgf@temp.code.tex
+ \catcode`\@=\csname pgf@library@#1@atcode\endcsname
+ \catcode`\|=\csname pgf@library@#1@barcode\endcsname
+ \fi%
+ \fi
+ }%
+}
+
+
+% Include a module file.
+%
+% #1 = List of names of module files.
+%
+% Description:
+%
+% This command includes a list of module files. For each file X in the
+% list, the file pgfmoduleX.code.tex is included, provided this has
+% not been done earlier.
+%
+% For the convenience of Context users, both round and square brackets
+% are possible for the argument.
+%
+% Example:
+%
+% \usepgfmodule{matrix}
+
+\def\usepgfmodule{\pgfutil@ifnextchar[{\use@pgfmodule}{\use@@pgfmodule}}%}
+\def\use@pgfmodule[#1]{\use@@pgfmodule{#1}}
+\def\use@@pgfmodule#1{%
+ \edef\pgf@list{#1}%
+ \pgfutil@for\pgf@temp:=\pgf@list\do{%
+ \expandafter\ifx\csname pgf@module@\pgf@temp @loaded\endcsname\relax%
+ \expandafter\let\csname pgf@module@\pgf@temp @loaded\endcsname=\pgfutil@empty%
+ \expandafter\edef\csname pgf@module@#1@atcode\endcsname{\the\catcode`\@}
+ \expandafter\edef\csname pgf@module@#1@barcode\endcsname{\the\catcode`\|}
+ \catcode`\@=11
+ \catcode`\|=12
+ \input pgfmodule\pgf@temp.code.tex
+ \catcode`\@=\csname pgf@module@#1@atcode\endcsname
+ \catcode`\|=\csname pgf@module@#1@barcode\endcsname
+ \fi%
+ }%
+}
+
+\def\pgfutilensuremath#1{%
+ \ifmmode#1\else$#1$\fi
+}
+
+
+%
+% Guess the driver:
+%
+
+\def\pgfutil@guessdriver{\edef\pgfsysdriver{pgfsys-\Gin@driver}}
+
+\begingroup
+ \catcode`\"=12
+ \edef\pgf@loc@TMPa{"}%
+ %
+ % prepares file names by checking for double colons.
+ %
+ % If '#1' is a usual file name without anything fancy, \pgfretval
+ % will simply contain it. However, if '#1' contains double colons
+ % (introduces, for example, by pdftex because there are white
+ % spaces in '#1'), the routine
+ % - removes the double colons,
+ % - re-inserts them outside of the string.
+ %
+ % \pgfutilpreparefilename{file.tex} -> file.tex
+ % \pgfutilpreparefilename{"A file name".file} -> "A file name.file"
+ %
+ % The resulting file name is returned in '\pgfretval',
+ % furthermore, a *quoted* version of the file name is returned in
+ % \pgfretvalquoted. The latter result is to have some sort of
+ % output normalisation: if the file name as such contains double
+ % quotes, we don't want to insert another set of them.
+ %
+ % This special handling has the following purposes:
+ % 1. Both, treatment of white spaces and double colons is not
+ % properly defined in TeX. Thus, we should only work with them if
+ % necessary and maintain backwards compatibility as far as
+ % possible.
+ % 2. It *should* work if there are spaces.
+ %
+ \gdef\pgfutilpreparefilename#1{%
+ \begingroup
+ \ifnum\the\catcode`\"=13
+ \pgfutilconvertdcolon
+ \fi
+ \xdef\pgf@temp{#1}%
+ \endgroup
+ \expandafter\pgfutil@in@\expandafter"\expandafter{\pgf@temp}%
+ \ifpgfutil@in@
+ \def\pgf@loc@TMPa{\pgfutilstrreplace{"}{}}%
+ \expandafter\pgf@loc@TMPa\expandafter{\pgf@temp}%
+ \edef\pgfretval{"\pgfretval"}% re-insert quotes! Otherwise, TeX can't use the file name.
+ \let\pgfretvalquoted=\pgfretval
+ \else
+ \let\pgfretval=\pgf@temp
+ \edef\pgfretvalquoted{"\pgfretval"}%
+ \fi
+ }%
+ \catcode`\"=13
+ \xdef\pgfutilconvertdcolon{%
+ \noexpand\def\noexpand"{\pgf@loc@TMPa}%
+ }%
+\endgroup
+
+% Usage:
+% \pgfutilstrreplace{<token>}{<replacement>}{<string>}
+%
+% -> will assign the modified string into \pgfretval.
+%
+% #1: the string to search (one or more tokens)
+% #2: zero, one or more tokens which will be inserted instead of '#1'.
+% #3: the string to search in
+\long\def\pgfutilstrreplace#1#2#3{%
+ \def\pgfretval{}%
+ \long\def\pgfutil@search@and@replace@@##1#1##2\pgf@EOI{%
+ \expandafter\def\expandafter\pgfretval\expandafter{\pgfretval ##1#2}%
+ \pgfutil@search@and@replace@loop{#1}{##2}%
+ }%
+ \pgfutil@search@and@replace@loop{#1}{#3}%
+}
+\long\def\pgfutil@search@and@replace@loop#1#2{%
+ \pgfutil@in@{#1}{#2}%
+ \ifpgfutil@in@
+ \def\pgf@loc@TMPa{\pgfutil@search@and@replace@@ #2\pgf@EOI}%
+ \else
+ \expandafter\def\expandafter\pgfretval\expandafter{\pgfretval #2}%
+ \let\pgf@loc@TMPa=\relax
+ \fi
+ \pgf@loc@TMPa
+}%
+
+% Solves a linear equation system of size 2x2 using gauss elimination.
+%
+% It employs TeX register arithmetics to do so.
+% #1: should contain 4 sets of braces with matrix entries,
+% {<a11>}{<a12>}
+% {<a21>}{<a22>}
+% where each entry should be a number without unit.
+% It is acceptable if '#1' is a macro which expands to the expected
+% format.
+% #2: should contain 2 sets of braces with the right-hand-side,
+% {<r1>}{<r2>}
+% where each entry should be a number without unit.
+% It is acceptable if '#2' is a macro which expands to the expected
+% format.
+%
+% It will assign \pgfmathresult to contain two sets of braces with the
+% result.
+%
+% Example:
+% \pgfutilsolvetwotwoleq{
+% {0.24}{1}
+% {-0.97}{0}
+% }{
+% {-7}
+% {18}
+% }
+% -> yields \pgfmathresult={−18.55618}{−2.54642}
+%
+% The algorithm employs column pivotisation.
+\def\pgfutilsolvetwotwoleq#1#2{%
+ \begingroup
+ \dimendef\aa=0
+ \dimendef\ab=1
+ \dimendef\ba=2
+ \dimendef\bb=3
+ \dimendef\ra=4
+ \dimendef\rb=5
+ \dimendef\tmpa=6
+ \dimendef\tmpb=7
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutilsolvetwotwoleq@A\pgf@temp
+ \edef\pgf@temp{#2}%
+ \expandafter\pgfutilsolvetwotwoleq@r\pgf@temp
+ %
+ \pgfutilsolvetwotwoleq@ifislarger\aa\ba{%
+ % identity "permutation":
+ \def\Pa{a}%
+ \def\Pb{b}%
+ }{%
+ % permutation matrix: switch rows!
+ \def\Pa{b}%
+ \def\Pb{a}%
+ }%
+ % \pivot := 1/aa
+ \pgfmathreciprocal@
+ {\csname m\Pa a\endcsname}%
+ \let\pivot=\pgfmathresult
+ %
+ % \factor := 1/aa * ba
+ \csname \Pb a\endcsname=\pivot\csname \Pb a\endcsname
+ \edef\factor{\expandafter\pgf@sys@tonumber\csname \Pb a\endcsname}%
+ %
+ % bb -= ba/aa * ab
+ \tmpa=-\factor\csname \Pa b\endcsname
+ \advance\csname \Pb b\endcsname by\tmpa
+ %
+ % rb -= ba/aa * ra
+ \tmpa=-\factor\csname r\Pa\endcsname
+ \advance\csname r\Pb\endcsname by\tmpa
+ %
+ % xb := rb / bb (the modified rb and modified bb!)
+ \pgfmathdivide@
+ {\expandafter\pgf@sys@tonumber\csname r\Pb\endcsname}
+ {\expandafter\pgf@sys@tonumber\csname \Pb b\endcsname}%
+ \expandafter\let\csname pgfmathresult\Pb\endcsname=\pgfmathresult
+ %
+ % ra -= xb * ab
+ \tmpa=\csname pgfmathresult\Pb\endcsname\csname \Pa b\endcsname
+ \advance\csname r\Pa\endcsname by-\tmpa
+ %
+ % xa := 1/aa * ra (the modified ra!)
+ \tmpa=\pivot\csname r\Pa\endcsname
+ \expandafter\edef\csname pgfmathresult\Pa\endcsname{\pgf@sys@tonumber\tmpa}%
+ %
+ \edef\pgfmathresult{%
+ {\csname pgfmathresult\Pa\endcsname}%
+ {\csname pgfmathresult\Pb\endcsname}%
+ }%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+\def\pgfutilsolvetwotwoleq@ifislarger#1#2#3#4{%
+ \tmpa=#1
+ \ifdim\tmpa<0pt
+ \multiply\tmpa by-1
+ \fi
+ \tmpb=#2
+ \ifdim\tmpb<0pt
+ \multiply\tmpb by-1
+ \fi
+ \ifdim\tmpa>\tmpb
+ #3%
+ \else
+ #4%
+ \fi
+}%
+\def\pgfutilsolvetwotwoleq@A#1#2#3#4{%
+ \def\maa{#1}\def\mab{#2}%
+ \def\mba{#3}\def\mbb{#3}%
+ \aa=#1pt \ab=#2pt
+ \ba=#3pt \bb=#4pt
+}
+\def\pgfutilsolvetwotwoleq@r#1#2{%
+ \ra=#1pt \rb=#2pt
+}%
+
+% there are funny programs which overwrite \read and \write (like
+% tabularx).
+\let\pgfutil@write=\write
+\let\pgfutil@read=\read
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
index 784cb59cdc9..08d3bf93c77 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
@@ -59,7 +59,15 @@
\edef#3{\expandafter\expandafter\expandafter\pgfutil@emu@select\csname\string\color@#1\endcsname}%
}
-\let\pgfutil@doifcolorelse=\doifcolorelse
+
+\def\pgfutil@doifcolorelse#1#2#3{%
+ \expandafter\ifx\csname\string\color@#1\endcsname\relax%
+ \doifcolorelse{#1}{\let\pgf@next=\pgfutil@firstoftwo}{\let\pgf@next=\pgfutil@secondoftwo}%
+ \else
+ \let\pgf@next=\pgfutil@firstoftwo%
+ \fi%
+ \pgf@next{#2}{#3}%
+}
\def\pgfutil@reset@color{%
@@ -136,12 +144,12 @@
\edef\pgf@marshal{\noexpand\pgfutil@in@{ g}{\pgf@temp}}%
\pgf@marshal%
\ifpgfutil@in@%
- \expandafter\pgfutil@context@parse@gray\pgf@temp{#1}%
+ \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}%
\else%
\edef\pgf@marshal{\noexpand\pgfutil@in@{ rg}{\pgf@temp}}%
\pgf@marshal%
\ifpgfutil@in@%
- \expandafter\pgfutil@context@parse@rgb\pgf@temp{#1}%
+ \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}%
\else%
\PackageError{pgf}{Color #1 has an unsupported color model.}{}%
\pgfutil@definecolor{#1}{gray}{0}
@@ -149,14 +157,16 @@
\fi%
}
-\def\pgfutil@context@parse@gray#1 g#2{%
- \pgfutil@definecolor{#2}{gray}{#1}
+\def\pgfutil@context@parse@gray#1 g#2\pgf@stop#3{%
+ \pgfutil@definecolor{#3}{gray}{#1}
}
-\def\pgfutil@context@parse@rgb#1 #2 #3 rg#4{%
- \pgfutil@definecolor{#4}{rgb}{#1,#2,#3}
+\def\pgfutil@context@parse@rgb#1 #2 #3 rg#4\pgf@stop#5{%
+ \pgfutil@definecolor{#5}{rgb}{#1,#2,#3}
}
+% Make this command available in general:
+\let\colorlet=\pgfutil@colorlet
% pgfutil@minipage
@@ -174,12 +184,39 @@
\ifx\pdfoutput\@undefined\newcount\pdfoutput\fi
\ifx\pdfoutput\relax\newcount\pdfoutput\fi
-\ifcase\pdfoutput%
- \gdef\Gin@driver{dvips.def}%
-\else%
- \gdef\Gin@driver{pdftex.def}%
-\fi%
+\def\pgfutil@guessdriver{
+ \ifx\XeTeXversion\@undefined
+ \ifx\preloadedspecials\@undefined%
+ \ifcase\pdfoutput%
+ \def\pgfsysdriver{pgfsys-dvips.def}%
+ \else%
+ \def\pgfsysdriver{pgfsys-pdftex.def}% pdfTeX & LuaTeX
+ \fi%
+ \else%
+ \pgfutil@driver@if@in{postscript}{pgfsys-dvips.def}
+ \pgfutil@driver@if@in{tpd}{pgfsys-pdftex.def}
+ \pgfutil@driver@if@in{dpm}{pgfsys-dvipdfm.def}
+ \pgfutil@driver@if@in{dpx}{pgfsys-dvipdfmx.def}
+ \pgfutil@driver@if@in{xetex}{pgfsys-xetex.def}
+ \ifx\pgfsysdriver\relax%
+ \PackageWarning{pgf}{I was not able to discern the driver, the
+ preloaded specials were \preloadedspecials. I am going to use
+ pgfsys-dvips.def}%
+ \def\pgfsysdriver{pgfsys-dvips.def}
+ \fi%
+ \fi
+ \else
+ \def\pgfsysdriver{pgfsys-xetex.def}% should be right
+ \fi
+}
+\def\pgfutil@driver@if@in#1#2{%
+ \edef\pgf@marshal{\noexpand\pgfutil@in@{#1}{\preloadedspecials}}
+ \pgf@marshal
+ \ifpgfutil@in@%
+ \def\pgfsysdriver{#2}%
+ \fi%
+}
% Global colors
@@ -191,7 +228,7 @@
% Font stuff
-\def\pgfutil@font@tiny{\tfxx} % How to do this correctly?
+\def\pgfutil@font@tiny{\tfxx}
\def\pgfutil@font@scriptsize{\tfxx}
\def\pgfutil@font@footnotesize{\tfx}
\def\pgfutil@font@small{\tfx}
@@ -204,9 +241,9 @@
\def\pgfutil@font@itshape{\it}
\def\pgfutil@font@bfseries{\bf}
-\let\pgfutil@font@normalfont=\rm
+\let\pgfutil@font@normalfont=\tf
-\let\pgfutil@selectfont=\rm
+\let\pgfutil@selectfont=\tf
% Extra counters, registers, boxes
@@ -219,14 +256,68 @@
\newdimen\pgfutil@tempdima
\newdimen\pgfutil@tempdimb
+\newbox \pgfutil@voidb@x
+\newtoks \pgfutil@toks@
+
% Module stuff
-\def\pgfutil@usemodule#1{\usemodule[#1]}
+\long\def\pgfutil@usemodule#1{%
+ % seems as if \usemodule resets \catcodes... handle that here:
+ \long\edef\pgf@temp##1{%
+ \noexpand\usemodule[##1]\noexpand\relax%
+ \noexpand\catcode`\noexpand\@=\the\catcode`\@\relax
+ \noexpand\catcode`\noexpand\|=\the\catcode`\|\relax
+ }%
+ \pgf@temp{#1}%
+}
-% End of job stuff
+% Adding something at the begin of the current page:
+
+\let\pgfutil@insertatbegincurrentpagefrombox=\flushatshipout
+\let\pgfutil@insertatbegincurrentpage=\flushatshipout
+\def\pgfutil@insertatbegineverypage#1{\appendtoks #1 \to \everyshipout}
+
+% Adding something to the pdf-resources:
+
+\def\pgfutil@addpdfresource@extgs#1{\appendtoPDFdocumentextgstates{#1}}
+\def\pgfutil@addpdfresource@colorspaces#1{\appendtoPDFdocumentcolorspaces{#1}}
+\def\pgfutil@addpdfresource@patterns#1{\appendtoPDFdocumentpatterns{#1}}
+\def\pgfutil@setuppdfresources{}
+
+\ifx\appendtoPDFdocumentpatterns\undefined
+ \let\docuPDFpatterns\empty
+ \def\checkPDFpatterns
+ {\ifx\docuPDFpatterns\empty \else
+ \ifnum\realpageno=\lastpage\relax
+ \doPDFdictionaryobject{FDF}{docupatterns}{\docuPDFpatterns}%
+ \fi
+ \doPDFgetobjectreference{FDF}{docupatterns}\PDFobjectreference
+ \doPDFpageresource{/Pattern \PDFobjectreference}%
+ \fi}
+ \appendtoksonce \checkPDFpatterns \to \everyshipout
+ \def\appendtoPDFdocumentpatterns#1{\xdef\docuPDFpatterns{\docuPDFpatterns\space#1}}
+\fi
+
+% Collect resources (don't know how to do this otherwise)
+
+\def\pgf@sys@pdf@check@resources{%
+ \global\let\pgf@sys@pdf@possible@resources\pgfutil@empty%
+ \doifobjectreferencefoundelse{FDF}{docushades}
+ {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference
+ \xdef\pgf@sys@pdf@possible@resources{\pgf@sys@pdf@possible@resources/Shading \PDFobjectreference}}\donothing
+ \doifobjectreferencefoundelse{FDF}{docuextgstates}
+ {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference
+ \xdef\pgf@sys@pdf@possible@resources{\pgf@sys@pdf@possible@resources/ExtGState \PDFobjectreference}}\donothing
+ \doifobjectreferencefoundelse{FDF}{colorspaces}
+ {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference
+ \xdef\pgf@sys@pdf@possible@resources{\pgf@sys@pdf@possible@resources/ColorSpace \PDFobjectreference}}\donothing
+}
+
+
+% Do something at the end of a job
\appendtoks \the\pgfutil@everybye \to \everybye
@@ -237,9 +328,9 @@
% prefixed by pgfutil@):
\def\PackageInfo#1#2{}
-\def\PackageWarning#1#2{\immediate\write-1{Package #1: Warning! #2.}}%
-\def\PackageError#1#2#3{\immediate\write-1{Package #1: Error! #2.}}%
+\def\PackageWarning#1#2{\immediate\write17{Package #1: Warning! #2.}}%
+\def\PackageError#1#2#3{\immediate\write17{Package #1: Error! #2.}}%
\long\def\AtBeginDocument#1{#1}%
-\long\def\AtBeginDvi#1{#1}%
\endinput
+% vi: ft=tex ts=2 sw=2 expandtab
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
index b50830db666..f9681aa4a56 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
@@ -13,6 +13,9 @@
\let\pgfutil@auxout=\@auxout
\let\pgfutil@tempcnta=\@tempcnta
\let\pgfutil@tempcntb=\@tempcntb
+\let\pgfutil@voidb@x=\voidb@x
+\let\pgfutil@toks@=\toks@
+
\def\pgfutil@definecolor{\definecolor}
\def\pgfutil@color{\color}
@@ -61,4 +64,38 @@
\AtEndDocument{\the\pgfutil@everybye}
+\def\pgfutil@insertatbegincurrentpagefrombox#1{%
+ \global\setbox\pgfutil@abb\hbox{\unhbox\pgfutil@abb#1}%
+}
+\newbox\pgfutil@abb%
+\def\pgfutil@insertatbegincurrentpage#1{%
+ \expandafter\gdef\expandafter\pgfutil@abc\expandafter{\pgfutil@abc#1}%
+}
+\let\pgfutil@abc\pgfutil@empty%
+\def\pgfutil@insertatbegineverypage#1{%
+ \expandafter\gdef\expandafter\pgfutil@abe\expandafter{\pgfutil@abe#1}%
+}
+\let\pgfutil@abe\pgfutil@empty%
+
+\RequirePackage{everyshi}
+\EveryShipout{%
+ % Add at begin page stuff
+ \setbox\@cclv=\vbox{%
+ \setbox\z@=\hbox{\pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty}%
+ \wd\z@=\z@
+ \ht\z@=\z@
+ \dp\z@=\z@
+ \box\z@
+ % if TeX changes into vertical mode, it inserts \parskip and
+ % \lineskip. Disable it here:
+ \nointerlineskip
+ \ifvbox\@cclv \unvbox\@cclv \else\hsize=\wd\@cclv \unhbox\@cclv \fi%
+ %\box\@cclv
+ % using \box instead of \unhbox or \unvbox
+ % has the advantage that glue settings won't be
+ % altered (as for \unhbox/\unvbox). But \box breaks compatibility
+ % with the 'remember picture' feature.
+ }%
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
index 9128021faa7..c09cf21fe0f 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
@@ -157,12 +157,20 @@
\ifx\pdfoutput\@undefined\alloc@0\count\countdef\insc@unt\pdfoutput\fi
\ifx\pdfoutput\relax\alloc@0\count\countdef\insc@unt\pdfoutput\fi
-\ifcase\pdfoutput%
- \gdef\Gin@driver{dvips.def}%
-\else%
- \gdef\Gin@driver{pdftex.def}%
-\fi%
+\def\pgfutil@guessdriver{
+ \ifcase\pdfoutput%
+ \ifx\XeTeXversion\@undefined
+ \def\pgfsysdriver{pgfsys-dvips.def}% hopefully
+ \else
+ \def\pgfsysdriver{pgfsys-xetex.def}% should be right
+ \fi
+ \else%
+ \def\pgfsysdriver{pgfsys-pdftex.def}% should be right
+ \fi%
+}
+
+
% Global colors
@@ -213,14 +221,62 @@
\let\pgfutil@origend=\end
\def\end{\the\pgfutil@everybye\pgfutil@origend}
+% Link to existing stuff
+\let\pgfutil@voidb@x\voidb@x
+\let\pgfutil@toks@\toks@
+
+
+
+
+% Hack shipout. Should perhaps use atbegshi? Not in standard distribution, currently...
+% Code inspired (but patched...) from everyshi.sty:
+
+\def\pgfutil@insertatbegincurrentpagefrombox#1{%
+ \global\setbox\pgfutil@abb\hbox{\unhbox\pgfutil@abb#1}%
+}
+\newbox\pgfutil@abb%
+\def\pgfutil@insertatbegincurrentpage#1{%
+ \expandafter\gdef\expandafter\pgfutil@abc\expandafter{\pgfutil@abc#1}%
+}
+\let\pgfutil@abc\pgfutil@empty%
+\def\pgfutil@insertatbegineverypage#1{%
+ \expandafter\gdef\expandafter\pgfutil@abe\expandafter{\pgfutil@abe#1}%
+}
+\let\pgfutil@abe\pgfutil@empty%
+
+\def\pgfutil@@EveryShipout@Shipout{%
+ \afterassignment\pgfutil@@EveryShipout@Test
+ \setbox255= %
+}
+\def\pgfutil@@EveryShipout@Test{%
+ \ifvoid\@cclv\relax
+ \aftergroup\pgfutil@EveryShipout@Output
+ \else
+ \pgfutil@EveryShipout@Output
+ \fi%
+}
+\def\pgfutil@EveryShipout@Output{%
+ \setbox255=\vbox{%
+ \setbox0=\hbox{\pgfutil@abe\unhbox\pgfutil@abb\pgfutil@abc\global\let\pgfutil@abc\pgfutil@empty}%
+ \wd0=0pt%
+ \ht0=0pt%
+ \dp0=0pt%
+ \box0%
+ \unvbox255%
+ }%
+ \pgfutil@@EveryShipout@Org@Shipout\box\@cclv%
+}
+\let\pgfutil@@EveryShipout@Org@Shipout\shipout
+\let\shipout\pgfutil@@EveryShipout@Shipout
+
+
% The following is still messy and needs to be cleanup up (everything
% prefixed by pgfutil@):
\def\PackageInfo#1#2{}
-\def\PackageWarning#1#2{\immediate\write-1{Package #1: Warning! #2.}}%
-\def\PackageError#1#2#3{\immediate\write-1{Package #1: Error! #2.}}%
+\def\PackageWarning#1#2{\immediate\write17{Package #1: Warning! #2.}}%
+\def\PackageError#1#2#3{\immediate\write17{Package #1: Error! #2.}}%
\long\def\AtBeginDocument#1{#1}%
-\long\def\AtBeginDvi#1{#1}%
\endinput
diff --git a/Master/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty b/Master/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
index 813747920d9..67ad19b7411 100644
--- a/Master/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
+++ b/Master/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
@@ -12,6 +12,8 @@
\RequirePackage{keyval}
\RequirePackage{xcolor}
+\def\pgf@texdist@protect{\protect}%
+
\input{pgfcore.code.tex}
\endinput
diff --git a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex
new file mode 100644
index 00000000000..1c20205676b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex
@@ -0,0 +1,65 @@
+% 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/},
+ %
+ % 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/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
new file mode 100644
index 00000000000..e507d30e85c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
@@ -0,0 +1,414 @@
+%--------------------------------------------
+%
+% 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/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
new file mode 100644
index 00000000000..85482fedaaf
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
@@ -0,0 +1,1095 @@
+%--------------------------------------------
+%
+% 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/tex/latex/pgf/doc/pgfmanual.sty b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.sty
new file mode 100644
index 00000000000..e084fd41837
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.sty
@@ -0,0 +1,12 @@
+% 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.
+
+\ProvidesPackage{pgfmanual}[2009/10/15]
+
+\input pgfmanual.code.tex
diff --git a/Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex b/Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
new file mode 100644
index 00000000000..9fe775dc8a8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
@@ -0,0 +1,68 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% 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.
+%
+%
+% This file provides a high-level automatic export feature for tikz pictures.
+% It allows to export EACH SINGLE FIGURE into a separate PDF.
+%
+% The simplest way is to use
+%
+% \tikzexternalize{myarticle}
+%
+% it simply converts every figure using the write18 method. If that is not possible,
+% you need to reconfigure \tikzexternalize: it can generate a list of figure file names
+% and you need to generate these figures manually (or with a script).
+%
+% It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes \beginpgfgraphicnamed ... \endpgfgraphicnamed
+% commands if necessary.
+
+% source generic implementation:
+\input tikzexternalshared.code.tex
+
+\def\tikzexternal@TEXDIALECT@begpicture{\begin{tikzpicture}}
+\def\tikzexternal@TEXDIALECT@endpicture{\end{tikzpicture}}%
+
+% this latex specific this assumes it starts at the beginning of an
+% environment. The environment is named
+% '\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring'.
+%
+% Everything up to \end{<name>} will be collected and passed as
+% argument to the macro '#1'.
+%
+% This does also work if <name> is NOT tikzpicture!
+\def\tikzexternal@TEXDIALECT@collectpicture#1{%
+ \begingroup
+ \t@tikzexternal@tmpa={}%
+ \tikzexternal@laTeX@collect@until@end@tikzpicture{#1}%
+}
+
+% Loop until we find '\end{tikzpicture}'. We have to make sure that
+% even strings like '#1' are allowed inside of the collected argument.
+\long\def\tikzexternal@laTeX@collect@until@end@tikzpicture#1#2\end#3{%
+ \def\tikzexternal@laTeX@collect@until@end@tikzpicture@{#3}%
+ \ifx\tikzexternal@laTeX@collect@until@end@tikzpicture@\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring
+ \t@tikzexternal@tmpa=\expandafter{\the\t@tikzexternal@tmpa #2}%
+ \edef\tikzexternal@TEXDIALECT@collectpicture@next{%
+ \noexpand\endgroup
+ \noexpand#1{\the\t@tikzexternal@tmpa}%
+ }%
+ \else
+ \t@tikzexternal@tmpa=\expandafter{\the\t@tikzexternal@tmpa #2\end{#3}}%
+ \def\tikzexternal@TEXDIALECT@collectpicture@next{%
+ \tikzexternal@laTeX@collect@until@end@tikzpicture{#1}}%
+ \fi
+ \tikzexternal@TEXDIALECT@collectpicture@next
+}%
+\def\tikzexternal@laTeX@collect@until@end@tikzpicturetikzpicturestring{tikzpicture}%
+
+\AtBeginDocument{%
+ \pgfutil@ifundefined{tikzexternalrealjob}{%
+ \global\let\tikzexternalrealjob=\jobname
+ }{}%
+}%
diff --git a/Master/texmf-dist/tex/latex/pgf/utilities/pgffor.sty b/Master/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
index 4a4dbc9c0d9..dc04e9aeea2 100644
--- a/Master/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
@@ -8,6 +8,7 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
\RequirePackage{pgfrcs}
+\RequirePackage{pgfkeys}
\input{pgffor.code.tex}
diff --git a/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty b/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty
index 2d29926b63c..9e1ebc3035e 100644
--- a/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty
@@ -852,14 +852,14 @@
\@resetactivechars
\global\let\@@if@newlist\if@newlist
\global\@newlistfalse
- \@parboxrestore
+ \@parboxrestore%
\pgfpages@originalshipout%
- \hbox{%
+ \vbox{\hbox{%
\hskip-1in%
\vbox to \pgfphysicalheight{%
\vss\box\pgfpages@shipoutbox%
\vskip1in%
- }}%
+ }}}%
\endgroup%
}
diff --git a/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty b/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
new file mode 100644
index 00000000000..a6aacd5fd7c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/tikzexternal.sty
@@ -0,0 +1,144 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% 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.
+%
+% In addition to the above licenses, this particular file may also be
+% directly inlined into other documents and this copyright notice may
+% be removed. Additionally, when you inline this file, you may modify
+% it as needed and you may remove comments.
+%
+% This file is intended to be distributed or even inlined into a file
+% when a document needs to be typeset on a system that does not have
+% pgf/TikZ installed.
+%
+% It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes the
+% \includegraphics with the correct file name instead.
+
+\RequirePackage{graphicx}
+
+\toksdef\t@tikzexternal@tmpa=0
+\toksdef\t@tikzexternal@tmpb=1
+
+\def\tikzexternalize{\@ifnextchar[{\tikzexternalize@opt}{\tikzexternalize@opt[]}}%
+\def\tikzexternalize@opt[#1]{\@ifnextchar\bgroup{\def\tikzexternal@realjob}{\let\tikzexternal@realjob=\jobname}}%
+
+\def\tikzsetnextfilename#1{\gdef\tikzexternal@nextfile{#1}}
+\def\tikzsetexternalprefix#1{\def\tikzexternal@filenameprefix{#1}}
+\def\tikzsetfigurename#1{\def\tikzexternal@figurename{#1}}%
+\def\tikzappendtofigurename#1{\expandafter\def\expandafter\tikzexternal@figurename\expandafter{\tikzexternal@figurename #1}}%
+\tikzsetnextfilename{}
+\tikzsetexternalprefix{}
+\tikzsetfigurename{\tikzexternal@realjob-figure}%
+
+\long\def\tikzpicture#1\end#2{% collect every thing up to \end{tikzpicture}
+ \def\tikzexternal@laTeX@collectpicture@@{#2}%
+ \ifx\tikzexternal@laTeX@collectpicture@@\tikzexternal@laTeX@tikzpicturestring
+ \tikzexternal@image
+ \end{tikzpicture}%
+ \else
+ \expandafter
+ \tikzpicture
+ \fi
+}%
+\def\endtikzpicture{}
+\def\tikzexternal@laTeX@tikzpicturestring{tikzpicture}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Replacement for \tikz short command:
+\def\tikz{\@ifnextchar[{\tikz@opt}{\tikz@opt[]}}
+\def\tikz@opt[#1]{\@ifnextchar\bgroup{\tikz@opt@{#1}}{\tikz@opt@@{#1}}}
+\def\tikz@opt@#1#2{\tikz@opt@process{#1}{#2}}
+\def\tikz@opt@@#1{%
+ \def\tikz@next{\tikz@collectnormalsemicolon{#1}}%
+ \ifnum\the\catcode`\;=\active\relax%
+ \def\tikz@next{\tikz@collectactivesemicolon{#1}}%
+ \fi%
+ \tikz@next}
+\def\tikz@collectnormalsemicolon#1#2;{\tikz@opt@process{#1}{#2;}}
+{
+ \catcode`\;=\active
+ \gdef\tikz@collectactivesemicolon#1#2;{%
+ \tikz@opt@process{#1}{#2;}%
+ }
+}
+\def\tikz@opt@process#1#2{\tikzexternal@image}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\tikzexternal@image{%
+ \leavevmode
+ \begingroup
+ \t@tikzexternal@tmpa=\expandafter{\tikzexternal@filenameprefix}%
+ \ifx\tikzexternal@nextfile\empty
+ \expandafter\ifx\csname c@tikzext@no@\tikzexternal@figurename\endcsname\relax
+ \expandafter\gdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{0}%
+ \fi
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@figurename}%
+ \count0=\csname c@tikzext@no@\tikzexternal@figurename\endcsname
+ \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb\the\count0 }%
+ \advance\count0 by1\relax
+ \expandafter\xdef\csname c@tikzext@no@\tikzexternal@figurename\endcsname{\the\count0 }%
+ \else
+ \t@tikzexternal@tmpb=\expandafter{\tikzexternal@nextfile}%
+ \xdef\tikzexternal@curfilename{\the\t@tikzexternal@tmpa\the\t@tikzexternal@tmpb}%
+ \fi
+ \endgroup
+ \global\let\tikzexternal@nextfile=\empty
+ \pgfincludeexternalgraphics\tikzexternal@curfilename
+}%
+\def\tikzset#1{}\def\pgfkeys#1{}\def\pgfqkeys#1#2{}
+\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{\pgfincludeexternalgraphics{#1}}
+\def\tikzifinpicture#1#2{#2}
+\def\pgfincludeexternalgraphics#1{%
+ \begingroup
+ \pgfexternalreaddpth{#1}%
+ \setbox1=\hbox{\includegraphics{#1}}%
+ \ifdim\pgfretval=0pt
+ \box1
+ \else
+ \dimen0=\pgfretval\relax
+ \hbox{\lower\dimen0 \box1 }%
+ \fi
+ \endgroup
+}
+\newread\r@pgf@reada
+\def\pgfexternalreaddpth#1{%
+ \edef\pgfexternalreaddpth@restore{%
+ \noexpand\endlinechar=\the\endlinechar\space
+ \noexpand\catcode`\noexpand\@=\the\catcode`\@\space
+ }%
+ \def\pgfretval{0pt}%
+ \endlinechar=-1 % suppress white space at end
+ \catcode`\@=11
+ \openin\r@pgf@reada=#1.dpth
+ \pgfincludeexternalgraphics@read@dpth
+ \pgfexternalreaddpth@restore
+}%
+\def\pgfincludeexternalgraphics@read@dpth{%
+ \ifeof\r@pgf@reada
+ \closein\r@pgf@reada
+ \else
+ \read\r@pgf@reada to\pgfincludeexternalgraphics@auxline
+ \ifx\pgfincludeexternalgraphics@auxline\empty
+ \else
+ \expandafter\pgfincludeexternalgraphics@read@dpth@line\pgfincludeexternalgraphics@auxline\pgfincludeexternalgraphics@read@dpth@line@EOI
+ \fi
+ \expandafter\pgfincludeexternalgraphics@read@dpth
+ \fi
+}%
+\long\def\pgfincludeexternalgraphics@read@dpth@line#1#2\pgfincludeexternalgraphics@read@dpth@line@EOI{%
+ \ifcat\noexpand#1\relax
+ \if@filesw
+ {\toks0={#1#2}%
+ \immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }%
+ }%
+ \fi
+ \else%
+ \def\pgfretval{#1#2}%
+ \fi
+}%
+
diff --git a/Master/texmf-dist/tex/plain/pgf/utilities/pgffor.tex b/Master/texmf-dist/tex/plain/pgf/utilities/pgffor.tex
index 4b5e8177135..15d6ea34211 100644
--- a/Master/texmf-dist/tex/plain/pgf/utilities/pgffor.tex
+++ b/Master/texmf-dist/tex/plain/pgf/utilities/pgffor.tex
@@ -11,6 +11,7 @@
\catcode`\@=11
\input pgfrcs.tex
+\input pgfkeys.code.tex
\input pgffor.code.tex
\catcode`\@=\pgfforatcode